aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Rudalics2011-06-20 10:41:57 +0200
committerMartin Rudalics2011-06-20 10:41:57 +0200
commit4c43d97b5c7fa32466bd29743d9b60caf8e978d2 (patch)
treedb6a7eca218e9fa028186f402f601a70fe6ab25f
parentbfbbb27d9246153517e7f94caa9dc57abffcdb87 (diff)
downloademacs-4c43d97b5c7fa32466bd29743d9b60caf8e978d2.tar.gz
emacs-4c43d97b5c7fa32466bd29743d9b60caf8e978d2.zip
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.
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/window.el25
2 files changed, 24 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ef76dc69fdc..4224f9b886f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
12011-06-20 Martin Rudalics <rudalics@gmx.at>
2
3 * window.el (get-window-with-predicate): Start scanning with
4 window following selected window to restore Emacs 23 behavior.
5 Clarify doc-string.
6 (get-buffer-window-list): Start scanning with selected window to
7 restore Emacs 23 behavior. Clarify doc-string.
8
12011-06-20 Daniel Colascione <dan.colascione@gmail.com> 92011-06-20 Daniel Colascione <dan.colascione@gmail.com>
2 10
3 * emacs-lisp/syntax.el (syntax-ppss): Further improve docstring. 11 * emacs-lisp/syntax.el (syntax-ppss): Further improve docstring.
diff --git a/lisp/window.el b/lisp/window.el
index 5737b1ca7ad..e222cb04eef 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -1165,13 +1165,20 @@ IGNORE, when non-nil means a window can be returned even if its
1165 (window-frame window)) 1165 (window-frame window))
1166 (or best best-2))) 1166 (or best best-2)))
1167 1167
1168(defun get-window-with-predicate (predicate &optional minibuf 1168(defun get-window-with-predicate (predicate &optional minibuf all-frames default)
1169 all-frames default)
1170 "Return a live window satisfying PREDICATE. 1169 "Return a live window satisfying PREDICATE.
1171More precisely, cycle through all windows calling the function 1170More precisely, cycle through all windows calling the function
1172PREDICATE on each one of them with the window as its sole 1171PREDICATE on each one of them with the window as its sole
1173argument. Return the first window for which PREDICATE returns 1172argument. Return the first window for which PREDICATE returns
1174non-nil. If no window satisfies PREDICATE, return DEFAULT. 1173non-nil. Windows are scanned starting with the window following
1174the selcted window. If no window satisfies PREDICATE, return
1175DEFAULT.
1176
1177MINIBUF t means include the minibuffer window even if the
1178minibuffer is not active. MINIBUF nil or omitted means include
1179the minibuffer window only if the minibuffer is active. Any
1180other value means do not include the minibuffer window even if
1181the minibuffer is active.
1175 1182
1176ALL-FRAMES nil or omitted means consider all windows on the selected 1183ALL-FRAMES nil or omitted means consider all windows on the selected
1177frame, plus the minibuffer window if specified by the MINIBUF 1184frame, plus the minibuffer window if specified by the MINIBUF
@@ -1192,7 +1199,9 @@ values of ALL-FRAMES have special meanings:
1192Anything else means consider all windows on the selected frame 1199Anything else means consider all windows on the selected frame
1193and no others." 1200and no others."
1194 (catch 'found 1201 (catch 'found
1195 (dolist (window (window-list-1 nil minibuf all-frames)) 1202 (dolist (window (window-list-1
1203 (next-window nil minibuf all-frames)
1204 minibuf all-frames))
1196 (when (funcall predicate window) 1205 (when (funcall predicate window)
1197 (throw 'found window))) 1206 (throw 'found window)))
1198 default)) 1207 default))
@@ -1297,10 +1306,8 @@ selected frame and no others."
1297(defun get-buffer-window-list (&optional buffer-or-name minibuf all-frames) 1306(defun get-buffer-window-list (&optional buffer-or-name minibuf all-frames)
1298 "Return list of all windows displaying BUFFER-OR-NAME, or nil if none. 1307 "Return list of all windows displaying BUFFER-OR-NAME, or nil if none.
1299BUFFER-OR-NAME may be a buffer or the name of an existing buffer 1308BUFFER-OR-NAME may be a buffer or the name of an existing buffer
1300and defaults to the current buffer. 1309and defaults to the current buffer. Windows are scanned starting
1301 1310with the selected window.
1302Any windows showing BUFFER-OR-NAME on the selected frame are listed
1303first.
1304 1311
1305MINIBUF t means include the minibuffer window even if the 1312MINIBUF t means include the minibuffer window even if the
1306minibuffer is not active. MINIBUF nil or omitted means include 1313minibuffer is not active. MINIBUF nil or omitted means include
@@ -1328,7 +1335,7 @@ Anything else means consider all windows on the selected frame
1328and no others." 1335and no others."
1329 (let ((buffer (normalize-live-buffer buffer-or-name)) 1336 (let ((buffer (normalize-live-buffer buffer-or-name))
1330 windows) 1337 windows)
1331 (dolist (window (window-list-1 (frame-first-window) minibuf all-frames)) 1338 (dolist (window (window-list-1 (selected-window) minibuf all-frames))
1332 (when (eq (window-buffer window) buffer) 1339 (when (eq (window-buffer window) buffer)
1333 (setq windows (cons window windows)))) 1340 (setq windows (cons window windows))))
1334 (nreverse windows))) 1341 (nreverse windows)))