问题
Org's narrow-to-subtree
is wonderful, but sometimes I also want to see the chain of parent nodes, without all the uncle nodes.
For example, given this tree:
* a
** a.a <- extraneous great uncle
** a.b
*** a.b.a <- extraneous uncle
*** a.b.b <- want to see context for this
**** a.b.b.a
**** a.b.b.b
I want to narrow my view to see this:
* a
** a.b
*** a.b.b <- want to see context for this
**** a.b.b.a
**** a.b.b.b
How can I make this happen?
回答1:
AFAIK, there is no such narrowing facility - but the function org-display-outline-path will display "a/a.b" for the heading in question, i.e. the outline path of headings above your current heading. You can add the function to the modeline indicator if you want it to be permanently visible - or perhaps use the (normally absent) header line which has more space to grow. Try with this file:
* foo
#+BEGIN_SRC emacs-lisp
(setq header-line-format '(:eval (org-display-outline-path)))
#+END_SRC
#+RESULTS:
: (:eval (org-display-outline-path))
** bar
*** baz
Evaluate the code block to set the header-line-format-variable and then see what the header line says when the cursor is on the "** bar" header or the "*** baz" header.
来源:https://stackoverflow.com/questions/38667497/is-there-some-kind-of-narrow-to-context-in-org-mode