diff options
| author | Martin Rudalics | 2009-01-04 19:03:09 +0000 |
|---|---|---|
| committer | Martin Rudalics | 2009-01-04 19:03:09 +0000 |
| commit | e331bbf3be9e142fcd6d2024d5ec26c31de5b35c (patch) | |
| tree | ee7f0af349043f9156364c323b8af65e02bac8fd /lisp | |
| parent | c0eb6ac0b1baf5c7f46a4f359367f4e82de7ce37 (diff) | |
| download | emacs-e331bbf3be9e142fcd6d2024d5ec26c31de5b35c.tar.gz emacs-e331bbf3be9e142fcd6d2024d5ec26c31de5b35c.zip | |
(display-buffer): When a buffer is displayed in the
selected and some other window, and not-this-window is non-nil,
try to return that other window instead of popping up a new
frame. (Bug#30)
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/window.el | 14 |
2 files changed, 17 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 08ee4028c59..5841f1f0680 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2009-01-04 Martin Rudalics <rudalics@gmx.at> | ||
| 2 | |||
| 3 | * window.el (display-buffer): When a buffer is displayed in the | ||
| 4 | selected and some other window, and not-this-window is non-nil, | ||
| 5 | try to return that other window instead of popping up a new | ||
| 6 | frame. (Bug#30) | ||
| 7 | |||
| 1 | 2009-01-04 Chong Yidong <cyd@stupidchicken.com> | 8 | 2009-01-04 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 9 | ||
| 3 | * simple.el (visual-line-mode-map): Remove M-[ and M-] bindings. | 10 | * simple.el (visual-line-mode-map): Remove M-[ and M-] bindings. |
diff --git a/lisp/window.el b/lisp/window.el index 53ec4a665db..b43eee2f9fe 100644 --- a/lisp/window.el +++ b/lisp/window.el | |||
| @@ -1006,10 +1006,16 @@ consider all visible or iconified frames." | |||
| 1006 | (not (last-nonminibuffer-frame))) | 1006 | (not (last-nonminibuffer-frame))) |
| 1007 | 0) | 1007 | 0) |
| 1008 | (last-nonminibuffer-frame)))) | 1008 | (last-nonminibuffer-frame)))) |
| 1009 | (and (setq window-to-use (get-buffer-window buffer frames)) | 1009 | (setq window-to-use |
| 1010 | (or can-use-selected-window | 1010 | (catch 'found |
| 1011 | (not (eq (selected-window) window-to-use))))) | 1011 | ;; Search all visible and iconified frames for a window |
| 1012 | ;; If the buffer is already displayed in some window use that. | 1012 | ;; displaying BUFFER. Return the selected window only |
| 1013 | ;; if can-use-selected-window says we may do so. | ||
| 1014 | (dolist (window (get-buffer-window-list buffer 'nomini 0)) | ||
| 1015 | (when (or can-use-selected-window | ||
| 1016 | (not (eq (selected-window) window))) | ||
| 1017 | (throw 'found window)))))) | ||
| 1018 | ;; The buffer is already displayed in some window; use that. | ||
| 1013 | (window--display-buffer-1 window-to-use)) | 1019 | (window--display-buffer-1 window-to-use)) |
| 1014 | ((and special-display-function | 1020 | ((and special-display-function |
| 1015 | ;; `special-display-p' returns either t or a list of frame | 1021 | ;; `special-display-p' returns either t or a list of frame |