emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/subr.el,v


From: Martin Rudalics
Subject: [Emacs-diffs] Changes to emacs/lisp/subr.el,v
Date: Sun, 02 Nov 2008 11:02:59 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Martin Rudalics <m061211>       08/11/02 11:02:58

Index: subr.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/subr.el,v
retrieving revision 1.617
retrieving revision 1.618
diff -u -b -r1.617 -r1.618
--- subr.el     28 Oct 2008 11:35:11 -0000      1.617
+++ subr.el     2 Nov 2008 11:02:58 -0000       1.618
@@ -2499,17 +2499,18 @@
   "Execute the forms in BODY with WINDOW as the selected window.
 The value returned is the value of the last form in BODY.
 
-This macro saves and restores the current buffer, since otherwise
-its normal operation could potentially make a different
-buffer current.  It does not alter the buffer list ordering.
-
-This macro saves and restores the selected window, as well as
-the selected window in each frame.  If the previously selected
-window of some frame is no longer live at the end of BODY, that
-frame's selected window is left alone.  If the selected window is
-no longer live, then whatever window is selected at the end of
-BODY remains selected.
-See also `with-temp-buffer'."
+This macro saves and restores the selected window, as well as the
+selected window of each frame.  It does not change the order of
+recently selected windows.  If the previously selected window of
+some frame is no longer live at the end of BODY, that frame's
+selected window is left alone.  If the selected window is no
+longer live, then whatever window is selected at the end of BODY
+remains selected.
+
+This macro uses `save-current-buffer' to save and restore the
+current buffer, since otherwise its normal operation could
+potentially make a different buffer current.  It does not alter
+the buffer list ordering."
   (declare (indent 1) (debug t))
   ;; Most of this code is a copy of save-selected-window.
   `(let ((save-selected-window-window (selected-window))
@@ -2526,25 +2527,27 @@
         (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)
+               (set-frame-selected-window (car elt) (cadr elt) 'norecord)))
+        (when (window-live-p save-selected-window-window)
             (select-window save-selected-window-window 'norecord))))))
 
 (defmacro with-selected-frame (frame &rest body)
   "Execute the forms in BODY with FRAME as the selected frame.
 The value returned is the value of the last form in BODY.
-See also `with-temp-buffer'."
+
+This macro neither changes the order of recently selected windows
+nor the buffer list."
   (declare (indent 1) (debug t))
   (let ((old-frame (make-symbol "old-frame"))
        (old-buffer (make-symbol "old-buffer")))
     `(let ((,old-frame (selected-frame))
           (,old-buffer (current-buffer)))
        (unwind-protect
-          (progn (select-frame ,frame)
+          (progn (select-frame ,frame 'norecord)
                  ,@body)
-        (if (frame-live-p ,old-frame)
-            (select-frame ,old-frame))
-        (if (buffer-live-p ,old-buffer)
+        (when (frame-live-p ,old-frame)
+          (select-frame ,old-frame 'norecord))
+        (when (buffer-live-p ,old-buffer)
             (set-buffer ,old-buffer))))))
 
 (defmacro with-temp-file (file &rest body)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]