feature/popup: add inhibit-timers letvar

Allows us to disable timer functionality when we're simply setting popup
buffers aside temporarily.
This commit is contained in:
Henrik Lissner 2018-01-06 16:37:31 -05:00
parent eef808d795
commit eab079724d
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 4 additions and 2 deletions

View file

@ -62,12 +62,12 @@ and enables `+popup-buffer-mode'."
;; t = default
;; integer = ttl
;; nil = no timer
(when ttl
(when (and ttl (not +popup--inhibit-transient))
(when (eq ttl t)
(setq ttl +popup-ttl))
(cl-assert (integerp ttl) t)
(if (= ttl 0)
(+popup--kill-buffer buffer)
(+popup--kill-buffer buffer 0)
(setq +popup--timer
(run-at-time ttl nil #'+popup--kill-buffer buffer ttl))))))))
@ -316,6 +316,7 @@ with the :popup setting."
prevent the popup(s) from messing up the UI (or vice versa)."
`(let* ((in-popup-p (+popup-p))
(popups (+popup-windows))
(+popup--inhibit-transient t)
+popup--last)
(dolist (p popups)
(+popup/close p 'force))