diff options
| author | Stephen Leake | 2015-07-29 19:23:19 -0500 |
|---|---|---|
| committer | Stephen Leake | 2015-07-29 19:23:19 -0500 |
| commit | 3b9d689c2abb294250de6c690d77e9175952be72 (patch) | |
| tree | 86ea017fe12739fb7145721be0f938b1e57d5ec0 | |
| parent | 72fea2fac543558cd2c4bd55e6f714f9f43efbc3 (diff) | |
| download | emacs-3b9d689c2abb294250de6c690d77e9175952be72.tar.gz emacs-3b9d689c2abb294250de6c690d77e9175952be72.zip | |
Add docs for display-buffer action display-buffer-use-some-frame
* 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
| -rw-r--r-- | doc/lispref/windows.texi | 17 | ||||
| -rw-r--r-- | etc/NEWS | 5 | ||||
| -rw-r--r-- | lisp/window.el | 16 |
3 files changed, 29 insertions, 9 deletions
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 750397c7375..41f02aabaa8 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi | |||
| @@ -2301,6 +2301,23 @@ the function specified in @code{pop-up-frame-function} | |||
| 2301 | is added to the newly created frame's parameters. | 2301 | is added to the newly created frame's parameters. |
| 2302 | @end defun | 2302 | @end defun |
| 2303 | 2303 | ||
| 2304 | @defun display-buffer-use-some-frame buffer alist | ||
| 2305 | This function tries to ``display'' @var{buffer} by trying to find a | ||
| 2306 | frame that meets a predicate (by default any frame other than the | ||
| 2307 | current frame). | ||
| 2308 | |||
| 2309 | If @var{alist} has a non-@code{nil} @code{`inhibit-switch-frame} entry, | ||
| 2310 | avoid raising the frame. | ||
| 2311 | |||
| 2312 | If @var{alist} has a non-nil @code{frame-predicate} entry, its value is a | ||
| 2313 | function taking one argument (a frame), returning non-nil if the | ||
| 2314 | frame is a candidate; this function replaces the default predicate. | ||
| 2315 | |||
| 2316 | If this function chooses a window on another frame, it makes that frame | ||
| 2317 | visible and, unless @var{alist} contains an @code{inhibit-switch-frame} | ||
| 2318 | entry (@pxref{Choosing Window Options}), raises that frame if necessary. | ||
| 2319 | @end defun | ||
| 2320 | |||
| 2304 | @defun display-buffer-pop-up-window buffer alist | 2321 | @defun display-buffer-pop-up-window buffer alist |
| 2305 | This function tries to display @var{buffer} by splitting the largest | 2322 | This function tries to display @var{buffer} by splitting the largest |
| 2306 | or least recently-used window (typically one on the selected frame). | 2323 | or least recently-used window (typically one on the selected frame). |
| @@ -84,6 +84,11 @@ command line when `initial-buffer-choice' is non-nil. | |||
| 84 | 84 | ||
| 85 | * Changes in Emacs 25.1 | 85 | * Changes in Emacs 25.1 |
| 86 | 86 | ||
| 87 | ** New display-buffer action function display-buffer-use-some-frame | ||
| 88 | This displays the buffer in an existing frame other than the current | ||
| 89 | frame, and allows the caller to specify a frame predicate to exclude | ||
| 90 | frames. | ||
| 91 | |||
| 87 | ** New doc command `describe-symbol'. Works for functions, vars, faces, etc... | 92 | ** New doc command `describe-symbol'. Works for functions, vars, faces, etc... |
| 88 | 93 | ||
| 89 | ** `isearch' and `query-replace' now perform character folding in matches. | 94 | ** `isearch' and `query-replace' now perform character folding in matches. |
diff --git a/lisp/window.el b/lisp/window.el index 986c55380d0..238e53ca76a 100644 --- a/lisp/window.el +++ b/lisp/window.el | |||
| @@ -6489,19 +6489,17 @@ its documentation for additional customization information." | |||
| 6489 | ;;; `display-buffer' action functions: | 6489 | ;;; `display-buffer' action functions: |
| 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 other than the current frame. | 6492 | "Display BUFFER in an existing frame that meets a predicate |
| 6493 | If successful, return the window used; otherwise return nil. | 6493 | (by default any frame other than the current frame). If |
| 6494 | successful, return the window used; otherwise return nil. | ||
| 6494 | 6495 | ||
| 6495 | If ALIST has a non-nil `inhibit-switch-frame' entry, avoid | 6496 | If ALIST has a non-nil `inhibit-switch-frame' entry, avoid |
| 6496 | raising the frame. | 6497 | raising the frame. |
| 6497 | 6498 | ||
| 6498 | If ALIST has a non-nil `pop-up-frame-parameters' entry, the | 6499 | If ALIST has a non-nil `frame-predicate' entry, its value is a |
| 6499 | corresponding value is an alist of frame parameters to give the | 6500 | function taking one argument (a frame), returning non-nil if the |
| 6500 | new frame. | 6501 | frame is a candidate; this function replaces the default |
| 6501 | 6502 | predicate." | |
| 6502 | If ALIST has a non-nil `frame-predicate' entry, the corresponding | ||
| 6503 | value is a function taking one argument (a frame), returning | ||
| 6504 | non-nil if the frame is a candidate." | ||
| 6505 | (let* ((predicate (or (cdr (assoc 'frame-predicate alist)) | 6503 | (let* ((predicate (or (cdr (assoc 'frame-predicate alist)) |
| 6506 | (lambda (frame) | 6504 | (lambda (frame) |
| 6507 | (and | 6505 | (and |