changeset 7550:9c6abdf5541a

(menu-bar-update-buffers): Record buffers' mod and read-only flags, and recompute if they change.
author Richard M. Stallman <rms@gnu.org>
date Thu, 19 May 1994 05:54:26 +0000
parents ccb8b7f8dce7
children 69f20f10799a
files lisp/menu-bar.el
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/menu-bar.el	Thu May 19 05:20:27 1994 +0000
+++ b/lisp/menu-bar.el	Thu May 19 05:54:26 1994 +0000
@@ -264,11 +264,19 @@
 (defun menu-bar-update-buffers ()
   (let ((buffers (buffer-list))
 	(frames (frame-list))
+	buffers-info
 	buffers-menu frames-menu)
-    (if (and (equal buffers menu-bar-update-buffers-last-buffers)
+    (setq buffers-info
+	  (mapcar (function (lambda (buffer)
+			      (list buffer (buffer-modified-p buffer)
+				    (save-excursion
+				      (set-buffer buffer)
+				      buffer-read-only))))
+		  buffers))
+    (if (and (equal buffers-info menu-bar-update-buffers-last-buffers)
 	     (equal frames menu-bar-update-buffers-last-frames))
 	nil
-      (setq menu-bar-update-buffers-last-buffers buffers)
+      (setq menu-bar-update-buffers-last-buffers buffers-info)
       (setq menu-bar-update-buffers-last-frames frames)
       ;; If requested, list only the N most recently selected buffers.
       (if (and (integerp buffers-menu-max-size)