-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
ability to influence how entries in vulpea-find
are sorted
#121
Comments
Hey @edgimar, In general, the order of notes returned by But just to confirm that this is the case, can you please verify what happens if you Maybe I am missing something. And if it is the case, sorting hook will not solve your problem. So let's dig into it 😄 |
Yes, I do see the same completion. (I guess you mean |
Yes, I meant Alright, I see. In general I don't think it's a good idea to provide something specific for ordering as it may be overridden by your completion framework (for example, to put on the top of the list recently used items) and So in your case you would define a function: (defun my-vulpea-find-candidates (filter-fn)
"Prepare a list of candidates for `vulpea-find'.
FILTER-FN is the function to apply on the candidates, which takes
as its argument a `vulpea-note'."
(let ((notes (vulpea-db-query filter-fn)))
(order-notes-somehow notes))) And then you can use it as default source for candidates: (setq vulpea-find-default-candidates-source #'my-vulpea-find-candidates) What do you think? |
PR was merged, if you think that it doesn't work let me know and I will reopen it. |
Yes that seems like it should work - thanks! |
I have hundreds of org-roam 'dailies' files with titles like
2021-11-15
. By default, all such numeric entries are placed at the beginning of the completion list thatvulpea-find
provides. Removing such notes from the list would prevent searching them by tag. In order to see the normal titled notes whenvulpea-find
starts, it would be preferable for the numeric-titled notes to be at the end of the list, while the rest of the list is still sorted as usual.Would it be possible to add a sorting function hook to enable custom sorting like this?
The text was updated successfully, but these errors were encountered: