-
-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ekg-setup-notes-buffer'
setq-local' default-directory' to
ekg-db-file' parent directory.
#182
Conversation
Thank you for the contribution! Two questions: can you explain more why you think the directory should be consistent? It might be nice, but also using the directory where the db file is seems pretty arbitrary. I've always thought that the user wouldn't really need to do file-related operations when using ekg. How has this been useful for you? And for the completion methods, we have in general been doing completion with |
(save-excursion
(info "(ekg)Installing by hand")
(ekg-show-notes-in-trash)
(dired default-directory))
(save-excursion
(find-file
(concat (file-name-sans-extension (locate-library "ekg")) ".el"))
(ekg-show-notes-in-trash)
(dired default-directory)) As just two (of possibly many) examples, without the submitted patch to The utility of doing
Regarding Since submitting my patch, I have been using ekg daily and have become more If I were defining the ekg.el API, i would provide two customizable variables: IF there were an (apply ekg-tags-complete-function
{... completion args ...}) With the above (or equivalent) additions to As such, I have recently updated the current pull request with the new custom variables |
… Add new custom variable `ekg-tags-complete-multiple-function'
…ete-multiple-function'
…en optional arg MULTIPLE is non-nil.
…e predicate is not needed with CL style keywords
… strings in certain arguments to `ekg-tags-complete' functions
…gs completion with `string-distance'
Thanks for the extensive explanations. Let's take each part of this at a time. You've convinced me about the For the other one, normally if a user wanted to change how completion worked by substituting a different function, they could customize |
Please incorporate only the code you feel is appropriate to the needs of the project. 🙂 |
It's a bit odd to just merge in parts of a pull request via Github, so to fix the default-directory issue, I'd probably just re-implement it. I'd prefer to merge in a change of yours to do that, because this is your contribution, and it's always nice to have that contribution recorded with you as the author. Let me know, either way would be fine. Thanks again for the contribution! |
If it's all the same to you, I'd prefer if you merged my change for the contributor credit, but this pull request is a mess so definitely do what is easiest for you :) Commit 0bd4050 has the relevant changes. |
This reverts commit c0cd94e.
ekg-setup-notes-buffer
setq-local
ofdefault-directory
toekg-db-file
parent directory.The intention here is that the notes buffer should default to the parent directory of the user's
ekg-db-file
. I was surprised when evaluatingekg-show-notes-latest-captured
(and similar functions), that the"*ekg <FOO>*"
notes buffer defaulted to whichever directory theekg-show-<FOO>
function was called-interactively from. I expected these types of ekg commands would default to a consistent location. It makes more sense to me that the consistent location be the parent directory of theekb-db-file
rather than an arbitrary directory that potentially changes each time a notes buffer is presented. Note, the first attempt at commit c6f3a9b to let binddefault-directory
doesn't work, but thesetq-local
ofdefault-directory
at commit 0bd4050 does work as intended.Added two new basic built-in ekg-tags completion functions:
ekg-tags-complete
andekg-tags-complete-doc
These seemed lacking in the API, and would be useful (esp. for beginning ekg users).
Presumably, as the number of tags increase, there may be a need to filter some tags presented via completion, hence I've used CL style keywords in anticipation of that eventual need and to cut down on the cognitive overhead of 8 &optional arguments.
See idea discussion 181.