diff options
| author | Martin Rudalics | 2011-06-20 10:41:57 +0200 |
|---|---|---|
| committer | Martin Rudalics | 2011-06-20 10:41:57 +0200 |
| commit | 4c43d97b5c7fa32466bd29743d9b60caf8e978d2 (patch) | |
| tree | db6a7eca218e9fa028186f402f601a70fe6ab25f | |
| parent | bfbbb27d9246153517e7f94caa9dc57abffcdb87 (diff) | |
| download | emacs-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/ChangeLog | 8 | ||||
| -rw-r--r-- | lisp/window.el | 25 |
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 @@ | |||
| 1 | 2011-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 | |||
| 1 | 2011-06-20 Daniel Colascione <dan.colascione@gmail.com> | 9 | 2011-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. |
| 1171 | More precisely, cycle through all windows calling the function | 1170 | More precisely, cycle through all windows calling the function |
| 1172 | PREDICATE on each one of them with the window as its sole | 1171 | PREDICATE on each one of them with the window as its sole |
| 1173 | argument. Return the first window for which PREDICATE returns | 1172 | argument. Return the first window for which PREDICATE returns |
| 1174 | non-nil. If no window satisfies PREDICATE, return DEFAULT. | 1173 | non-nil. Windows are scanned starting with the window following |
| 1174 | the selcted window. If no window satisfies PREDICATE, return | ||
| 1175 | DEFAULT. | ||
| 1176 | |||
| 1177 | MINIBUF t means include the minibuffer window even if the | ||
| 1178 | minibuffer is not active. MINIBUF nil or omitted means include | ||
| 1179 | the minibuffer window only if the minibuffer is active. Any | ||
| 1180 | other value means do not include the minibuffer window even if | ||
| 1181 | the minibuffer is active. | ||
| 1175 | 1182 | ||
| 1176 | ALL-FRAMES nil or omitted means consider all windows on the selected | 1183 | ALL-FRAMES nil or omitted means consider all windows on the selected |
| 1177 | frame, plus the minibuffer window if specified by the MINIBUF | 1184 | frame, plus the minibuffer window if specified by the MINIBUF |
| @@ -1192,7 +1199,9 @@ values of ALL-FRAMES have special meanings: | |||
| 1192 | Anything else means consider all windows on the selected frame | 1199 | Anything else means consider all windows on the selected frame |
| 1193 | and no others." | 1200 | and 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. |
| 1299 | BUFFER-OR-NAME may be a buffer or the name of an existing buffer | 1308 | BUFFER-OR-NAME may be a buffer or the name of an existing buffer |
| 1300 | and defaults to the current buffer. | 1309 | and defaults to the current buffer. Windows are scanned starting |
| 1301 | 1310 | with the selected window. | |
| 1302 | Any windows showing BUFFER-OR-NAME on the selected frame are listed | ||
| 1303 | first. | ||
| 1304 | 1311 | ||
| 1305 | MINIBUF t means include the minibuffer window even if the | 1312 | MINIBUF t means include the minibuffer window even if the |
| 1306 | minibuffer is not active. MINIBUF nil or omitted means include | 1313 | minibuffer is not active. MINIBUF nil or omitted means include |
| @@ -1328,7 +1335,7 @@ Anything else means consider all windows on the selected frame | |||
| 1328 | and no others." | 1335 | and 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))) |