summaryrefslogtreecommitdiff
path: root/lisp/menu-bar.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1993-06-25 22:30:49 +0000
committerRichard M. Stallman <rms@gnu.org>1993-06-25 22:30:49 +0000
commitb9d07cf7118787c8f11b41884c7d60cecedd6643 (patch)
tree974117cae0161dd659d3d6f5ce265f742f99e1bd /lisp/menu-bar.el
parent1438263db4f48e948ee83a7a014b3043b03307ee (diff)
downloademacs-b9d07cf7118787c8f11b41884c7d60cecedd6643.tar.gz
(mouse-menu-bar-buffers): Include % and * in each item.
Calculate amount of space needed for longest buffer name.
Diffstat (limited to 'lisp/menu-bar.el')
-rw-r--r--lisp/menu-bar.el15
1 files changed, 14 insertions, 1 deletions
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index 0f174f1fab9..67df0d26185 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -160,17 +160,30 @@ and selects that window."
(list "Buffer Menu"
(cons "Select Buffer"
(let ((tail buffers)
+ (maxbuf 0)
(maxlen 0)
head)
(while tail
+ (or (eq ?\ (aref (buffer-name (car tail)) 0))
+ (setq maxbuf
+ (max maxbuf
+ (length (buffer-name (car tail))))))
+ (setq tail (cdr tail)))
+ (setq tail buffers)
+ (while tail
(let ((elt (car tail)))
(if (not (string-match "^ "
(buffer-name elt)))
(setq head (cons
(cons
(format
- "%14s %s"
+ (format "%%%ds %%s%%s %%s"
+ maxbuf)
(buffer-name elt)
+ (if (buffer-modified-p elt) "*" " ")
+ (save-excursion
+ (set-buffer elt)
+ (if buffer-read-only "%" " "))
(or (buffer-file-name elt) ""))
elt)
head)))