• Oinks@lemmy.blahaj.zone
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    19 days ago

    Shift-Tab just does the correct thing for me on Emacs 30.2. That might be a newer default though.

    I think on an older version something like this should do it:

    (keymap-set completion-list-mode-map "<backtab>" #'previous-completion)
    

    This only works when the completion buffer is selected though (e.g. via completion-auto-select). I’m not really sure how to get useful backtab behavior in the minibuffer itself.

    Edit – These bindings might be worth trying as well if you don’t like the auto selection:

    (keymap-set minibuffer-local-completion-map "<tab>"     #'minibuffer-next-completion)
    (keymap-set minibuffer-local-completion-map "<backtab>" #'minibuffer-previous-completion)
    
    • tomenzgg@midwest.social
      link
      fedilink
      English
      arrow-up
      2
      ·
      19 days ago

      So it’s possible I just never noticed the message noting minibuffer-next/previous-completion but those are pretty cool.

      But I think I was more thinking of tabbing in the opposite direction for minibuffer-complete; the situation I’m most often finding myself with such an abundance of options is when I’m exploring available functions and just looking; I rarely want to go one-by-one in such a scenario.

      …but what I just discovered is that functionality is already provided (I was confused when I saw that “backtab” was already assigned in minibuffer-local-completion-map); it just doesn’t seem to be there when auto-completing in Eval: (which just responds with “<backtab> is undefined”); which is how I’m most often looking at other available functions. That must be why I thought it never worked.

      Welp, I appreciate the info., regardless; I definitely learned a bit more than I knew before. And it’s good to know backtab will actually work in M-x, if I ever find I need it.