FIX 27.1 todo option window sizing change
This commit is contained in:
parent
fd56519d08
commit
662dc19b9e
23
etc/conf.org
23
etc/conf.org
|
@ -1628,27 +1628,14 @@ Org mode is great and all, but the windows never show up in the right place. The
|
||||||
:END:
|
:END:
|
||||||
I only need a teeny tiny window below my current window for todo selection
|
I only need a teeny tiny window below my current window for todo selection
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(defun nd/org-todo-position (buffer alist)
|
(defun nd/org-todo-window-advice (orig-fn &rest args)
|
||||||
(let ((win (car (cl-delete-if-not
|
|
||||||
(lambda (window)
|
|
||||||
(with-current-buffer (window-buffer window)
|
|
||||||
(memq major-mode
|
|
||||||
'(org-mode org-agenda-mode))))
|
|
||||||
(window-list)))))
|
|
||||||
(when win
|
|
||||||
(let ((new (split-window win -4 'below)))
|
|
||||||
(set-window-buffer new buffer)
|
|
||||||
new))))
|
|
||||||
|
|
||||||
(defun nd/org-todo-window-advice (orig-fn)
|
|
||||||
"Advice to fix window placement in `org-fast-todo-selection'."
|
"Advice to fix window placement in `org-fast-todo-selection'."
|
||||||
(let ((override '("\\*Org todo\\*" nd/org-todo-position)))
|
(let ((override '("\\*Org todo\\*" nd/org-todo-position)))
|
||||||
(add-to-list 'display-buffer-alist override)
|
|
||||||
(nd/with-advice
|
(nd/with-advice
|
||||||
((#'org-switch-to-buffer-other-window :override #'pop-to-buffer))
|
((#'delete-other-windows :override #'ignore)
|
||||||
(unwind-protect (funcall orig-fn)
|
(#'split-window-vertically :filter-args (-partial (-const '(-4))))
|
||||||
(setq display-buffer-alist
|
(#'org-switch-to-buffer-other-window :override #'pop-to-buffer))
|
||||||
(delete override display-buffer-alist))))))
|
(unwind-protect (apply orig-fn args)))))
|
||||||
|
|
||||||
(advice-add #'org-fast-todo-selection :around #'nd/org-todo-window-advice)
|
(advice-add #'org-fast-todo-selection :around #'nd/org-todo-window-advice)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
Loading…
Reference in New Issue