# HG changeset patch # User Richard M. Stallman # Date 741047637 0 # Node ID a0655a72182b3f95063ae23c6e6b2a62ae5fb952 # Parent 92d25f36e8aa2f3a316634d7d0d9bfbe8ce0985b (mouse-buffer-menu): Include % and * in each item. Calculate amount of space needed for longest buffer name. diff -r 92d25f36e8aa -r a0655a72182b lisp/mouse.el --- a/lisp/mouse.el Fri Jun 25 22:30:49 1993 +0000 +++ b/lisp/mouse.el Fri Jun 25 22:33:57 1993 +0000 @@ -371,16 +371,30 @@ (list "Buffer Menu" (cons "Select Buffer" (let ((tail (buffer-list)) + (maxbuf 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 (buffer-list)) + (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))))