]> git.eshelyaron.com Git - emacs.git/commitdiff
(with-selected-window): Only save/restore the selectd window.
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 28 May 2004 22:33:35 +0000 (22:33 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 28 May 2004 22:33:35 +0000 (22:33 +0000)
lisp/subr.el

index 5302558d834b02cd54f715deee3e214d4c5d2c5c..b9e14ade288008ac4156f553fab59045cd8cfb27 100644 (file)
@@ -1796,20 +1796,11 @@ 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))
-  ;; Most of this code is a copy of save-selected-window.
-  `(let ((save-selected-window-window (selected-window))
-        (save-selected-window-alist
-         (mapcar (lambda (frame) (list frame (frame-selected-window frame)))
-                 (frame-list))))
+  `(let ((save-selected-window-window (selected-window)))
      (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)
-          ;; This is where the code differs from save-selected-window.
           (select-window save-selected-window-window 'norecord)))))
 
 (defmacro with-temp-file (file &rest body)