changeset 3899:a0655a72182b

(mouse-buffer-menu): Include % and * in each item. Calculate amount of space needed for longest buffer name.
author Richard M. Stallman <rms@gnu.org>
date Fri, 25 Jun 1993 22:33:57 +0000
parents 92d25f36e8aa
children c6f3d2af0df7
files lisp/mouse.el
diffstat 1 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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))))