changeset 612:ff0d9e7facba

[xemacs-hg @ 2001-06-09 09:02:03 by michaels] 2001-06-08 Mike Sperber <mike@xemacs.org> * files.el (save-some-buffers-1): Don't zap the help window right after `map-y-or-n-p' has popped it up.
author michaels
date Sat, 09 Jun 2001 09:02:04 +0000
parents 38db05db9cb5
children 023b83f4e54b
files lisp/ChangeLog lisp/files.el
diffstat 2 files changed, 39 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri Jun 08 12:21:27 2001 +0000
+++ b/lisp/ChangeLog	Sat Jun 09 09:02:04 2001 +0000
@@ -1,3 +1,8 @@
+2001-06-08  Mike Sperber <mike@xemacs.org>
+
+	* files.el (save-some-buffers-1): Don't zap the help window right
+	after `map-y-or-n-p' has popped it up.
+
 2001-06-08  Ben Wing  <ben@xemacs.org>
 
 	* process.el: comment about shell-command-switch.
--- a/lisp/files.el	Fri Jun 08 12:21:27 2001 +0000
+++ b/lisp/files.el	Sat Jun 09 09:02:04 2001 +0000
@@ -2472,38 +2472,43 @@
 ;; XEmacs - do not use queried flag
 (defun save-some-buffers-1 (arg exiting switch-buffer)
   (let* ((switched nil)
+	 (last-buffer nil)
 	 (files-done
 	  (map-y-or-n-p
 	   (lambda (buffer)
-	     (and (buffer-modified-p buffer)
-		  (not (buffer-base-buffer buffer))
-		  ;; XEmacs addition:
-		  (not (symbol-value-in-buffer 'save-buffers-skip buffer))
-		  (or
-		   (buffer-file-name buffer)
-		   (and exiting
-			(progn
-			  (set-buffer buffer)
-			  (and buffer-offer-save (> (buffer-size) 0)))))
-		  (if arg
-		      t
-		    ;; #### We should provide a per-buffer means to
-		    ;; disable the switching.  For instance, you might
-		    ;; want to turn it off for buffers the contents of
-		    ;; which is meaningless to humans, such as
-		    ;; `.newsrc.eld'.
-		    (when switch-buffer
-		      (unless (one-window-p)
-			(delete-other-windows))
-		      (setq switched t)
-		      ;; #### Consider using `display-buffer' here for 21.1!
-		      ;;(display-buffer buffer nil (selected-frame)))
-		      (switch-to-buffer buffer t))
-		    (if (buffer-file-name buffer)
-			(format "Save file %s? "
-				(buffer-file-name buffer))
-		      (format "Save buffer %s? "
-			      (buffer-name buffer))))))
+	     (prog1
+		 (and (buffer-modified-p buffer)
+		      (not (buffer-base-buffer buffer))
+		      ;; XEmacs addition:
+		      (not (symbol-value-in-buffer 'save-buffers-skip buffer))
+		      (or
+		       (buffer-file-name buffer)
+		       (and exiting
+			    (progn
+			      (set-buffer buffer)
+			      (and buffer-offer-save (> (buffer-size) 0)))))
+		      (if arg
+			  t
+			;; #### We should provide a per-buffer means to
+			;; disable the switching.  For instance, you might
+			;; want to turn it off for buffers the contents of
+			;; which is meaningless to humans, such as
+			;; `.newsrc.eld'.
+			(when (and switch-buffer
+				   ;; map-y-or-n-p is displaying help
+				   (not (eq last-buffer buffer)))
+			  (unless (one-window-p)
+			    (delete-other-windows))
+			  (setq switched t)
+			  ;; #### Consider using `display-buffer' here for 21.1!
+			  ;;(display-buffer buffer nil (selected-frame)))
+			  (switch-to-buffer buffer t))
+			(if (buffer-file-name buffer)
+			    (format "Save file %s? "
+				    (buffer-file-name buffer))
+			  (format "Save buffer %s? "
+				  (buffer-name buffer)))))
+	       (setq last-buffer buffer)))
 	   (lambda (buffer)
 	     (set-buffer buffer)
 	     (condition-case ()