]> code.delx.au - gnu-emacs/commitdiff
Add docs for display-buffer action display-buffer-use-some-frame
authorStephen Leake <stephen_leake@stephe-leake.org>
Thu, 30 Jul 2015 00:23:19 +0000 (19:23 -0500)
committerStephen Leake <stephen_leake@stephe-leake.org>
Thu, 30 Jul 2015 00:23:19 +0000 (19:23 -0500)
* lisp/window.el (display-buffer-use-some-frame): improve doc string

* doc/lispref/windows.texi (Display Action Functions): add
  display-buffer-use-some-frame

* etc/NEWS: mention display-buffer-use-some-frame

doc/lispref/windows.texi
etc/NEWS
lisp/window.el

index 750397c73751b0186482444b0b68ff36e9bf9df2..41f02aabaa8f52aca6cd7aa8702a4c67f0641144 100644 (file)
@@ -2301,6 +2301,23 @@ the function specified in @code{pop-up-frame-function}
 is added to the newly created frame's parameters.
 @end defun
 
+@defun display-buffer-use-some-frame buffer alist
+This function tries to ``display'' @var{buffer} by trying to find a
+frame that meets a predicate (by default any frame other than the
+current frame).
+
+If @var{alist} has a non-@code{nil} @code{`inhibit-switch-frame} entry,
+avoid raising the frame.
+
+If @var{alist} has a non-nil @code{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.
+
+If this function chooses a window on another frame, it makes that frame
+visible and, unless @var{alist} contains an @code{inhibit-switch-frame}
+entry (@pxref{Choosing Window Options}), raises that frame if necessary.
+@end defun
+
 @defun display-buffer-pop-up-window buffer alist
 This function tries to display @var{buffer} by splitting the largest
 or least recently-used window (typically one on the selected frame).
index 5bb7a009e3773e66012336edf4aec7b5a80d0c26..6dbe6b38b11a201f55e78e4b5b0f923b196c3450 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -84,6 +84,11 @@ command line when `initial-buffer-choice' is non-nil.
 \f
 * Changes in Emacs 25.1
 
+** New display-buffer action function display-buffer-use-some-frame
+This displays the buffer in an existing frame other than the current
+frame, and allows the caller to specify a frame predicate to exclude
+frames.
+
 ** New doc command `describe-symbol'.  Works for functions, vars, faces, etc...
 
 ** `isearch' and `query-replace' now perform character folding in matches.
index 986c55380d02241cf8eaec2b4a8f441dda09dea3..238e53ca76a900e12cdbdd4d861b87c5918b7474 100644 (file)
@@ -6489,19 +6489,17 @@ its documentation for additional customization information."
 ;;; `display-buffer' action functions:
 
 (defun display-buffer-use-some-frame (buffer alist)
-  "Display BUFFER in an existing frame other than the current frame.
-If successful, return the window used; otherwise return nil.
+  "Display BUFFER in an existing frame that meets a predicate
+(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
 raising the frame.
 
-If ALIST has a non-nil `pop-up-frame-parameters' entry, the
-corresponding value is an alist of frame parameters to give the
-new frame.
-
-If ALIST has a non-nil `frame-predicate' entry, the corresponding
-value is a function taking one argument (a frame), returning
-non-nil if the frame is a candidate."
+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))
                         (lambda (frame)
                           (and