summaryrefslogtreecommitdiff
path: root/lisp/window.el
diff options
context:
space:
mode:
authorStephen Leake <stephen_leake@stephe-leake.org>2015-08-07 10:03:59 -0500
committerStephen Leake <stephen_leake@stephe-leake.org>2015-08-07 10:03:59 -0500
commit4daa09e499b10e6250302341027e39ff5242fa04 (patch)
treee1bd561adb08566bbff8de1c5ba27b821c613192 /lisp/window.el
parent701484d524835e3461f521138399893366229ae5 (diff)
downloademacs-4daa09e499b10e6250302341027e39ff5242fa04.tar.gz
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/window.el')
-rw-r--r--lisp/window.el14
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 @@
-;;; window.el --- GNU Emacs window commands aside from those written in C
+e;;; window.el --- GNU Emacs window commands aside from those written in C
;; Copyright (C) 1985, 1989, 1992-1994, 2000-2015 Free Software
;; Foundation, Inc.
@@ -6490,7 +6490,7 @@ its documentation for additional customization information."
(defun display-buffer-use-some-frame (buffer alist)
"Display BUFFER in an existing frame that meets a predicate
-(by default any frame other than the current frame). If
+\(by default any frame other than the current frame). If
successful, return the window used; otherwise return nil.
If ALIST has a non-nil `inhibit-switch-frame' entry, avoid
@@ -6499,8 +6499,12 @@ raising the frame.
If ALIST has a non-nil `frame-predicate' entry, its value is a
function taking one argument (a frame), returning non-nil if the
frame is a candidate; this function replaces the default
-predicate."
- (let* ((predicate (or (cdr (assoc 'frame-predicate alist))
+predicate.
+
+If ALIST has a non-nil `inhibit-same-window' entry, avoid using
+the currently selected window (only useful with a frame-predicate
+that allows the selected frame)."
+ (let* ((predicate (or (cdr (assq 'frame-predicate alist))
(lambda (frame)
(and
(not (eq frame (selected-frame)))
@@ -6510,7 +6514,7 @@ predicate."
(frame-first-window frame)))))
)))
(frame (car (filtered-frame-list predicate)))
- (window (and frame (get-lru-window frame))))
+ (window (and frame (get-lru-window frame nil (cdr (assq 'inhibit-same-window alist))))))
(when window
(prog1
(window--display-buffer