Refactor +popup*org-pop-to-buffer

Simplify pop-to-buffer call.
This commit is contained in:
Henrik Lissner 2018-06-25 19:35:59 +02:00
parent 8fcc12ed08
commit 0dc0ccc63e
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -234,10 +234,7 @@ instead of switch-to-buffer-*."
(defun +popup*org-pop-to-buffer (orig-fn buf &optional norecord) (defun +popup*org-pop-to-buffer (orig-fn buf &optional norecord)
"Use `pop-to-buffer' instead of `switch-to-buffer' to open buffer.'" "Use `pop-to-buffer' instead of `switch-to-buffer' to open buffer.'"
(if +popup-mode (if +popup-mode
(pop-to-buffer (pop-to-buffer buf nil norecord)
(cond ((stringp buf) (get-buffer-create buf))
((bufferp buf) buf)
(t (error "Invalid buffer %s" buf))))
(funcall orig-fn buf norecord))) (funcall orig-fn buf norecord)))
(advice-add #'org-switch-to-buffer-other-window :around #'+popup*org-pop-to-buffer) (advice-add #'org-switch-to-buffer-other-window :around #'+popup*org-pop-to-buffer)