diff options
author | Chong Yidong <cyd@gnu.org> | 2012-08-26 17:16:48 +0800 |
---|---|---|
committer | Chong Yidong <cyd@gnu.org> | 2012-08-26 17:16:48 +0800 |
commit | d97af5a07f045ed1de8045bab25af384c21b08dd (patch) | |
tree | 6aabcc758b92f8121b679323b808ddd4c6b2309d /lisp/window.el | |
parent | d5172d4fbc2ca871d18426fb9e84ee6bb87a0e68 (diff) | |
download | emacs-d97af5a07f045ed1de8045bab25af384c21b08dd.tar.gz emacs-d97af5a07f045ed1de8045bab25af384c21b08dd.tar.bz2 emacs-d97af5a07f045ed1de8045bab25af384c21b08dd.zip |
Clean up gdb-mi's usage of display-buffer.
* progmodes/gdb-mi.el (gdb-display-buffer-other-frame-action): New
variable, replacing gdb-frame-parameters.
(gdb-frame-io-buffer, gdb-frame-breakpoints-buffer)
(gdb-frame-threads-buffer, gdb-frame-memory-buffer)
(gdb-frame-disassembly-buffer, gdb-frame-stack-buffer)
(gdb-frame-locals-buffer, gdb-frame-registers-buffer): Use it.
(def-gdb-frame-for-buffer): Macro deleted. It is easier to define
the functions directly with gdb-display-buffer-other-frame-action.
(gdb-display-breakpoints-buffer, gdb-display-threads-buffer)
(gdb-display-memory-buffer, gdb-display-disassembly-buffer)
(gdb-display-stack-buffer, gdb-display-locals-buffer)
(gdb-display-registers-buffer): Define directly.
(def-gdb-display-buffer): Macro deleted.
(gdb-display-buffer): Remove second and third args, callers don't
use them. Defer to the default display-buffer behavior, apart
from making windows dedicated.
(gdb-setup-windows): Don't call display-buffer unnecessarily.
* window.el (display-buffer-pop-up-frame): Handle a
pop-up-frame-parameters alist entry.
(display-buffer): Document it.
* progmodes/gud.el (gud-display-line): Just use display-buffer.
Diffstat (limited to 'lisp/window.el')
-rw-r--r-- | lisp/window.el | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/lisp/window.el b/lisp/window.el index 8aee27f44e8..16230003751 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -4369,12 +4369,11 @@ of the window used." (function :tag "function")) :group 'windows) +;; Eventually, we want to turn this into a defvar; instead of +;; customizing this, the user should use a `pop-up-frame-parameters' +;; alist entry in `display-buffer-base-action'. (defcustom pop-up-frame-alist nil "Alist of parameters for automatically generated new frames. -You can set this in your init file; for example, - - (setq pop-up-frame-alist '((width . 80) (height . 20))) - If non-nil, the value you specify here is used by the default `pop-up-frame-function' for the creation of new frames. @@ -5108,6 +5107,10 @@ Recognized alist entries include: window that already displays the buffer. See `display-buffer-reuse-window'. + `pop-up-frame-parameters' -- Value specifies an alist of frame + parameters to give a new frame, if + one is created. + The ACTION argument to `display-buffer' can also have a non-nil and non-list value. This means to display the buffer in a window other than the selected one, even if it is already displayed in @@ -5250,9 +5253,15 @@ This works by calling `pop-up-frame-function'. If successful, return the window used; otherwise return nil. If ALIST has a non-nil `inhibit-switch-frame' entry, avoid -raising the new frame." - (let ((fun pop-up-frame-function) - frame window) +raising the new 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." + (let* ((params (cdr (assq 'pop-up-frame-parameters alist))) + (pop-up-frame-alist (append params pop-up-frame-alist)) + (fun pop-up-frame-function) + frame window) (when (and fun (setq frame (funcall fun)) (setq window (frame-selected-window frame))) |