aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/window.el33
1 files changed, 33 insertions, 0 deletions
diff --git a/lisp/window.el b/lisp/window.el
index f15dd9b7355..986c55380d0 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -6488,6 +6488,39 @@ its documentation for additional customization information."
6488 6488
6489;;; `display-buffer' action functions: 6489;;; `display-buffer' action functions:
6490 6490
6491(defun display-buffer-use-some-frame (buffer alist)
6492 "Display BUFFER in an existing frame other than the current frame.
6493If successful, return the window used; otherwise return nil.
6494
6495If ALIST has a non-nil `inhibit-switch-frame' entry, avoid
6496raising the frame.
6497
6498If ALIST has a non-nil `pop-up-frame-parameters' entry, the
6499corresponding value is an alist of frame parameters to give the
6500new frame.
6501
6502If ALIST has a non-nil `frame-predicate' entry, the corresponding
6503value is a function taking one argument (a frame), returning
6504non-nil if the frame is a candidate."
6505 (let* ((predicate (or (cdr (assoc 'frame-predicate alist))
6506 (lambda (frame)
6507 (and
6508 (not (eq frame (selected-frame)))
6509 (not (window-dedicated-p
6510 (or
6511 (get-lru-window frame)
6512 (frame-first-window frame)))))
6513 )))
6514 (frame (car (filtered-frame-list predicate)))
6515 (window (and frame (get-lru-window frame))))
6516 (when window
6517 (prog1
6518 (window--display-buffer
6519 buffer window 'frame alist display-buffer-mark-dedicated)
6520 (unless (cdr (assq 'inhibit-switch-frame alist))
6521 (window--maybe-raise-frame frame))))
6522 ))
6523
6491(defun display-buffer-same-window (buffer alist) 6524(defun display-buffer-same-window (buffer alist)
6492 "Display BUFFER in the selected window. 6525 "Display BUFFER in the selected window.
6493This fails if ALIST has a non-nil `inhibit-same-window' entry, or 6526This fails if ALIST has a non-nil `inhibit-same-window' entry, or