emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r104641: Restore old behavior of get-


From: martin rudalics
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r104641: Restore old behavior of get-window-with-predicate and get-buffer-window-list.
Date: Mon, 20 Jun 2011 10:41:57 +0200
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 104641
committer: martin rudalics <address@hidden>
branch nick: trunk
timestamp: Mon 2011-06-20 10:41:57 +0200
message:
  Restore old behavior of get-window-with-predicate and get-buffer-window-list.
  
  * window.el (get-window-with-predicate): Start scanning with
  window following selected window to restore Emacs 23 behavior.
  Clarify doc-string.
  (get-buffer-window-list): Start scanning with selected window to
  restore Emacs 23 behavior.  Clarify doc-string.
modified:
  lisp/ChangeLog
  lisp/window.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-06-20 03:36:16 +0000
+++ b/lisp/ChangeLog    2011-06-20 08:41:57 +0000
@@ -1,3 +1,11 @@
+2011-06-20  Martin Rudalics  <address@hidden>
+
+       * window.el (get-window-with-predicate): Start scanning with
+       window following selected window to restore Emacs 23 behavior.
+       Clarify doc-string.
+       (get-buffer-window-list): Start scanning with selected window to
+       restore Emacs 23 behavior.  Clarify doc-string.
+
 2011-06-20  Daniel Colascione  <address@hidden>
 
        * emacs-lisp/syntax.el (syntax-ppss): Further improve docstring.

=== modified file 'lisp/window.el'
--- a/lisp/window.el    2011-06-19 14:32:12 +0000
+++ b/lisp/window.el    2011-06-20 08:41:57 +0000
@@ -1165,13 +1165,20 @@
      (window-frame window))
     (or best best-2)))
 
-(defun get-window-with-predicate (predicate &optional minibuf
-                                           all-frames default)
+(defun get-window-with-predicate (predicate &optional minibuf all-frames 
default)
   "Return a live window satisfying PREDICATE.
 More precisely, cycle through all windows calling the function
 PREDICATE on each one of them with the window as its sole
 argument.  Return the first window for which PREDICATE returns
-non-nil.  If no window satisfies PREDICATE, return DEFAULT.
+non-nil.  Windows are scanned starting with the window following
+the selcted window.  If no window satisfies PREDICATE, return
+DEFAULT.
+
+MINIBUF t means include the minibuffer window even if the
+minibuffer is not active.  MINIBUF nil or omitted means include
+the minibuffer window only if the minibuffer is active.  Any
+other value means do not include the minibuffer window even if
+the minibuffer is active.
 
 ALL-FRAMES nil or omitted means consider all windows on the selected
 frame, plus the minibuffer window if specified by the MINIBUF
@@ -1192,7 +1199,9 @@
 Anything else means consider all windows on the selected frame
 and no others."
   (catch 'found
-    (dolist (window (window-list-1 nil minibuf all-frames))
+    (dolist (window (window-list-1
+                    (next-window nil minibuf all-frames)
+                    minibuf all-frames))
       (when (funcall predicate window)
        (throw 'found window)))
     default))
@@ -1297,10 +1306,8 @@
 (defun get-buffer-window-list (&optional buffer-or-name minibuf all-frames)
   "Return list of all windows displaying BUFFER-OR-NAME, or nil if none.
 BUFFER-OR-NAME may be a buffer or the name of an existing buffer
-and defaults to the current buffer.
-
-Any windows showing BUFFER-OR-NAME on the selected frame are listed
-first.
+and defaults to the current buffer.  Windows are scanned starting
+with the selected window.
 
 MINIBUF t means include the minibuffer window even if the
 minibuffer is not active.  MINIBUF nil or omitted means include
@@ -1328,7 +1335,7 @@
 and no others."
   (let ((buffer (normalize-live-buffer buffer-or-name))
        windows)
-    (dolist (window (window-list-1 (frame-first-window) minibuf all-frames))
+    (dolist (window (window-list-1 (selected-window) minibuf all-frames))
       (when (eq (window-buffer window) buffer)
        (setq windows (cons window windows))))
     (nreverse windows)))


reply via email to

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