diff options
author | Richard M. Stallman <rms@gnu.org> | 2004-05-29 15:23:42 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 2004-05-29 15:23:42 +0000 |
commit | 3f71ad3a4622245d9a319f464e5f287f0b706811 (patch) | |
tree | a8e6b437873a4f55ce53ba3cd10fc2ff8267885f /lisp/subr.el | |
parent | 0658b86f7558e35831a91b24d3cad5f2313682ce (diff) | |
download | emacs-3f71ad3a4622245d9a319f464e5f287f0b706811.tar.gz |
(with-selected-window): Undo previous change.
Diffstat (limited to 'lisp/subr.el')
-rw-r--r-- | lisp/subr.el | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lisp/subr.el b/lisp/subr.el index b9e14ade288..9b378c5f06b 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1796,10 +1796,21 @@ The value returned is the value of the last form in BODY. 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))))) |