aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Roberts2008-03-14 21:32:47 +0000
committerNick Roberts2008-03-14 21:32:47 +0000
commit392640c4376b43617eaba89e3fde3c2a5d99a237 (patch)
tree4439fed4f5c883f93394b033c74cc4d22e2c24f6
parentb1c69133380f83711efdc19a9f1a09cf2696a4bb (diff)
downloademacs-392640c4376b43617eaba89e3fde3c2a5d99a237.tar.gz
emacs-392640c4376b43617eaba89e3fde3c2a5d99a237.zip
(list-buffers-noselect): Display buffer name in
tooltip instead of mouse binding when it doesn't fit in the list.
-rw-r--r--lisp/buff-menu.el23
1 files changed, 15 insertions, 8 deletions
diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el
index f90cf884c1d..f98179c3ba6 100644
--- a/lisp/buff-menu.el
+++ b/lisp/buff-menu.el
@@ -809,14 +809,21 @@ For more information, see the function `buffer-menu'."
809 ;; Put the buffer name into a text property 809 ;; Put the buffer name into a text property
810 ;; so we don't have to extract it from the text. 810 ;; so we don't have to extract it from the text.
811 ;; This way we avoid problems with unusual buffer names. 811 ;; This way we avoid problems with unusual buffer names.
812 (Buffer-menu-buffer+size (nth 2 buffer) 812 (let ((name (nth 2 buffer))
813 (int-to-string (nth 3 buffer)) 813 (size (int-to-string (nth 3 buffer))))
814 `(buffer-name ,(nth 2 buffer) 814 (Buffer-menu-buffer+size name size
815 buffer ,(car buffer) 815 `(buffer-name ,name
816 font-lock-face buffer-menu-buffer 816 buffer ,(car buffer)
817 mouse-face highlight 817 font-lock-face buffer-menu-buffer
818 help-echo "mouse-2: select this buffer")) 818 mouse-face highlight
819 " " 819 help-echo
820 ,(if (>= (length name)
821 (- Buffer-menu-buffer+size-width
822 (max (length size) 3)
823 2))
824 name
825 "mouse-2: select this buffer"))))
826 " "
820 (if (> (length (nth 4 buffer)) Buffer-menu-mode-width) 827 (if (> (length (nth 4 buffer)) Buffer-menu-mode-width)
821 (substring (nth 4 buffer) 0 Buffer-menu-mode-width) 828 (substring (nth 4 buffer) 0 Buffer-menu-mode-width)
822 (nth 4 buffer))) 829 (nth 4 buffer)))