changeset 55828:af9432138635

(with-selected-window): Undo previous change.
author Richard M. Stallman <rms@gnu.org>
date Sat, 29 May 2004 15:23:42 +0000
parents c5c73c8c2b3e
children fcd2e17daffa
files lisp/subr.el
diffstat 1 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/subr.el	Sat May 29 15:22:55 2004 +0000
+++ b/lisp/subr.el	Sat May 29 15:23:42 2004 +0000
@@ -1796,10 +1796,21 @@
 This does not alter the buffer list ordering.
 See also `with-temp-buffer'."
   (declare (indent 1) (debug t))
-  `(let ((save-selected-window-window (selected-window)))
+  ;; Most of this code is a copy of save-selected-window.
+  `(let ((save-selected-window-window (selected-window))
+	 ;; It is necessary to save all of these, because calling
+	 ;; select-window changes frame-selected-window for whatever
+	 ;; frame that window is in.
+	 (save-selected-window-alist
+	  (mapcar (lambda (frame) (list frame (frame-selected-window frame)))
+		  (frame-list))))
      (unwind-protect
 	 (progn (select-window ,window 'norecord)
 		,@body)
+       (dolist (elt save-selected-window-alist)
+	 (and (frame-live-p (car elt))
+	      (window-live-p (cadr elt))
+	      (set-frame-selected-window (car elt) (cadr elt))))
        (if (window-live-p save-selected-window-window)
 	   (select-window save-selected-window-window 'norecord)))))