summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-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)))