Refactor +popup*org-pop-to-buffer
Simplify pop-to-buffer call.
This commit is contained in:
parent
8fcc12ed08
commit
0dc0ccc63e
1 changed files with 1 additions and 4 deletions
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue