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 ;;;###autoload
(defun doom/popup-close (&optional window) (defun doom/popup-close (&optional window)
"Find and close WINDOW if it's a popup. If WINDOW is omitted, it will use "Find and close WINDOW if it's a popup. If WINDOW is omitted, defaults to
`selected-window'. The contained buffer is buried." `selected-window'. The contained buffer is buried, unless it has an :autokill
property."
(interactive) (interactive)
(let ((window (or window (selected-window)))) (when-let (window (doom-popup-p window))
(when (doom-popup-p window) (delete-window window)))
(delete-window window))))
;;;###autoload ;;;###autoload
(defun doom/popup-close-all (&optional force-p) (defun doom/popup-close-all (&optional force-p)