Fix conflict between :ui popup & org-src-window-setup

When set to split-window-*, other-frame, or current-window.
This commit is contained in:
Henrik Lissner 2020-02-25 13:36:18 -05:00
parent e20f574b2e
commit f716aa5158
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -266,7 +266,18 @@ Ugh, such an ugly hack."
:around #'org-switch-to-buffer-other-window
(if +popup-mode
(pop-to-buffer buf nil norecord)
(funcall orig-fn buf norecord))))
(funcall orig-fn buf norecord)))
;; HACK `pop-to-buffer-same-window' consults `display-buffer-alist', which is
;; what our popup manager uses to manage popup windows. However,
;; `org-src-switch-to-buffer' already does its own window management
;; prior to calling `pop-to-buffer-same-window', so there's no need to
;; _then_ hand off the buffer to the pop up manager.
(defadvice! +popup--org-src-switch-to-buffer-a (orig-fn &rest args)
:around #'org-src-switch-to-buffer
(cl-letf (((symbol-function #'pop-to-buffer-same-window)
(symbol-function #'switch-to-buffer)))
(apply orig-fn args))))
;;;###package persp-mode