6

I know that I can hide the modebar for the current buffer using

M - : (setq mode-line-format nil)

However, I'd like to hide the mode-line for the 'MINIMAP' buffer created by the minimap package, which is never the "current" buffer since as soon as you click anywhere on the minimap, the cursor is automatically moved to the original buffer. So the previous method does not work in this case.

The perfect solution would be to put something into my .emacs file so that every time I open a minimap the mode-line is automatically hidden from the buffer. Is it possible?

  • 2
    This does not answer the question (does not allow disabling the mode line depending on the buffer name), but for your particular use case I would try (add-hook 'minimap-sb-mode-hook (lambda () (setq mode-line-format nil))). minimap-sb-mode is the minor mode used by MINIMAP sidebars. – Constantine Dec 12 '14 at 17:41
  • @Constantine Thank you, as far as I am concerned this counts as an answer. The buffer name was just an approach I thought could be used to solve the problem, but your approach works fine too. So please feel free to turn you comment into an answer if you wish. – Nico Boni Dec 12 '14 at 17:45
  • +1 for promoting @Constantine's comment to the answer. This also seems like a reasonable default behavior for minimap -- perhaps you could raise it as an issue or pull-request on Github? – glucas Dec 12 '14 at 18:29
  • @glucas will do. – Nico Boni Dec 12 '14 at 18:31
7

To disable the mode line in Minimap sidebars, add a hook to minimap-sb-mode-hook:

(add-hook 'minimap-sb-mode-hook (lambda () (setq mode-line-format nil)))
  • You should never advice core functions like display-buffer. That's asking for trouble. It's better to customize display-buffer-alist. – lunaryorn Dec 14 '14 at 15:41
  • @lunaryorn: Good point. I'll remove that part from the answer. – Constantine Dec 14 '14 at 16:54
  • Just in case someone needs this too. I am running Version: 20150108.1615 and the hook is different: (add-hook 'minimap-mode-hook (lambda () (setq mode-line-format nil))) – jens_bo Jan 31 '15 at 11:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.