I have the following setup, created through a function I've defined in this reddit post, which states in relevant part:
(defun hd/weekly-review ()
"Organize a series of windows for weekly reviews"
;; Define Keyboard Macro to narrow to weekly review checklist
(fset 'hd-km/narrow-weekly-review-list
[?\M-< ?\C-s ?w ?e ?e ?k ?l ?y return ?\C-x ?n ?s])
(interactive)
(delete-other-windows)
;; Start with org-agenda
(org-agenda nil "R")
(set-window-dedicated-p (selected-window) 1)
(delete-other-windows)
;; Create a window for follow-mode (and blank it out with *scratch* so it's less distracting)
(split-window-horizontally)
(display-buffer "*scratch*" t)
;; Create the third window for the maintenance.org
(other-window 1)
(split-window-vertically (floor (* 0.78 (window-height))))
(other-window 1)
(find-file "~/org-docs/org-system/maintenance.org")
(set-window-dedicated-p (selected-window) 1)
(execute-kbd-macro (symbol-function 'hd-km/narrow-weekly-review-list))
(show-all)
(other-window -2)
;; Add to registers config for quick switch back within this session
(window-configuration-to-register ?w))
To summarise, two windows are dedicated to buffers, and one is left undedicated:
-------------------------------------------------
| | |
| | 2a: agenda 'follow' |
| | (not dedicated) |
| | |
| 1a: org-agenda |-----------------------------|
| (dedicated) | |
| | |
| | 2b: reference .org file |
| | (dedicated) |
| | |
| | |
-------------------------------------------------
If I perform an action in 2a which creates a pop-up window (e.g. C-c C-t on a org file heading which brings up org todo), emacs creates a new frame to display the contents of the pop-up (which steals focus & remains even after the action associated with the pop-up is completed).
After alot of reading it seems that this problem could be avoided by adding a custom entry to display-buffer-alist
.
However, this post suggests that approach will not work since emacs essentially ignores display-buffer-alist
for the org todo keywords buffer. The solution proposed is to amend the buffer switching functionality of org-fast-todo-selection
. Whilst the change is trivial, I'm reluctant to do so for forwards compatibility reasons.
Is there a better way to achieve what I want here?
display-buffer-alist
because this stops people from customizing buffer popups, so it's Org's responsibility to undo this, even if it means the default behaviour will change.org-fast-todo-selection
to use the original emacs buffer switching logic rather than org's custom one? I'm still new to elisp and have had a bit of trouble figuring this out.(eval-after-load 'org '(defun org-fast-todo-selection () ...))
in your init file. The definition is up to you, but could be taken as is from your linked post.org-switch-to-buffer-other-window
andorg-no-popups
--org-fast-todo-selection
calls the former, which in turn calls the latter.