Skip to content
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

Update Citar history when opening items via Embark #478

Closed
rudolf-adamkovic opened this issue Dec 9, 2021 · 6 comments
Closed

Update Citar history when opening items via Embark #478

rudolf-adamkovic opened this issue Dec 9, 2021 · 6 comments
Labels
bug Something isn't working

Comments

@rudolf-adamkovic
Copy link

I recently started using citar with embark. In my setup, I save citar-history using savehist, so that citar-open shows the recently accessed items first. Now that I use embark, I noticed that if I open, say notes, for some item using C-. n, then the item does not become first in the list. I would greatly appreciate if any "open" action moved the item to the top of the list.

@rudolf-adamkovic rudolf-adamkovic added the bug Something isn't working label Dec 9, 2021
@bdarcus
Copy link
Contributor

bdarcus commented Dec 9, 2021

I recently started using citar with embark. In my setup, I save citar-history using savehist, so that citar-open shows the recently accessed items first. Now that I use embark, I noticed that if I open, say notes, for some item using C-. n, then the item does not become first in the list. I would greatly appreciate if any "open" action moved the item to the top of the list.

@oantolin - any input on this history question? Is there something I can and should be doing to resolve this on my end?

@oantolin
Copy link
Contributor

oantolin commented Dec 9, 2021

I'm not very familiar with citar yet unfortunately, so maybe I'm barking barking up the wrong tree but C-. n runs citar-open-notes, right? Have you checked that running citar-open-notes directly (without using embark) does move the item to the top of the list, @salutis?

@rudolf-adamkovic
Copy link
Author

@oantolin

Have you checked that running citar-open-notes directly (without using embark) does move the item to the top of the list, @salutis?

I have just tried it, and it does.

@oantolin
Copy link
Contributor

oantolin commented Dec 10, 2021

Oh boy, it probably has to do with the mechanism Embark uses to "press RET for you" after injecting the target. I use exit-minibuffer, but maybe that doesn't give completing-read a chance to update the history? I'll look into it.

@minad
Copy link
Contributor

minad commented Dec 10, 2021

I suspect this is rather an issue of completing-read-multiple or consult-completing-read-multiple in combination with embark-quit-after-action=nil.

The underlying problem is that the history is a bit ill defined for completing-read-multiple. For example describe-face on emacs -Q stores face1,face2,face3 strings in the face-name-history. The Vertico history sorting does not handle such multi candidates (and neither does the default completion system). In comparison consult-completing-read-multiple implements its own history handling and adds candidates separately to the history such that the sorting by history in Vertico and the default UI works. Consult is bending the semantics here but I don't want to special case crm sorting in Vertico.

This history handling interferes probably with Embark here. So the issue should be fixed in consult-completing-read-multiple if this is indeed the problem. But it is also not obvious to me how the issue can be fixed.

@bdarcus
Copy link
Contributor

bdarcus commented Dec 11, 2021

OK, thanks for the clarification @minad . I'm going to close this issue, then, since we can reasonably conclude this is not an issue with citar.

@bdarcus bdarcus closed this as completed Dec 11, 2021
minad added a commit to minad/consult that referenced this issue Dec 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants