emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Per-window visibility cycling


From: Thorsten Jolitz
Subject: Re: [O] Per-window visibility cycling
Date: Mon, 08 Jul 2013 08:54:26 +0200
User-agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.3 (gnu/linux)

Bob Newell <address@hidden> writes:

> This likely has been asked in the past but I didn't find it so please
> allow me :)
>
> Is visibility cycling per-buffer and not per-window? 
>
> I ask because I want to do a horizontal split of a window containing an
> org-mode file. Then I want to do a certain level of visibility cycling
> in the left side to sort of make an index. On the right side, I want to
> open/close various tree branches without affecting the left side.
>
> But the two always seem to stay in sync with respect to visibility.
>
> Any ideas appreciated.

Besides using an indirect buffer or calling

#+begin_quote
org-goto is an interactive compiled Lisp function in `org.el'.

(org-goto &optional ALTERNATIVE-INTERFACE)

Look up a different location in the current file, keeping current visibility.

When you want look-up or go to a different location in a
document, the fastest way is often to fold the entire buffer and
then dive into the tree.  This method has the disadvantage, that
the previous location will be folded, which may not be what you
want.

This command works around this by showing a copy of the current
buffer in an indirect buffer, in overview mode.  You can dive
into the tree in that copy, use org-occur and incremental search
to find a location.  When pressing RET or `Q', the command
returns to the original buffer in which the visibility is still
unchanged.  After RET it will also jump to the location selected
in the indirect buffer and expose the headline hierarchy above.

With a prefix argument, use the alternative interface: e.g. if
`org-goto-interface' is 'outline use 'outline-path-completion.
#+end_quote

you could use `navi-mode.el' for that, it gives you many different views
on an Org-mode file (or 'outshine' source code file), i.e. different
levels of headlines (optionally combined with keyword searches), and
enable you to change visibility or the associated Org-mode buffer
without leaving the *Navi* buffer.

For example, typing '2' in the *Navi* buffer of `navi-mode.el' gives you
the headlines up to level 2 (works the same for Org-mode files):

#+begin_quote
18 matches for "^;; \*\*? " in buffer: navi-mode.el
      1:;; * navi-mode.el --- major-mode for easy buffer-navigation
     15:;; ** Commentary
    225:;; ** ChangeLog
    232:;; * Requires
    237:;; * Mode Definitions
    268:;; * Variables
    269:;; ** Consts
    270:;; ** Vars
    286:;; ** Hooks
    291:;; ** Fonts
    292:;; ** Customs
    818:;; * Defuns
    819:;; ** Functions
   1290:;; ** Commands
   1628:;; * Menus and Keys
   1629:;; ** Menus
   1826:;; ** Keys
   1919:;; * Run Hooks and Provide
#+end_quote

You can then navigate over the headlines with 'n' and 'p' and use TAB to cycle
visibility in the associated buffer. Use BACKTAB to cycle the whole associated
buffer. 

You can even type 'E' in the *Navi* buffer and edit the headlines right
there (using keyboard macros for bulk edits), before switching back to
read-only mode with C-c C-c. Edits are directly applied to the
associated buffer.

-- 
cheers,
Thorsten




reply via email to

[Prev in Thread] Current Thread [Next in Thread]