ui/popup: refactor +popup/raise
Improves its error tolerance and gives it a window argument.
This commit is contained in:
parent
da2a8b1063
commit
0b350f6ea4
1 changed files with 6 additions and 6 deletions
|
@ -75,7 +75,7 @@ the buffer is visible, then set another timer and try again later."
|
||||||
"Called in lieu of `delete-other-windows' in popup windows.
|
"Called in lieu of `delete-other-windows' in popup windows.
|
||||||
|
|
||||||
Raises WINDOW (assumed to be a popup), then deletes other windows."
|
Raises WINDOW (assumed to be a popup), then deletes other windows."
|
||||||
(when-let* ((window (+popup/raise)))
|
(when-let* ((window (+popup/raise window)))
|
||||||
(delete-other-windows window))
|
(delete-other-windows window))
|
||||||
nil)
|
nil)
|
||||||
|
|
||||||
|
@ -379,13 +379,13 @@ the message buffer in a popup window."
|
||||||
t)
|
t)
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +popup/raise ()
|
(defun +popup/raise (window)
|
||||||
"Raise the current popup window into a regular window."
|
"Raise the current popup window into a regular window."
|
||||||
(interactive)
|
(interactive (list (selected-window)))
|
||||||
(unless (+popup-window-p)
|
(cl-check-type window window)
|
||||||
|
(unless (+popup-window-p window)
|
||||||
(user-error "Cannot raise a non-popup window"))
|
(user-error "Cannot raise a non-popup window"))
|
||||||
(let ((window (selected-window))
|
(let ((buffer (current-buffer))
|
||||||
(buffer (current-buffer))
|
|
||||||
+popup--remember-last)
|
+popup--remember-last)
|
||||||
(set-window-parameter window 'ttl nil)
|
(set-window-parameter window 'ttl nil)
|
||||||
(+popup/close window 'force)
|
(+popup/close window 'force)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue