doom/popup-close: refactor

This commit is contained in:
Henrik Lissner 2017-03-01 22:15:32 -05:00
parent 2e66b2e13d
commit 978e121ed0

View file

@ -74,12 +74,12 @@ Returns t if popups were restored, nil otherwise."
;;;###autoload
(defun doom/popup-close (&optional window)
"Find and close WINDOW if it's a popup. If WINDOW is omitted, it will use
`selected-window'. The contained buffer is buried."
"Find and close WINDOW if it's a popup. If WINDOW is omitted, defaults to
`selected-window'. The contained buffer is buried, unless it has an :autokill
property."
(interactive)
(let ((window (or window (selected-window))))
(when (doom-popup-p window)
(delete-window window))))
(when-let (window (doom-popup-p window))
(delete-window window)))
;;;###autoload
(defun doom/popup-close-all (&optional force-p)