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
|
||||
(defun doom-popup-p (&optional target)
|
||||
"Return t if TARGET (a window or buffer) is a popup. Uses current window if
|
||||
omitted."
|
||||
"Return TARGET (a window) 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))
|
||||
(and (buffer-local-value 'doom-popup-mode target)
|
||||
(get-buffer-window target)))
|
||||
((windowp target)
|
||||
(window-parameter target 'popup)))))
|
||||
(and (window-parameter target 'popup)
|
||||
target)))))
|
||||
|
||||
;;;###autoload
|
||||
(defun doom-popup-buffer (buffer &rest plist)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue