From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thorsten Jolitz Subject: Re: Per-window visibility cycling Date: Mon, 08 Jul 2013 08:54:26 +0200 Message-ID: <87txk5a6e5.fsf@gmail.com> References: <87pputzytj.fsf@bobnewell.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40328) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uw5LQ-0002xU-J0 for emacs-orgmode@gnu.org; Mon, 08 Jul 2013 02:54:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uw5LP-0003av-8T for emacs-orgmode@gnu.org; Mon, 08 Jul 2013 02:54:44 -0400 Received: from plane.gmane.org ([80.91.229.3]:32981) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uw5LP-0003ap-19 for emacs-orgmode@gnu.org; Mon, 08 Jul 2013 02:54:43 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Uw5LN-0003uH-3D for emacs-orgmode@gnu.org; Mon, 08 Jul 2013 08:54:41 +0200 Received: from e178063147.adsl.alicedsl.de ([85.178.63.147]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 08 Jul 2013 08:54:41 +0200 Received: from tjolitz by e178063147.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 08 Jul 2013 08:54:41 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Bob Newell 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