Is there a way to show a tooltip that contains the full buffer name when I hover over the buffer name part of the mode line? I'd like to quickly check the full buffer name when I have a narrow frame that only shows the beginning of the buffer name in the mode line. Currently it only displays a tooltip that says "Buffer name".
1 Answer
This should do it.
(setq-default mode-line-buffer-identification
(list (propertize
"%12b"
'face 'mode-line-buffer-id
'help-echo
'(format "%s\nmouse-1: Previous buffer\nmouse-3: Next buffer"
(buffer-name))
'mouse-face 'mode-line-highlight
'local-map mode-line-buffer-identification-keymap)))
I grepped the Emacs Lisp sources for "Buffer name"
and found that that text was set up in the mode-line in bindings.el
. I just changed the help-echo
part, to use the full (buffer-name)
.