emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Thorsten Jolitz <tjolitz@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: Per-window visibility cycling
Date: Mon, 08 Jul 2013 08:54:26 +0200	[thread overview]
Message-ID: <87txk5a6e5.fsf@gmail.com> (raw)
In-Reply-To: 87pputzytj.fsf@bobnewell.net

Bob Newell <bobnewell@bobnewell.net> 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

      parent reply	other threads:[~2013-07-08  6:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-08  0:21 Per-window visibility cycling Bob Newell
2013-07-08  0:24 ` Samuel Wales
2013-07-08  6:54 ` Thorsten Jolitz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87txk5a6e5.fsf@gmail.com \
    --to=tjolitz@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).