mirror of
https://github.com/pestctrl/emacs-config.git
synced 2026-02-16 16:24:18 +00:00
FUCK (org-mode's utter disregard for) SIDE WINDOWS
This commit is contained in:
parent
a302962dc1
commit
3fc6fed1b0
1 changed files with 21 additions and 0 deletions
|
|
@ -24,9 +24,16 @@
|
|||
|
||||
;;; Code:
|
||||
|
||||
(defun my/side-window-p (window)
|
||||
(window-parameter window 'window-side))
|
||||
|
||||
(defun my/org-capture-shouldnt-mess-windows (fun &rest args)
|
||||
(let ((buffer
|
||||
(save-window-excursion
|
||||
(--> (window-list)
|
||||
(remove-if #'my/side-window-p it)
|
||||
(car it)
|
||||
(select-window it))
|
||||
(apply fun args)
|
||||
(current-buffer))))
|
||||
(pop-to-buffer buffer)))
|
||||
|
|
@ -43,5 +50,19 @@
|
|||
:around
|
||||
#'my/org-capture-finalize-shouldnt-mess-windows)
|
||||
|
||||
(defun my/org-todo-side-window-hack (fun &rest args)
|
||||
(save-window-excursion
|
||||
(let ((b (current-buffer)))
|
||||
(--> (window-list)
|
||||
(remove-if #'my/side-window-p it)
|
||||
(car it)
|
||||
(select-window it))
|
||||
(switch-to-buffer b)
|
||||
(apply fun args))))
|
||||
|
||||
(advice-add #'org-todo
|
||||
:around
|
||||
#'my/org-todo-side-window-hack)
|
||||
|
||||
(provide 'my-org-capture-shouldnt-mess-windows)
|
||||
;;; my-org-capture-shouldnt-mess-windows.el ends here
|
||||
|
|
|
|||
Loading…
Reference in a new issue