if one is created. @code{display-buffer-pop-up-frame} is its one and
only addressee.
+@vindex pop-up-frames@r{, a buffer display action alist entry}
+@item pop-up-frames
+The value controls whether @code{display-buffer} may display buffers
+by making new frames. It has the same meaning as the
+@code{pop-up-frames} variable and takes precedence over it when present.
+Its main intended purpose is to override a non-nil value of the
+variable for particular buffers which the user prefers to keep
+in the selected frame.
+
@vindex parent-frame@r{, a buffer display action alist entry}
@item parent-frame
The value specifies the parent frame to be used when the buffer is
looking for a window already displaying @var{buffer-or-name}, it can
search any visible or iconified frame, not just the selected frame.
+An entry by the same name in @code{display-buffer}'s @var{alist}
+takes precedence over the variable.
+
This variable is provided mainly for backward compatibility. It is
obeyed by @code{display-buffer} via a special mechanism in
@code{display-buffer-fallback-action}, which calls the action function
@item pop-up-frames
@vindex pop-up-frames@r{, replacement for}
-Instead of customizing this variable to @code{t}, customize
+Instead of customizing this variable to @code{t}, you can customize
@code{display-buffer-base-action}, for example, as follows:
@example
@group
-(setopt
- display-buffer-base-action
- '((display-buffer-reuse-window display-buffer-pop-up-frame)
- (reusable-frames . 0)))
+(setopt display-buffer-base-action '(nil (pop-up-frames . t)))
@end group
@end example
If ARGS is a list whose car is a symbol, use (car ARGS) as a
function to do the work. Pass it BUFFER as first argument, and
pass the elements of (cdr ARGS) as the remaining arguments."
+ (declare (obsolete display-buffer-pop-up-frame "30.1"))
(if (and args (symbolp (car args)))
(apply (car args) buffer (cdr args))
(let ((window (get-buffer-window buffer 0)))
;; Stay on the same frame if requested.
(when (or (cdr (assq 'same-frame args)) (cdr (assq 'same-window args)))
(let* ((pop-up-windows t)
- pop-up-frames
special-display-buffer-names special-display-regexps)
- (display-buffer buffer)))
+ (display-buffer buffer '((pop-up-frames . nil)))))
;; If no window yet, make one in a new frame.
(let* ((frame
(with-current-buffer buffer
(const :tag "Always" t))
:group 'windows)
+(defun window--pop-up-frames (alist)
+ (let* ((override (assq 'pop-up-frames alist))
+ (pop-up (if override (cdr override) pop-up-frames)))
+ (if (eq pop-up 'graphic-only)
+ (display-graphic-p)
+ pop-up)))
+
(defcustom display-buffer-reuse-frames nil
"Non-nil means `display-buffer' should reuse frames.
If the buffer in question is already displayed in a frame, raise
Possible values are nil (the selected frame), t (any live
frame), visible (any visible frame), 0 (any visible or
iconified frame) or an existing live frame.
+ `pop-up-frames' -- Same effect as the eponymous variable.
+ Takes precedence over the variable.
`pop-up-frame-parameters' -- The value specifies an alist of
frame parameters to give a new frame, if one is created.
`window-height' -- The value specifies the desired height of the
user-action special-action action extra-action
display-buffer-base-action
display-buffer-fallback-action))
- (functions (apply 'append
+ (functions (apply #'append
(mapcar (lambda (x)
(setq x (car x))
(if (functionp x) (list x) x))
actions)))
- (alist (apply 'append (mapcar 'cdr actions)))
+ (alist (apply #'append (mapcar #'cdr actions)))
window)
(unless (buffer-live-p buffer)
(error "Invalid buffer"))
indirectly called by the latter."
(let* ((alist-entry (assq 'reusable-frames alist))
(frames (cond (alist-entry (cdr alist-entry))
- ((if (eq pop-up-frames 'graphic-only)
- (display-graphic-p)
- pop-up-frames)
+ ((window--pop-up-frames alist)
0)
(display-buffer-reuse-frames 0)
(t (last-nonminibuffer-frame))))
(let* ((alist-entry (assq 'reusable-frames alist))
(alist-mode-entry (assq 'mode alist))
(frames (cond (alist-entry (cdr alist-entry))
- ((if (eq pop-up-frames 'graphic-only)
- (display-graphic-p)
- pop-up-frames)
+ ((window--pop-up-frames alist)
0)
(display-buffer-reuse-frames 0)
(t (last-nonminibuffer-frame))))
ALIST is an association list of action symbols and values. See
Info node `(elisp) Buffer Display Action Alists' for details of
such alists."
- (and (if (eq pop-up-frames 'graphic-only)
- (display-graphic-p)
- pop-up-frames)
+ (and (window--pop-up-frames alist)
(display-buffer-pop-up-frame buffer alist)))
(defun display-buffer--maybe-pop-up-window (buffer alist)
(cdr (assq 'inhibit-same-window alist)))
(frames (cond
(alist-entry (cdr alist-entry))
- ((if (eq pop-up-frames 'graphic-only)
- (display-graphic-p)
- pop-up-frames)
+ ((window--pop-up-frames alist)
0)
(display-buffer-reuse-frames 0)
(t (last-nonminibuffer-frame))))