core/autoload/popups: doom-popup-p now accepts a buffer or window

This commit is contained in:
Henrik Lissner 2017-02-24 03:12:14 -05:00
parent 585a559422
commit 39ee26d669

View file

@ -2,10 +2,14 @@
(provide 'doom-lib-popups)
;;;###autoload
(defun doom-popup-p (&optional window)
"Return t if WINDOW is a popup. Uses current window if WINDOW is omitted."
(let ((window (or window (selected-window))))
(and window (window-parameter window 'popup))))
(defun doom-popup-p (&optional target)
"Return t if TARGET (a window or buffer) is a popup. Uses current window if
omitted."
(when-let (target (or target (selected-window)))
(cond ((bufferp target)
(buffer-local-value 'doom-popup-mode target))
((windowp target)
(window-parameter target 'popup)))))
;;;###autoload
(defun doom-popup-buffer (buffer &rest plist)