feature/popup: add :ignore support to :popup

Allows you to ignore certain buffers. Helpful for plugins that manage
their own windows, like magit.

To use:

  (set! :popup "^\\*magit" :ignore)

Relevant to #337
This commit is contained in:
Henrik Lissner 2018-01-09 17:42:08 -05:00
parent bfcbb9ca01
commit a4e22d48b8
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -121,20 +121,23 @@ ALIST supports one custom parameter: `size', which will resolve to
`window-height' or `window-width' depending on `side'."
`(let ((alist ,alist)
(parameters ,parameters))
,(when alist
`(when-let* ((size (cdr (assq 'size alist)))
(side (or (cdr (assq 'side (append alist +popup-default-alist))) 'bottom)))
(map-delete alist 'size)
(map-put alist (if (memq side '(left right))
'window-width
'window-height)
size)))
(prog1 (push (append (list ,condition '(+popup-buffer))
alist
(list (cons 'window-parameters parameters)))
+popup--display-buffer-alist)
(when (bound-and-true-p +popup-mode)
(setq display-buffer-alist +popup--display-buffer-alist)))))
(if (eq alist :ignore)
(push (list ,condition nil) +popup--display-buffer-alist)
,(when alist
`(when-let* ((size (cdr (assq 'size alist)))
(side (or (cdr (assq 'side (append alist +popup-default-alist)))
'bottom)))
(map-delete alist 'size)
(map-put alist (if (memq side '(left right))
'window-width
'window-height)
size)))
(prog1 (push (append (list ,condition '(+popup-buffer))
alist
(list (cons 'window-parameters parameters)))
+popup--display-buffer-alist)))
(when (bound-and-true-p +popup-mode)
(setq display-buffer-alist +popup--display-buffer-alist))))
;;