From xemacs-m  Thu Jun 19 20:31:47 1997
Received: from jagor.srce.hr (hniksic@jagor.srce.hr [161.53.2.130])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id UAA10478
	for <xemacs-beta@xemacs.org>; Thu, 19 Jun 1997 20:31:46 -0500 (CDT)
Received: (from hniksic@localhost)
          by jagor.srce.hr (8.8.5/8.8.4)
	  id DAA10411; Fri, 20 Jun 1997 03:31:35 +0200 (MET DST)
To: XEmacs Developers <xemacs-beta@xemacs.org>
Subject: Re: new `save-some-buffers' for files.el
References: <9706192354.AA17987@w20-575-41.MIT.EDU>
X-Attribution: Hrv
X-Face: Mie8:rOV<\c/~z{s.X4A{!?vY7{drJ([U]0O=W/<W*SMo/Mv:58:*_y~ki>xDi&N7XG
        KV^$k0m3Oe/)'e%3=$PCR&3ITUXH,cK>]bci&<qQ>Ff%x_>1`T(+M2Gg/fgndU%k*ft
        [(7._6e0n-V%|%'[c|q:;}td$#INd+;?!-V=c8Pqf}3J
From: Hrvoje Niksic <hniksic@srce.hr>
Date: 20 Jun 1997 03:31:34 +0200
In-Reply-To: David Bakhash's message of "Thu, 19 Jun 1997 19:54:34 -0400"
Message-ID: <kigafkmhxft.fsf@jagor.srce.hr>
Lines: 60
X-Mailer: Gnus v5.4.59/XEmacs 20.3(beta7) - "Oslo"

David Bakhash <cadet@MIT.EDU> writes:

> I posted this 2 the newsgroup, but since I'm so annoyingly adamant
> about it, I'm putting it here too...

Hmm...  Despite my last mail, I think I like this change -- and it's a
small change, indeed.  Here is the same thing, but in the patch
format, and a variable to turn it off:

--- lisp/prim/files.el.orig	Fri Jun 20 03:22:18 1997
+++ lisp/prim/files.el	Fri Jun 20 03:27:28 1997
@@ -2205,13 +2205,21 @@
 	(basic-save-buffer-1))
     'continue-save-buffer))
 
+(defcustom save-some-buffers-switch-to-buffer t
+  "\
+*Non-nil makes \\[save-some-buffers] switch to the buffer offered for saving."
+  :type 'boolean
+  :group 'editing-basics)
+
 (defun save-some-buffers (&optional arg exiting)
   "Save some modified file-visiting buffers.  Asks user about each one.
 Optional argument (the prefix) non-nil means save all with no questions.
 Optional second argument EXITING means ask about certain non-file buffers
  as well as about file buffers."
   (interactive "P")
-  (save-window-excursion
+  (save-excursion
+    (save-window-excursion
+    ;; XEmacs - do not use queried flag
     (let ((files-done
 	   (map-y-or-n-p
 	    (function
@@ -2228,6 +2236,9 @@
 			    (and buffer-offer-save (> (buffer-size) 0)))))
 		    (if arg
 			t
+		      (when save-some-buffers-switch-to-buffer
+			(switch-to-buffer buffer)
+			(delete-other-windows))
 		      (if (buffer-file-name buffer)
 			  (format "Save file %s? "
 				  (buffer-file-name buffer))
@@ -2268,7 +2279,7 @@
 		  (setq abbrevs-changed nil)
 		  t))))
       (or (> files-done 0) abbrevs-done
-	  (message "(No files need saving)")))))
+	  (message "(No files need saving)"))))))
 
 
 (defun not-modified (&optional arg)


-- 
Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
"Silence!" cries Freydag. "I did not call thee in for a consultation!" 
"They are my innards! I will not have them misread by a poseur!"

