creichert / ido-vertical-mode.el

makes ido-mode display vertically
211 stars 22 forks source link

Allow selectively enabling vertical mode #24

Open gcv opened 9 years ago

gcv commented 9 years ago

Vertical mode is quite handy, but it can be distracting for short lists, when it causes the whole Emacs frame to redraw itself but not display very much. I have two suggestions for mitigating this:

  1. It would be handy to selectively enable it for, e.g., ido-find-file but not ido-switch-buffer.
  2. Do not expand the minibuffer to its maximum height when the selection list is shorter than required for the maximum height (so if max-mini-window-height is 10 but the selection only has 3 items, do not expand the minibuffer to 10 rows).
gempesaw commented 9 years ago
  1. hmmmm selectively enabling could/would need to be done with hooks fired before the desired non-vertical functions, probably.
  2. haha, someone had requested the exact opposite of this functionality previously (expand the minibuffer height to keep it constant, even if there's only 3 items). no problem, I can add a defcustom to let users decide whether or not to pad the minibuffer.
gcv commented 9 years ago

Cool, thank you.

About minibuffer resizing: please make sure it does not shrink as the selection narrows. So if max-mini-window-height is 10, there are 6 options to start, the minibuffer should always be 6 lines long.

About selective enabling, are you saying it's up to the user to write the appropriate hooks?

gempesaw commented 9 years ago

selective: hm, yea, that was the first thing that came to mind to accomplish that functionality. Off the top of my head, I don't know how to tell whether the user invoked ido-find-file vs ido-switch-buffer from within our code, but hopefully there are hooks for them that would allow us to toggle ivm on and off just in time. hm, we could set up a list and take care of the enabling/disabling as appropriate for whatever functions are in the list...

minibuffer: ah, good clarification, I hadn't thought of that. i think something like the following logic:

(when ivm-dont-always-pad (when (< 10 (len comps)) (pad-mini-buffer-to (len comps)))
gcv commented 9 years ago

I have another UX refinement idea: what if, instead of enabling vertical mode instantly, ido does its default thing, but if the user hesitates for some timeout value, vertical mode turns on? It would then be like guide-key-mode, where if the user types quickly, the screen does not need to intrusively redraw itself. But hesitation implies that the user doesn't quite know what to do, which means the enhanced display of vertical mode would help.

gempesaw commented 9 years ago

I'd happily welcome a PR for a setting to that effect :)

gcv commented 9 years ago

Fair enough, I'll take a look when I have time.