* lisp/window.el (display-buffer--maybe-at-bottom): New function (bug#30314).
(display-buffer--maybe-pop-up-frame) (display-buffer--maybe-pop-up-window): New functions created from display-buffer--maybe-pop-up-frame-or-window. (display-buffer--maybe-pop-up-frame-or-window): Call display-buffer--maybe-pop-up-frame or display-buffer--maybe-pop-up-window. (display-buffer-at-bottom): Fix parens. * lisp/minibuffer.el (minibuffer-completion-help): Use display-buffer--maybe-pop-up-frame instead of let-binding pop-up-windows to nil. * lisp/files.el (hack-local-variables-confirm) (save-buffers-kill-emacs): Use display-buffer--maybe-at-bottom.
This commit is contained in:
parent
aaeb101d89
commit
09465bfa06
3 changed files with 34 additions and 33 deletions
|
@ -3315,15 +3315,7 @@ n -- to ignore the local variables list.")
|
|||
|
||||
;; Display the buffer and read a choice.
|
||||
(save-window-excursion
|
||||
(pop-to-buffer buf `((display-buffer--maybe-same-window
|
||||
display-buffer-reuse-window
|
||||
display-buffer--maybe-pop-up-frame-or-window
|
||||
display-buffer-at-bottom)
|
||||
,(if temp-buffer-resize-mode
|
||||
'(window-height . resize-temp-buffer-window)
|
||||
'(window-height . fit-window-to-buffer))
|
||||
,(when temp-buffer-resize-mode
|
||||
'(preserve-size . (nil . t)))))
|
||||
(pop-to-buffer buf '(display-buffer--maybe-at-bottom))
|
||||
(let* ((exit-chars '(?y ?n ?\s ?\C-g ?\C-v))
|
||||
(prompt (format "Please type %s%s: "
|
||||
(if offer-save "y, n, or !" "y or n")
|
||||
|
@ -6929,15 +6921,7 @@ if any returns nil. If `confirm-kill-emacs' is non-nil, calls it."
|
|||
(or (not active)
|
||||
(with-displayed-buffer-window
|
||||
(get-buffer-create "*Process List*")
|
||||
`((display-buffer--maybe-same-window
|
||||
display-buffer-reuse-window
|
||||
display-buffer--maybe-pop-up-frame-or-window
|
||||
display-buffer-at-bottom)
|
||||
,(if temp-buffer-resize-mode
|
||||
'(window-height . resize-temp-buffer-window)
|
||||
'(window-height . fit-window-to-buffer))
|
||||
,(when temp-buffer-resize-mode
|
||||
'(preserve-size . (nil . t))))
|
||||
'(display-buffer--maybe-at-bottom)
|
||||
#'(lambda (window _value)
|
||||
(with-selected-window window
|
||||
(unwind-protect
|
||||
|
|
|
@ -1824,12 +1824,7 @@ variables.")
|
|||
;; window, mark it as softly-dedicated, so bury-buffer in
|
||||
;; minibuffer-hide-completions will know whether to
|
||||
;; delete the window or not.
|
||||
(display-buffer-mark-dedicated 'soft)
|
||||
;; Disable `pop-up-windows' temporarily to allow
|
||||
;; `display-buffer--maybe-pop-up-frame-or-window'
|
||||
;; in the display actions below to pop up a frame
|
||||
;; if `pop-up-frames' is non-nil, but not to pop up a window.
|
||||
(pop-up-windows nil))
|
||||
(display-buffer-mark-dedicated 'soft))
|
||||
(with-displayed-buffer-window
|
||||
"*Completions*"
|
||||
;; This is a copy of `display-buffer-fallback-action'
|
||||
|
@ -1837,7 +1832,7 @@ variables.")
|
|||
;; with `display-buffer-at-bottom'.
|
||||
`((display-buffer--maybe-same-window
|
||||
display-buffer-reuse-window
|
||||
display-buffer--maybe-pop-up-frame-or-window
|
||||
display-buffer--maybe-pop-up-frame
|
||||
;; Use `display-buffer-below-selected' for inline completions,
|
||||
;; but not in the minibuffer (e.g. in `eval-expression')
|
||||
;; for which `display-buffer-at-bottom' is used.
|
||||
|
|
|
@ -7289,12 +7289,23 @@ text-only terminal), try with `display-buffer-pop-up-frame'.
|
|||
|
||||
If that cannot be done, and `pop-up-windows' is non-nil, try
|
||||
again with `display-buffer-pop-up-window'."
|
||||
(or (and (if (eq pop-up-frames 'graphic-only)
|
||||
(display-graphic-p)
|
||||
pop-up-frames)
|
||||
(display-buffer-pop-up-frame buffer alist))
|
||||
(and pop-up-windows
|
||||
(display-buffer-pop-up-window buffer alist))))
|
||||
(or (display-buffer--maybe-pop-up-frame buffer alist)
|
||||
(display-buffer--maybe-pop-up-window buffer alist)))
|
||||
|
||||
(defun display-buffer--maybe-pop-up-frame (buffer alist)
|
||||
"Try displaying BUFFER based on `pop-up-frames'.
|
||||
If `pop-up-frames' is non-nil (and not `graphic-only' on a
|
||||
text-only terminal), try with `display-buffer-pop-up-frame'."
|
||||
(and (if (eq pop-up-frames 'graphic-only)
|
||||
(display-graphic-p)
|
||||
pop-up-frames)
|
||||
(display-buffer-pop-up-frame buffer alist)))
|
||||
|
||||
(defun display-buffer--maybe-pop-up-window (buffer alist)
|
||||
"Try displaying BUFFER based on `pop-up-windows'.
|
||||
If `pop-up-windows' is non-nil, try with `display-buffer-pop-up-window'."
|
||||
(and pop-up-windows
|
||||
(display-buffer-pop-up-window buffer alist)))
|
||||
|
||||
(defun display-buffer-in-child-frame (buffer alist)
|
||||
"Display BUFFER in a child frame.
|
||||
|
@ -7360,6 +7371,17 @@ below the selected one, use that window."
|
|||
(window--display-buffer
|
||||
buffer window 'reuse alist display-buffer-mark-dedicated)))))
|
||||
|
||||
(defun display-buffer--maybe-at-bottom (buffer alist)
|
||||
(let ((alist (append alist `(,(if temp-buffer-resize-mode
|
||||
'(window-height . resize-temp-buffer-window)
|
||||
'(window-height . fit-window-to-buffer))
|
||||
,(when temp-buffer-resize-mode
|
||||
'(preserve-size . (nil . t)))))))
|
||||
(or (display-buffer--maybe-same-window buffer alist)
|
||||
(display-buffer-reuse-window buffer alist)
|
||||
(display-buffer--maybe-pop-up-frame buffer alist)
|
||||
(display-buffer-at-bottom buffer alist))))
|
||||
|
||||
(defun display-buffer-at-bottom (buffer alist)
|
||||
"Try displaying BUFFER in a window at the bottom of the selected frame.
|
||||
This either reuses such a window provided it shows BUFFER
|
||||
|
@ -7376,8 +7398,8 @@ selected frame."
|
|||
(setq bottom-window-shows-buffer t)
|
||||
(setq bottom-window window))
|
||||
((not bottom-window)
|
||||
(setq bottom-window window)))
|
||||
nil nil 'nomini))
|
||||
(setq bottom-window window))))
|
||||
nil nil 'nomini)
|
||||
(or (and bottom-window-shows-buffer
|
||||
(window--display-buffer
|
||||
buffer bottom-window 'reuse alist display-buffer-mark-dedicated))
|
||||
|
|
Loading…
Add table
Reference in a new issue