feature/popup: add with-popup-rules! macro
This commit is contained in:
parent
7590c46f6c
commit
96e8e3cc19
1 changed files with 12 additions and 0 deletions
|
@ -386,6 +386,18 @@ the message buffer in a popup window."
|
||||||
;; Macros
|
;; Macros
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defmacro with-popup-rules! (rules &rest body)
|
||||||
|
"Evaluate BODY with popup RULES. RULES is a list of popup rules. Each rule
|
||||||
|
should match the arguments of `+popup-define' or the :popup setting."
|
||||||
|
(declare (indent defun))
|
||||||
|
`(let ((+popup--display-buffer-alist +popup--old-display-buffer-alist)
|
||||||
|
display-buffer-alist)
|
||||||
|
,@(cl-loop for rule in rules collect `(+popup-define ,@rule))
|
||||||
|
(when (bound-and-true-p +popup-mode)
|
||||||
|
(setq display-buffer-alist +popup--display-buffer-alist))
|
||||||
|
,@body))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defmacro without-popups! (&rest body)
|
(defmacro without-popups! (&rest body)
|
||||||
"Run BODY with a default `display-buffer-alist', ignoring the popup rules set
|
"Run BODY with a default `display-buffer-alist', ignoring the popup rules set
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue