Optimization: buffer-local-value instead of with-current-buffer

This commit is contained in:
Henrik Lissner 2016-06-17 16:01:07 -04:00
parent b46a75bfe0
commit 85f3c14b2f
3 changed files with 8 additions and 8 deletions

View file

@ -27,12 +27,12 @@
;;;###autoload
(defun doom/popup-p (&optional window)
"Whether WINDOW is a shackle popup window or not. If WINDOW is nil, use
current window."
(let ((window (or window (selected-window))))
(and (window-live-p window)
(with-selected-window window (bound-and-true-p doom-popup-mode))
window)))
"Whether WINDOW is a popup window or not. If WINDOW is nil, use current
window. Returns nil or the popup window."
(setq window (or window (selected-window)))
(and (window-live-p window)
(buffer-local-value 'doom-popup-mode (window-buffer window))
window))
;;;###autoload
(defun doom/popups-p ()