{"id":12629,"date":"2024-12-08T10:58:39","date_gmt":"2024-12-08T15:58:39","guid":{"rendered":"https:\/\/irreal.org\/blog\/?p=12629"},"modified":"2024-12-08T10:58:39","modified_gmt":"2024-12-08T15:58:39","slug":"narrowing-to-a-subtree-from-org-agenda","status":"publish","type":"post","link":"https:\/\/irreal.org\/blog\/?p=12629","title":{"rendered":"Narrowing To A Subtree From Org Agenda"},"content":{"rendered":"<p>\nOver at the Emacs subreddit, seidenkaufman asks <a href=\"https:\/\/www.reddit.com\/r\/emacs\/comments\/1h532zl\/how_to_automatically_narrow_to_subtree_when\/?rdt=57629\">how he can narrow to a subheading when he types Tab in the Org Agenda<\/a>. If you don&rsquo;t do that sort of thing it may not seem all that useful but, believe me, when you want to edit a headline in the agenda, narrowing would be a big win. That&rsquo;s because by default you always end up at the timestamp in the entry.\n<\/p>\n<p>\nSeidenkaufman&rsquo;s idea was to simply add a hook for <code>org-agenda-goto<\/code> to call narrow. But that didn&rsquo;t work and he was wondering why. As usual, the Emacs community came to the rescue with their own solutions to the problem. They ranged from a fairly elaborate bunch of Elisp to a simple macro.\n<\/p>\n<p>\nIn the end, though, the answer was really simple. There <i>is no<\/i> <code>org-agenda-goto<\/code> hook. Instead, you have to use the <code>org-agenda-after-show-hook<\/code>. Then you can simply use it to call <code>org-narrow-to-subtree<\/code> to get the desired result.\n<\/p>\n<p>\nI really like this post because it shows a couple of things. First, there&rsquo;s a lot a knowledge embedded in the Emacs user community and those users are generous about sharing it. Second, even those that had working solutions found that there was a simpler solution available. In other words, everybody benefits from the discussion of Seidenkaufman&rsquo;s question<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Over at the Emacs subreddit, seidenkaufman asks how he can narrow to a subheading when he types Tab in the Org Agenda. If you don&rsquo;t do that sort of thing it may not seem all that useful but, believe me, &hellip; <a href=\"https:\/\/irreal.org\/blog\/?p=12629\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-12629","post","type-post","status-publish","format-standard","hentry","category-general"],"_links":{"self":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/12629","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=12629"}],"version-history":[{"count":1,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/12629\/revisions"}],"predecessor-version":[{"id":12630,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/12629\/revisions\/12630"}],"wp:attachment":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=12629"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=12629"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=12629"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}