From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: saving state of buffer Date: Thu, 21 Mar 2013 10:47:04 +0100 Message-ID: <7DDBF0AF-47F9-426D-BDD8-CACAB7461EC7@gmail.com> References: <878v5inpfd.fsf@bzg.ath.cx> Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_A1E21C45-4764-4644-B617-FEF605DE693A" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:41896) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIc5U-0001sy-39 for emacs-orgmode@gnu.org; Thu, 21 Mar 2013 05:47:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UIc5S-0002ZT-He for emacs-orgmode@gnu.org; Thu, 21 Mar 2013 05:47:08 -0400 Received: from ezel.ic.uva.nl ([146.50.108.158]:57484) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIc5S-0002ZK-7w for emacs-orgmode@gnu.org; Thu, 21 Mar 2013 05:47:06 -0400 In-Reply-To: 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: 42 147 Cc: "Loyall, David" , Org Mode --Apple-Mail=_A1E21C45-4764-4644-B617-FEF605DE693A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 On 21 mrt. 2013, at 10:05, 42 147 wrote: > Thanks David, but what Carsten suggested completely resolved my = problem (it > applies not just to bookmarks; it fully preserves my buffer's folded = state > after adding Christoph's code to my .emacs). I don't think it preserves a state. It constructs one, and you happen = to like it. :) - Carsten > But I should also thank you > for finding the words I struggled to find ("folded state"). >=20 > I feel honored that royalty stepped into the discussion. >=20 > Herzlichen Dank, >=20 > 42 >=20 >=20 > 2013/3/21 Carsten Dominik >=20 > On 20.3.2013, at 19:28, 42 147 wrote: >=20 >> > (require 'saveplace) >> > (setq-default save-place t) >>=20 >> > works for me. It just opens the place where I had the point, = nothing=20 >> > more, but that's what I need most. >>=20 >> This is more convenient than Emacs bookmarks, but still breaks = org-mode to >> a certain extent: all non top-level headlines below point are hidden. = At >> least for me. >>=20 >=20 > Org-mode has very precise control for situations when a jump into = invisible text happens, for example by isearch or by bookmark-jump or = saveplace. Take a look at the variable org-show-siblings and set a = special context for bookmark-jump, that should do it. This will work = for both saveplace and bookmarks. >=20 > You can do this with customize, or just like this: >=20 > (setq org-show-siblings '((default) (isearch t) (bookmark-jump . t))) >=20 > There are companion variables, they are all in the customization group = org-reveal-context. >=20 > - Carsten >=20 --Apple-Mail=_A1E21C45-4764-4644-B617-FEF605DE693A Content-Transfer-Encoding: 7bit Content-Type: text/html; charset=iso-8859-1
On 21 mrt. 2013, at 10:05, 42 147 <aeuster@gmail.com> wrote:

Thanks David, but what Carsten suggested completely resolved my problem (it
applies not just to bookmarks; it fully preserves my buffer's folded state
after adding Christoph's code to my .emacs).

I don't think it preserves a state.  It constructs one, and you happen to like it. :)

- Carsten


But I shoul d also thank you
for finding the words I struggled to find ("folded state").

I feel honored that royalty stepped into the discussion.

Herzlichen Dank,

42


2013/3/21 Carsten Dominik <carsten.dominik@gmail.com>

On 20.3.2013, at 19:28, 42 147 <aeuster@gmail.com> wrote:

> (require 'saveplace)
> (setq-default save-place t)

> works for me. It just opens the place where I had the point, nothing 
> more, but that's what I need most.

This is more convenient than Emacs bookmarks, but still breaks org-mode to
a certain extent: all non top-level headlines below point are hidden. At
least for me.

Org-mode has very precise control for situations when a jump into invisible text happens, for example by isearch or by bookmark-jump or saveplace.  Take a look at the variable org-show-siblings and set a special context for bookmark-jump, that should do it.  This will work for both saveplace and bookmarks.

You can do this with customize, or just like this:

(setq org-show-siblings '((default) (isearch t) (bookmark-jump . t)))

There are companion variables, they are all in the customization group org-reveal-context.

- Carsten


--Apple-Mail=_A1E21C45-4764-4644-B617-FEF605DE693A--