doom-popup-p: return window if popup
This commit is contained in:
parent
64a60a1501
commit
8fa6ba7886
1 changed files with 6 additions and 4 deletions
|
@ -3,13 +3,15 @@
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom-popup-p (&optional target)
|
(defun doom-popup-p (&optional target)
|
||||||
"Return t if TARGET (a window or buffer) is a popup. Uses current window if
|
"Return TARGET (a window) if TARGET (a window or buffer) is a popup. Uses
|
||||||
omitted."
|
current window if omitted."
|
||||||
(when-let (target (or target (selected-window)))
|
(when-let (target (or target (selected-window)))
|
||||||
(cond ((bufferp target)
|
(cond ((bufferp target)
|
||||||
(buffer-local-value 'doom-popup-mode target))
|
(and (buffer-local-value 'doom-popup-mode target)
|
||||||
|
(get-buffer-window target)))
|
||||||
((windowp target)
|
((windowp target)
|
||||||
(window-parameter target 'popup)))))
|
(and (window-parameter target 'popup)
|
||||||
|
target)))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom-popup-buffer (buffer &rest plist)
|
(defun doom-popup-buffer (buffer &rest plist)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue