Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
a1ac7d07
Commit
a1ac7d07
authored
Dec 16, 2023
by
Stefan Monnier
Browse files
Merge branch 'same-frame'
parents
d1341ef3
3eb421bd
Pipeline
#27517
failed with stage
in 4 minutes and 30 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
21 deletions
+35
-21
doc/lispref/windows.texi
doc/lispref/windows.texi
+14
-5
etc/NEWS
etc/NEWS
+4
-0
lisp/window.el
lisp/window.el
+17
-16
No files found.
doc/lispref/windows.texi
View file @
a1ac7d07
...
...
@@ -3268,6 +3268,15 @@ The value specifies an alist of frame parameters to give a new frame,
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
...
...
@@ -3441,6 +3450,9 @@ A non-@code{nil} value also means that when @code{display-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
...
...
@@ -3512,15 +3524,12 @@ functions it should try instead as, for example:
@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
...
...
etc/NEWS
View file @
a1ac7d07
...
...
@@ -1308,6 +1308,10 @@ values.
*
Lisp Changes in Emacs 30.1
** New 'pop-up-frames' action alist entry for 'display-buffer'.
This has the same effect as the variable of the same name and takes
precedence over the variable when present.
** New function 'merge-ordered-lists'.
Mostly used internally to do a kind of topological sort of
inheritance hierarchies.
...
...
lisp/window.el
View file @
a1ac7d07
...
...
@@ -6862,6 +6862,7 @@ BUFFER in a window of the selected frame.
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)))
...
...
@@ -6881,9 +6882,8 @@ pass the elements of (cdr ARGS) as the remaining arguments."
;; 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
...
...
@@ -6996,6 +6996,13 @@ Emacs Lisp manual for an example."
(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
...
...
@@ -7742,6 +7749,8 @@ Action alist entries are:
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
...
...
@@ -7830,12 +7839,12 @@ specified by the ACTION argument."
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"))
...
...
@@ -7978,9 +7987,7 @@ called only by `display-buffer' or a function directly or
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))))
...
...
@@ -8034,9 +8041,7 @@ indirectly called by the latter."
(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))))
...
...
@@ -8182,9 +8187,7 @@ text-only terminal), try with `display-buffer-pop-up-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)
...
...
@@ -8548,9 +8551,7 @@ indirectly called by the latter."
(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))))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment