fix(popup): overaggressive ignoring of popup rules

Would cause errors in some legitimate cases where we want
display-buffer-alist respected.
This commit is contained in:
Henrik Lissner 2021-07-31 00:40:12 -04:00
parent 443370b4d7
commit 348ff3f65d

View file

@ -50,15 +50,14 @@ to this commmand."
(+popup/close nil 'force)))) (+popup/close nil 'force))))
(global-set-key [remap quit-window] #'+popup/quit-window) (global-set-key [remap quit-window] #'+popup/quit-window)
(defadvice! +popup-override-display-buffer-alist-a (orig-fn buffer-or-name &optional action norecord) (defadvice! +popup-override-display-buffer-alist-a (orig-fn &rest args)
"When `pop-to-buffer' is called with non-nil ACTION, that ACTION should "When `pop-to-buffer' is called with non-nil ACTION, that ACTION should
override `display-buffer-alist'." override `display-buffer-alist'."
:around #'pop-to-buffer :around #'switch-to-buffer-other-tab
(let ((display-buffer-overriding-action :around #'switch-to-buffer-other-window
(if (eq action t) :around #'switch-to-buffer-other-frame
display-buffer-overriding-action (let ((display-buffer-alist nil))
action))) (apply orig-fn args)))
(funcall orig-fn buffer-or-name action norecord)))
;; ;;