incandescentman
incandescentman

Reputation: 6388

In Emacs org-mode, how to narrow display to two subtrees in two separate files?

I work with my frame split into two windows. I have two org-mode files open, each with subtrees I want to display in isolation.

I can do this successfully with a single subtree by navigating to Heading 1 in file-1.org and invoking the command org-tree-to-indirect-buffer.

But when I go to the second file in the second frame, navigate to the heading I want, and execute org-tree-to-indirect-buffer on that tree, it displays that subtree, BUT - in the first frame, it also unfocuses my subtree back to the main file.

How do I simultaneously view two subtrees in two separate files?

Upvotes: 23

Views: 7070

Answers (1)

assem
assem

Reputation: 2097

Narrowing

Try narrowing instead:

(org-narrow-to-subtree) : C-x n s

then

(widen) : C-x n w

when you're done


org-tree-to-indirect-buffer

Alternatively, if you must use org-tree-to-indirect-buffer, it looks like you could also do this:

(setq org-indirect-buffer-display 'current-window)

C-u M-x org-tree-to-indirect-buffer

Where the normal action is to prevent buffer proliferation, but with the universal arg it will open a 2nd subtree without trashing the previous buffer. Check C-h f org-tree-to-indirect-buffer for full details.

Upvotes: 40

Related Questions