changeset 5398:499f25507242

(save-some-buffers): Fix previous change.
author Richard M. Stallman <rms@gnu.org>
date Sat, 01 Jan 1994 06:21:59 +0000
parents 1209d8bbffd3
children 67aa88583b90
files lisp/files.el
diffstat 1 files changed, 44 insertions(+), 42 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/files.el	Sat Jan 01 05:35:38 1994 +0000
+++ b/lisp/files.el	Sat Jan 01 06:21:59 1994 +0000
@@ -1527,48 +1527,50 @@
  as well as about file buffers."
   (interactive "P")
   (save-window-excursion
-    (or (not (zerop (map-y-or-n-p
-		     (function
-		      (lambda (buffer)
-			(and (buffer-modified-p buffer)
-			     (or
-			      (buffer-file-name buffer)
-			      (and exiting
-				   (progn
-				     (set-buffer buffer)
-				     (and buffer-offer-save (> (buffer-size) 0)))))
-			     (if arg
-				 t
-			       (if (buffer-file-name buffer)
-				   (format "Save file %s? "
-					   (buffer-file-name buffer))
-				 (format "Save buffer %s? "
-					 (buffer-name buffer)))))))
-		     (function
-		      (lambda (buffer)
-			(set-buffer buffer)
-			(save-buffer)))
-		     (buffer-list)
-		     '("buffer" "buffers" "save")
-		     (list (list ?\C-r (lambda (buf)
-					 (view-buffer buf)
-					 (setq view-exit-action
-					       '(lambda (ignore)
-						  (exit-recursive-edit)))
-					 (recursive-edit)
-					 ;; Return nil to ask about BUF again.
-					 nil)
-				 "display the current buffer"))
-		     )))
-	(and save-abbrevs abbrevs-changed
-	     (progn
-	       (if (or arg
-		       (y-or-n-p (format "Save abbrevs in %s? " abbrev-file-name)))
-		   (write-abbrev-file nil))
-	       ;; Don't keep bothering user if he says no.
-	       (setq abbrevs-changed nil)
-	       t))
-	(message "(No files need saving)"))))
+    (let ((files-done
+	   (map-y-or-n-p
+	    (function
+	     (lambda (buffer)
+	       (and (buffer-modified-p buffer)
+		    (or
+		     (buffer-file-name buffer)
+		     (and exiting
+			  (progn
+			    (set-buffer buffer)
+			    (and buffer-offer-save (> (buffer-size) 0)))))
+		    (if arg
+			t
+		      (if (buffer-file-name buffer)
+			  (format "Save file %s? "
+				  (buffer-file-name buffer))
+			(format "Save buffer %s? "
+				(buffer-name buffer)))))))
+	    (function
+	     (lambda (buffer)
+	       (set-buffer buffer)
+	       (save-buffer)))
+	    (buffer-list)
+	    '("buffer" "buffers" "save")
+	    (list (list ?\C-r (lambda (buf)
+				(view-buffer buf)
+				(setq view-exit-action
+				      '(lambda (ignore)
+					 (exit-recursive-edit)))
+				(recursive-edit)
+				;; Return nil to ask about BUF again.
+				nil)
+			"display the current buffer"))))
+	  (abbrevs-done
+	   (and save-abbrevs abbrevs-changed
+		(progn
+		  (if (or arg
+			  (y-or-n-p (format "Save abbrevs in %s? " abbrev-file-name)))
+		      (write-abbrev-file nil))
+		  ;; Don't keep bothering user if he says no.
+		  (setq abbrevs-changed nil)
+		  t))))
+      (or (> files-done 0) abbrevs-done
+	  (message "(No files need saving)")))))
 
 (defun not-modified (&optional arg)
   "Mark current buffer as unmodified, not needing to be saved.