-
Notifications
You must be signed in to change notification settings - Fork 33
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
Initialize selectrum after all other functions in minibuffer-setup-hook #242
Initialize selectrum after all other functions in minibuffer-setup-hook #242
Conversation
@clemera I wonder if there is a simpler alternative to disable sorting. I think the nicety of using let with selectrum-should-sort-p is somehow lost using this hook idiom. Rather add a |
Yeah, it's not too beautiful ;) Generally we don't want to encourage using |
842416f
to
8ba7fd9
Compare
Anything preventing from merging this? Looks simple enough. |
I'm still thinking if we shouldn't move to use |
@clemera No hurry from me and the melpa pipeline is kind of clogged - just asking. |
8ba7fd9
to
d98d3a0
Compare
I assume there isn't any code out there which relies on this minor detail. I adjusted the case where we used |
9154183
to
c674791
Compare
c674791
to
26604ec
Compare
When using
completing-read
sorting can be configured/disabled by providingdisplay-sort-function
via the metadata. To correctly disable sorting forselectrum-read
one needs to set it inminibuffer-setup-hook
like this:Before this PR this doesn't actually work because
selectrum--minibuffer-setup-hook
runs before the temporary hook added above. Alternatively we could use(:append (lambda ...))
forselectrum-read
but this might cause unexpected side effects for existing code which assumesselectrum-read
runs early, we also have such code in selectrum itself (seeselectrum-read-file-name
). Because of that I moved the sorting code intoselectrum--minibuffer-post-command-hook
which seems like the simplest fix without breaking anything due to changed behaviour.