Add +popup-display-buffer-fullframe
Adds support for the saved-wconf window parameter. If a popup possesses a window configuration in this parameter, it will be restored when the popup (or its popup buffer) is killed.
This commit is contained in:
parent
8a4f15b01c
commit
8fcc12ed08
1 changed files with 16 additions and 1 deletions
|
@ -70,7 +70,9 @@ and enables `+popup-buffer-mode'."
|
||||||
(funcall autosave buffer))))
|
(funcall autosave buffer))))
|
||||||
(with-current-buffer buffer (save-buffer)))
|
(with-current-buffer buffer (save-buffer)))
|
||||||
(let ((ignore-window-parameters t))
|
(let ((ignore-window-parameters t))
|
||||||
(delete-window window))
|
(if-let* ((wconf (window-parameter window 'saved-wconf)))
|
||||||
|
(set-window-configuration wconf)
|
||||||
|
(delete-window window)))
|
||||||
(unless (window-live-p window)
|
(unless (window-live-p window)
|
||||||
(with-current-buffer buffer
|
(with-current-buffer buffer
|
||||||
(set-buffer-modified-p nil)
|
(set-buffer-modified-p nil)
|
||||||
|
@ -376,6 +378,19 @@ the message buffer in a popup window."
|
||||||
prevent the popup(s) from messing up the UI (or vice versa)."
|
prevent the popup(s) from messing up the UI (or vice versa)."
|
||||||
(save-popups! (apply orig-fn args)))
|
(save-popups! (apply orig-fn args)))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun +popup-display-buffer-fullframe (buffer alist)
|
||||||
|
"Displays the buffer fullscreen."
|
||||||
|
(let ((wconf (current-window-configuration)))
|
||||||
|
(when-let (window (or (display-buffer-reuse-window buffer alist)
|
||||||
|
(display-buffer-same-window buffer alist)
|
||||||
|
(display-buffer-pop-up-window buffer alist)
|
||||||
|
(display-buffer-use-some-window buffer alist)))
|
||||||
|
(set-window-parameter window 'saved-wconf wconf)
|
||||||
|
(add-to-list 'window-persistent-parameters '(saved-wconf . t))
|
||||||
|
(delete-other-windows window)
|
||||||
|
window)))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +popup-display-buffer-stacked-side-window (buffer alist)
|
(defun +popup-display-buffer-stacked-side-window (buffer alist)
|
||||||
"A `display-buffer' action that serves as an alternative to
|
"A `display-buffer' action that serves as an alternative to
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue