-
Notifications
You must be signed in to change notification settings - Fork 25
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
Allow excluding certain types of things from history #165
Comments
If the remembered candidates are not reused, then they are eventually forgotten. Do you have a way to identify programmatically which buffers are the Exwm buffers? There is the command I am not familiar with Exwm, but I would guess that there is a hook in which you could run |
Also, Prescient only affects sorting candidates during completion. It does not affect history variables like |
Yeah, this is true. But there are just so many of them that they fill up 95% of the prescient history, and this seems to push out legitimate history entries. Things that I use quite frequently keep disappearing from the top of the completion candidates, and I suspect this is because the illegitimate history entries fill up the entire history.
Well, this could be a way to work around the problem at the very least, but I would like to prevent them from being saved in the first place. This workaround would still cause some legitimate history entries to be forced off the list, no? Wouldn't one history entry fall off the list each time an exwm buffer is added to the list assuming the history list is full? Switching to and from exwm windows is something I do probably hundreds of times a day, so I assume this still would lead to a significant loss of legitimate history.
But it does save the selected candidate, which I would like to avoid for exwm buffers and some other types of stuff. I didn't mention it in the original post, but I have some other completion stuff that also ends up being saved in the prescient history. I have a custom thingy that I use to open urls in qutebrowser, with completion from my browsing history. All selected candidates from this also ends up being saved, which I also would like to avoid, since qutebrowser already saves the browsing history and I have even disabled sorting for this command, since that is also handled by the browsing history. This last thing here has its own command, does that make it easier to exclude it from the prescient history? I did a little digging in the source code and found that there is a Maybe I could just put some advice around EDIT: The last part here was a brainfart. See below for solution to this part of my question. |
Okay, I had a small brainfart when talking about the advice around the remember function. I figured out how to solve the exwm part of my problem like this:
My second problem (detecting that the command we just ran was my qutebrowser launcher) is still a bit tricky though, as I don't know how to check what the command was that has just exited. But this you might be able to help me with hopefully? EDIT: Btw, there is a weird non-letter character (a square box with numbers in it), at the end of every history entry. Do you know what this is and why it is there? EDIT2: When I'm thinking a bit more about this, maybe all of consult-buffer should be excluded from the history? Since these entries are only valid while those buffers are open, so the saved history would have a high likelyhood of containing a lot of invalid entries when the user closes buffers. |
In general, there's the variable
I believe Consult adds those characters to distinguish candidates with the same text that would otherwise be equivalent. In older versions of Emacs, workarounds were needed to know which candidate was selected, such as when a text candidate was used a key for key-value pairs. I don't know if those workarounds are still needed for more recent versions of Emacs. See the function
Maybe advising the function |
I'm using exwm and consult-buffer. I have set up exwm to set the buffer titles to the actual X11 window titles. The web browser sets the window title to the title of the visited website. Because of this there are many new unique entries selected every day, and these keep filling up the prescient history with useless entries that will never be used again. How can I exclude exwm entries from being saved in prescient?
The text was updated successfully, but these errors were encountered: