1
0
Fork 0

Switch to another window when opening agenda items

This commit is contained in:
Tom Willemse 2020-11-17 18:04:38 -08:00
parent f6fb70894b
commit f2c2bb4837

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org> ;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local ;; Keywords: local
;; Version: 2020.1115.140847 ;; Version: 2020.1117.180414
;; Package-Requires: (oni-yasnippet oni-alert oni-hydra org-plus-contrib org-bullets org-edna diminish all-the-icons) ;; Package-Requires: (oni-yasnippet oni-alert oni-hydra org-plus-contrib org-bullets org-edna diminish all-the-icons)
;; This program is free software; you can redistribute it and/or modify ;; This program is free software; you can redistribute it and/or modify
@ -299,6 +299,10 @@ also move point to the start of the heading."
;;;; Agenda ;;;; Agenda
(defun oni-org-agenda-window-p (_target _action)
"Check if the current buffer is the agenda buffer."
(string= (buffer-name) org-agenda-buffer-name))
(defun oni-org-initialize-agenda-category-icons () (defun oni-org-initialize-agenda-category-icons ()
"Set org-agenda-category-icon-alist if it hasnt already been set." "Set org-agenda-category-icon-alist if it hasnt already been set."
(when (null org-agenda-category-icon-alist) (when (null org-agenda-category-icon-alist)
@ -341,6 +345,11 @@ also move point to the start of the heading."
(add-hook 'org-mode-hook #'oni-org-initialize-agenda-category-icons) (add-hook 'org-mode-hook #'oni-org-initialize-agenda-category-icons)
(add-to-list 'display-buffer-alist
'(oni-org-agenda-window-p
display-buffer-in-previous-window
(inhibit-same-window . t)))
;;;; Capture ;;;; Capture
(require 'org-capture) (require 'org-capture)