changeset 3898:92d25f36e8aa

(mouse-menu-bar-buffers): 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:30:49 +0000
parents 83d0fc1ccca9
children a0655a72182b
files lisp/menu-bar.el
diffstat 1 files changed, 14 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/menu-bar.el	Fri Jun 25 22:01:47 1993 +0000
+++ b/lisp/menu-bar.el	Fri Jun 25 22:30:49 1993 +0000
@@ -160,17 +160,30 @@
 	  (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)))