Selectrum: Selectrum bottom prompt input

Created on 28 Mar 2021  路  10Comments  路  Source: raxod502/selectrum

Hello!

Would it be possible to have an option so the prompt when using C-x b for example stays at the bottom instead of above the completion candidates?

I find it annoying and a bit eye tiring, even though I understand someone can find this trivial, to shift the eyesight towards the top of the candidates list which then moves constantly when narrowing the results as you type, instead of having it on a fixed position like the bottom when using the default minibuffer.

Please let me know if my explanation isn't clear.

Thanks!

waiting on response

Most helpful comment

which then moves constantly when narrowing the results as you type

This shouldn't happen, the minibuffer only grows until max height but shouldn't shrink as you type but there have been reported some cases (for example when using show-key-mode) to break that behavior (this should be fixed in Emacs 28 though). Maybe you have some additional setup which could cause this, too?

Would it be possible to have an option so the prompt when using C-x b for example stays at the bottom instead of above the completion candidates?

You can configure selectrum-display-action for example you could do:

(setq selectrum-display-action '(display-buffer-at-bottom))

Is that what you are looking for? I once thought it would be nice to display the candidates up side down in this case so the top matches are right above your input.

All 10 comments

Do you mean something similar to what Helm provides?

Edit: I mean Helm default's behavior, not a possible switch to change the prompt position.

@manuel-uberti exactly, I've never used Helm but from the videos I just checked it behaves that way. This is also the way when using the default minibuffer, prompt stays at the bottom line and candidates pop above.

AFAIK Helm uses its own buffer for candidates, which is something different than what Selectrum does. I'll let @clemera or @raxod502 pick up on this though, because my knowledge is limited in this regard.

Thanks for the input, now I understand things a bit better. I guess this is what emacs -Q uses aswell with the minibuffer when it creates a buffer named *Completions*, Helm uses the same system. I don't know what method Selectrum uses.

which then moves constantly when narrowing the results as you type

This shouldn't happen, the minibuffer only grows until max height but shouldn't shrink as you type but there have been reported some cases (for example when using show-key-mode) to break that behavior (this should be fixed in Emacs 28 though). Maybe you have some additional setup which could cause this, too?

Would it be possible to have an option so the prompt when using C-x b for example stays at the bottom instead of above the completion candidates?

You can configure selectrum-display-action for example you could do:

(setq selectrum-display-action '(display-buffer-at-bottom))

Is that what you are looking for? I once thought it would be nice to display the candidates up side down in this case so the top matches are right above your input.

Nice one, I didn't know about selectrum-display-action!

I see there is also a selectrum-display-action-hook. Could it be used to run something specific (e.g., activating a minor mode to hide the mode-line in the *selectrum* buffer)?

Forget it, the answer is here.

@clemera

This shouldn't happen, the minibuffer only grows until max height but shouldn't shrink as you type but there have been reported some cases (for example when using show-key-mode) to break that behavior (this should be fixed in Emacs 28 though). Maybe you have some additional setup which could cause this, too?

I ran Selectrum without any config and indeed it doesn't shrink anymore, I'll try to find the culprit in my config.

Anyway, (setq selectrum-display-action '(display-buffer-at-bottom)) is exactly what I wanted! Thanks a lot!

I once thought it would be nice to display the candidates up side down in this case so the top matches are right above your input.

Definitely agree. Right now when using (display-buffer-at-bottom) and default top-to-bottom listing results isn't really aesthetic nor looks "natural". Do you know where I should look to change that?

Definitely agree. Right now when using (display-buffer-at-bottom) and default top-to-bottom listing results isn't really aesthetic nor looks "natural". Do you know where I should look to change that?

I guess the best approach would be to add an option to the vertical display style (see selectrum-display-style), I will look into it at some point.

@clemera

I once thought it would be nice to display the candidates up side down in this case so the top matches are right above your input.

~I would love to have this! Right now using a buffer on top of the minibuffer is not an option for me since it splits up the location where you have to focus.~

UPDATE: Since @grolongo asked about it in the Vertico issue tracker (https://github.com/minad/vertico/issues/19) - I tried this out and reversing the candidates is not something I would like to have. So I am not sure if Selectrum should implement this reversing functionality. Depends on how configurable you want to have everything.

Was this page helpful?
0 / 5 - 0 ratings