{"id":2130,"date":"2019-04-21T11:42:00","date_gmt":"2019-04-21T18:42:00","guid":{"rendered":"https:\/\/www.stevenbrown.ca\/blog\/?p=2130"},"modified":"2019-04-22T19:08:09","modified_gmt":"2019-04-23T02:08:09","slug":"org-mode-indirect-buffer-narrowing-to-tree","status":"publish","type":"post","link":"https:\/\/www.stevenbrown.ca\/blog\/archives\/2130","title":{"rendered":"Org-mode: Indirect Buffer, Narrowing to tree"},"content":{"rendered":"<p> Here&#8217;s a really quick <a href=\"https:\/\/www.gnu.org\/software\/emacs\/\">Emacs<\/a> <a href=\"https:\/\/orgmode.org\/\">Org-mode<\/a> tip that I find extremely useful. <\/p>\n<p> In your <a href=\"https:\/\/github.com\/izm\/dotemacs\/blob\/master\/init.org#other\">config<\/a> add the following two lines: <\/p>\n<div class=\"org-src-container\">\n<pre class=\"src src-emacs-lisp\">(<span style=\"color: #00bfff;\">setq<\/span> org-indirect-buffer-display 'new-frame)\n(<span style=\"color: #00bfff;\">setq<\/span> org-src-window-setup 'other-frame)\n<\/pre>\n<\/div>\n<p> <i>(Or just run it in your scratch buffer to try it out for your current session.)<\/i> <\/p>\n<p> The first line sets the <code>org-indirect-buffer-display<\/code> variable to <code>new-frame<\/code>.  Now when you call <code>org-tree-to-indirect-buffer<\/code> or <code>org-agenda-tree-to-indirect-buffer<\/code> (<code>C-c C-x b<\/code>) from an Org buffer or an Org agenda item, Emacs will create a new frame narrowed to that Org sub-tree.  I find this <i>much<\/i> more useful than the default <code>other-window<\/code> as I usually operate with one frame vertically split with two windows, and like to maintain manual control over the contents of the windows. <\/p>\n<p> Similarly, I like a frame-focused behaviour when editing literal source blocks, which is what the second line sets.  While in an Org source block, calling <code>org-edit-special<\/code> (<code>C-c '<\/code> ) will open a new frame narrowed to the current source block and in the appropriate major mode (<code>python-mode<\/code>, for example). The variable for this setting is <code>org-src-window-setup<\/code>. <\/p>\n<p> To see the documentation for either variables, use the Emacs help system! (<code>C-h v variable-name<\/code>) <\/p>\n<p> See also: <a href=\"https:\/\/www.gnu.org\/software\/emacs\/manual\/html_node\/emacs\/Indirect-Buffers.html\">Emacs Indirect-Buffers<\/a>, <a href=\"https:\/\/www.gnu.org\/software\/emacs\/manual\/html_node\/emacs\/Narrowing.html\">Emacs Buffer Narrowing<\/a>, <a href=\"https:\/\/orgmode.org\/manual\/Structure-editing.html\">org-narrow-to-subtree<\/a> <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s a really quick Emacs Org-mode tip that I find extremely useful. In your config add the following two lines: (setq org-indirect-buffer-display &#8216;new-frame) (setq org-src-window-setup &#8216;other-frame) (Or just run it in your scratch buffer to try it out for your current session.) The first line sets the org-indirect-buffer-display variable to new-frame. Now when you call&hellip; <a class=\"more-link\" href=\"https:\/\/www.stevenbrown.ca\/blog\/archives\/2130\">Continue reading <span class=\"screen-reader-text\">Org-mode: Indirect Buffer, Narrowing to tree<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[3],"tags":[250,251],"class_list":["post-2130","post","type-post","status-publish","format-standard","hentry","category-geek","tag-emacs","tag-org","entry"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4jEMb-ym","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.stevenbrown.ca\/blog\/wp-json\/wp\/v2\/posts\/2130","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.stevenbrown.ca\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.stevenbrown.ca\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.stevenbrown.ca\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.stevenbrown.ca\/blog\/wp-json\/wp\/v2\/comments?post=2130"}],"version-history":[{"count":10,"href":"https:\/\/www.stevenbrown.ca\/blog\/wp-json\/wp\/v2\/posts\/2130\/revisions"}],"predecessor-version":[{"id":2158,"href":"https:\/\/www.stevenbrown.ca\/blog\/wp-json\/wp\/v2\/posts\/2130\/revisions\/2158"}],"wp:attachment":[{"href":"https:\/\/www.stevenbrown.ca\/blog\/wp-json\/wp\/v2\/media?parent=2130"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.stevenbrown.ca\/blog\/wp-json\/wp\/v2\/categories?post=2130"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.stevenbrown.ca\/blog\/wp-json\/wp\/v2\/tags?post=2130"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}