summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Lemon <matt@matthewlemon.com>2022-11-23 10:02:50 +0000
committerMatthew Lemon <matt@matthewlemon.com>2022-11-23 10:02:50 +0000
commit28c9dc8e50c7fce59f0c39efa415fd877f9d7461 (patch)
treeba129080ee9f2a6fe2c67e7e3f814804b8bcd4a2
parent61bd0f95560922efe77b0ed73c1e68ce92f2d3cd (diff)
added 'advice' to func to allow immediate narrowing from agenda
When hitting tab on an item in the agenda, you go to the narrowed subtree, which is much cleaner.
-rw-r--r--init.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/init.el b/init.el
index 0f5014f..a200f34 100644
--- a/init.el
+++ b/init.el
@@ -782,6 +782,12 @@ If failed try to complete the common part with `company-complete-common'"
("C-c b" . 'org-iswitchb)
("C-c c" . 'org-capture))
:config
+ ;; advice function to immediately narrow to subtree from org-agenda-goto
+ ;; which is hitting TAB to view an item in the agenda
+ ;; from https://emacs.stackexchange.com/questions/17797/how-to-narrow-to-subtree-in-org-agenda-follow-mode
+ (advice-add 'org-agenda-goto :after
+ (lambda (&rest args)
+ (org-narrow-to-subtree)))
(setq org-src-tab-acts-natively t)
(setq org-directory "~/org/")
(setq org-highest-priority ?A)