emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master a6894cf: * lisp/window.el (walk-windows): Simplify


From: Juri Linkov
Subject: [Emacs-diffs] master a6894cf: * lisp/window.el (walk-windows): Simplify to use WINDOW arg of window-list-1
Date: Thu, 19 Sep 2019 16:43:13 -0400 (EDT)

branch: master
commit a6894cf0c32c0cc50f1a45cb51117ce01446d666
Author: Juri Linkov <address@hidden>
Commit: Juri Linkov <address@hidden>

    * lisp/window.el (walk-windows): Simplify to use WINDOW arg of window-list-1
    
    instead of calling select-window (bug#35385).
---
 lisp/window.el | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/lisp/window.el b/lisp/window.el
index cf73315..620eacd 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -2217,6 +2217,10 @@ non-nil values of ALL-FRAMES have special meanings:
 
 - A frame means consider all windows on that frame only.
 
+If ALL-FRAMES specifies a frame, the first window walked is the
+first window on that frame (the one returned by `frame-first-window'),
+not necessarily the selected window.
+
 Anything else means consider all windows on the selected frame
 and no others.
 
@@ -2226,13 +2230,13 @@ windows nor the buffer list."
   ;; back to it.
   (when (window-minibuffer-p)
     (setq minibuf t))
-  ;; Make sure to not mess up the order of recently selected
-  ;; windows.  Use `save-selected-window' and `select-window'
-  ;; with second argument non-nil for this purpose.
+  ;; Use `save-selected-window' to prevent FUN from messing up
+  ;; the order of windows when it changes the selected window.
   (save-selected-window
-    (when (framep all-frames)
-      (select-window (frame-first-window all-frames) 'norecord))
-    (dolist (walk-windows-window (window-list-1 nil minibuf all-frames))
+    (dolist (walk-windows-window
+             (window-list-1 (and (framep all-frames)
+                                 (frame-first-window all-frames))
+                            minibuf all-frames))
       (funcall fun walk-windows-window))))
 
 (defun window-at-side-p (&optional window side)



reply via email to

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