ui/popup: delete old rule in :popup/:popups settings

In case the settings are used or ran after initialization (e.g. in the
case of doom//reload).
This commit is contained in:
Henrik Lissner 2018-05-30 01:39:16 +02:00
parent b4ebb2abca
commit 75e6ea6bee
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -27,6 +27,9 @@ will be tested against CONDITION, which is either a) a regexp string (which is
matched against the buffer's name) or b) a function that takes no arguments and
returns a boolean."
`(progn
(when after-init-time
(setq +popup--display-buffer-alist
(map-delete +popup--display-buffer-alist ,condition)))
(push (+popup--rule (list ,condition ,alist ,parameters))
+popup--display-buffer-alist)
(when (bound-and-true-p +popup-mode)
@ -43,6 +46,9 @@ each individual rule.
(\"^\\*\" '((slot . 1) (vslot . -1)) '((select . t))))"
`(progn
(dolist (rule (nreverse (list ,@rules)))
(when after-init-time
(setq +popup--display-buffer-alist
(map-delete +popup--display-buffer-alist (car rule))))
(push (+popup--rule rule) +popup--display-buffer-alist))
(when (bound-and-true-p +popup-mode)
(setq display-buffer-alist +popup--display-buffer-alist))