fix(popup,org): popup management for org-mode
Adapts to changes made upstream to Org's window management logic (e.g. Org dropped `org-switch-to-buffer-other-window` for `switch-to-buffer-other-window`, and org-journal renamed one of its helper functions).
This commit is contained in:
parent
b3bea23331
commit
334157d741
2 changed files with 4 additions and 20 deletions
|
@ -50,14 +50,6 @@ to this commmand."
|
|||
(+popup/close nil 'force))))
|
||||
(global-set-key [remap quit-window] #'+popup/quit-window)
|
||||
|
||||
(defadvice! +popup-override-display-buffer-alist-a (fn &rest args)
|
||||
"When `pop-to-buffer' is called with non-nil ACTION, that ACTION should
|
||||
override `display-buffer-alist'."
|
||||
:around #'switch-to-buffer-other-tab
|
||||
:around #'switch-to-buffer-other-window
|
||||
:around #'switch-to-buffer-other-frame
|
||||
(let ((display-buffer-alist nil))
|
||||
(apply fn args)))
|
||||
|
||||
|
||||
;;
|
||||
|
@ -295,20 +287,11 @@ Ugh, such an ugly hack."
|
|||
(popup-p (+popup-window-p window)))
|
||||
(prog1 (apply fn args)
|
||||
(when (and popup-p (window-live-p window))
|
||||
(delete-window window)))))
|
||||
|
||||
;; Ensure todo, agenda, and other minor popups are delegated to the popup system.
|
||||
(defadvice! +popup--org-pop-to-buffer-a (fn buf &optional norecord)
|
||||
"Use `pop-to-buffer' instead of `switch-to-buffer' to open buffer.'"
|
||||
:around #'org-switch-to-buffer-other-window
|
||||
(if +popup-mode
|
||||
(pop-to-buffer buf nil norecord)
|
||||
(funcall fn buf norecord))))
|
||||
|
||||
(delete-window window))))))
|
||||
|
||||
;;;###package org-journal
|
||||
(defadvice! +popup--use-popup-window-a (fn &rest args)
|
||||
:around #'org-journal-search-by-string
|
||||
:around #'org-journal--search-by-string
|
||||
(letf! ((#'switch-to-buffer #'pop-to-buffer))
|
||||
(apply fn args)))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue