How do you restrict iswitch buffer names to 1 line in the minibuffer (behavior changed after emacs 24.1 upgrade on osx)?

StackOverflow https://stackoverflow.com/questions/11285013

Question

When I upgraded to (vanilla) emacs 24.1 on OSX, using iswitch for switching buffers seems to behave differently.

When I press ctrl-x b to switch buffers, instead of restricting the list of buffers to 1 line, it shows every single buffer by expanding the mini-buffer to be several lines long, then progressively removes buffers as I type in the buffer name I'm switching to.

I find having the status bar and mini buffer bumping up and down whenever I switch buffers to be visually distracting, so I want to recover the previous behavior, which cuts off buffer names which after 1 line. How do I do this?

Was it helpful?

Solution

If you want to globally restrict the number of lines the minibuffer uses to a single line, this should work:

(setq max-mini-window-height 1)

Additional info from documentation:

The variable max-mini-window-height controls the maximum height for resizing the minibuffer window. A floating-point number specifies a fraction of the frame's height; an integer specifies the maximum number of lines; nil means do not resize the minibuffer window automatically. The default value is 0.25.

However, if you just want to limit the number of minibuffer lines used by iswitchb, the documentation for iswitchb-minibuffer-setup-hook suggests:

Iswitchb-specific customization of minibuffer setup.

This hook is run during minibuffer setup if `iswitchb' is active. For instance:

(add-hook 'iswitchb-minibuffer-setup-hook
    (lambda ()
        (set (make-local-variable 'max-mini-window-height) 3)))

will constrain the minibuffer to a maximum height of 3 lines when iswitchb is running.

OTHER TIPS

I do not think this behavior has changed between Emacs 23 and Emacs 24, so I'm not sure why you only see this now. Maybe you had some customization to get this behavior, and it now fails to work in Emacs 24? If so, please report it so we can fix it.

Also note that with Emacs 24, the behavior of the default (non-iswitchb) buffer switching is very close to the behavior of iswitchb. The most visible difference is the display of potential completions which you can also get with M-x icomplete-mode, which does not affect the actual behavior, only the display, but also affects other completions. Also icomplete-mode does try to limit the completion list it displays to about one line (additionally to the actual minibuffer's content, so you will still get some line-wrapping, but less so).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top