diff options
| author | Stephen Leake | 2015-08-07 10:03:59 -0500 |
|---|---|---|
| committer | Stephen Leake | 2015-08-07 10:03:59 -0500 |
| commit | 4daa09e499b10e6250302341027e39ff5242fa04 (patch) | |
| tree | e1bd561adb08566bbff8de1c5ba27b821c613192 /lisp | |
| parent | 701484d524835e3461f521138399893366229ae5 (diff) | |
| download | emacs-4daa09e499b10e6250302341027e39ff5242fa04.tar.gz emacs-4daa09e499b10e6250302341027e39ff5242fa04.zip | |
Add support for 'inhibit-same-window in 'display-buffer-use-some-frame'
* lisp/window.el (display-buffer-use-some-frame): Add support for
'inhibit-same-window in alist.
* doc/windows.texi (display-buffer-use-some-frame): Doc support for
'inhibit-same-window in alist.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/window.el | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lisp/window.el b/lisp/window.el index 238e53ca76a..22fcd981e18 100644 --- a/lisp/window.el +++ b/lisp/window.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; window.el --- GNU Emacs window commands aside from those written in C | 1 | e;;; window.el --- GNU Emacs window commands aside from those written in C |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1985, 1989, 1992-1994, 2000-2015 Free Software | 3 | ;; Copyright (C) 1985, 1989, 1992-1994, 2000-2015 Free Software |
| 4 | ;; Foundation, Inc. | 4 | ;; Foundation, Inc. |
| @@ -6490,7 +6490,7 @@ its documentation for additional customization information." | |||
| 6490 | 6490 | ||
| 6491 | (defun display-buffer-use-some-frame (buffer alist) | 6491 | (defun display-buffer-use-some-frame (buffer alist) |
| 6492 | "Display BUFFER in an existing frame that meets a predicate | 6492 | "Display BUFFER in an existing frame that meets a predicate |
| 6493 | (by default any frame other than the current frame). If | 6493 | \(by default any frame other than the current frame). If |
| 6494 | successful, return the window used; otherwise return nil. | 6494 | successful, return the window used; otherwise return nil. |
| 6495 | 6495 | ||
| 6496 | If ALIST has a non-nil `inhibit-switch-frame' entry, avoid | 6496 | If ALIST has a non-nil `inhibit-switch-frame' entry, avoid |
| @@ -6499,8 +6499,12 @@ raising the frame. | |||
| 6499 | If ALIST has a non-nil `frame-predicate' entry, its value is a | 6499 | If ALIST has a non-nil `frame-predicate' entry, its value is a |
| 6500 | function taking one argument (a frame), returning non-nil if the | 6500 | function taking one argument (a frame), returning non-nil if the |
| 6501 | frame is a candidate; this function replaces the default | 6501 | frame is a candidate; this function replaces the default |
| 6502 | predicate." | 6502 | predicate. |
| 6503 | (let* ((predicate (or (cdr (assoc 'frame-predicate alist)) | 6503 | |
| 6504 | If ALIST has a non-nil `inhibit-same-window' entry, avoid using | ||
| 6505 | the currently selected window (only useful with a frame-predicate | ||
| 6506 | that allows the selected frame)." | ||
| 6507 | (let* ((predicate (or (cdr (assq 'frame-predicate alist)) | ||
| 6504 | (lambda (frame) | 6508 | (lambda (frame) |
| 6505 | (and | 6509 | (and |
| 6506 | (not (eq frame (selected-frame))) | 6510 | (not (eq frame (selected-frame))) |
| @@ -6510,7 +6514,7 @@ predicate." | |||
| 6510 | (frame-first-window frame))))) | 6514 | (frame-first-window frame))))) |
| 6511 | ))) | 6515 | ))) |
| 6512 | (frame (car (filtered-frame-list predicate))) | 6516 | (frame (car (filtered-frame-list predicate))) |
| 6513 | (window (and frame (get-lru-window frame)))) | 6517 | (window (and frame (get-lru-window frame nil (cdr (assq 'inhibit-same-window alist)))))) |
| 6514 | (when window | 6518 | (when window |
| 6515 | (prog1 | 6519 | (prog1 |
| 6516 | (window--display-buffer | 6520 | (window--display-buffer |