emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] saving state of buffer


From: Carsten Dominik
Subject: Re: [O] saving state of buffer
Date: Thu, 21 Mar 2013 12:38:13 +0100

On 21 mrt. 2013, at 12:25, Rainer M Krug <address@hidden> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On 21/03/13 12:02, Carsten Dominik wrote:
>> This is nice, does anyone of you have write permissions on Work to add this?
> 
> I should have, but I have never done it.

Well, you can try, or else I'll do it.

- Carsten

> 
> Rainer
> 
>> 
>> - Carsten
>> 
>> On 21 mrt. 2013, at 11:16, 42 147 <address@hidden <mailto:address@hidden>> 
>> wrote:
>> 
>>>> Good - May I suggest, that you write a step - by step howto and mail it 
>>>> here or even add it
>>>> to worg? This would be a useful addition.
>>> I adapted this thread the best I could. Feel free to do with it what you 
>>> wish.
>>> 
>>> QUESTION
>>> 
>>> How do I restore the state of my buffer where I left it?
>>> 
>>> ANSWER
>>> 
>>> When Emacs first visits an Org file, the global state is set to OVERVIEW, 
>>> i.e., only the top
>>> level headlines are visible.
>>> 
>>> If you wish Emacs to restore the position of point where you left it in 
>>> your previous
>>> session, add the following code to your .emacs:
>>> 
>>> (require 'saveplace) (setq-default save-place t)
>>> 
>>> If you wish Org-mode to restore the folded state of the buffer (not just 
>>> the position of
>>> point), you can either use customize, or add the following to .emacs:
>>> 
>>> (setq org-show-siblings '((default) (isearch t) (bookmark-jump . t)))
>>> 
>>> If you use customize, take look at the variable org-show-siblings and set a 
>>> special context
>>> for bookmark-jump. This will work for both saveplace and bookmarks.
>>> 
>>> 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. There are companion 
>>> variables, and they
>>> are all in the customization group org-reveal-context.
>>> 
>>> 2013/3/21 Rainer M Krug <address@hidden <mailto:address@hidden>>
>>> 
>> On 21/03/13 10:28, Carsten Dominik wrote:
>> 
>>> On 21 mrt. 2013, at 10:23, Rainer M Krug <address@hidden 
>>> <mailto:address@hidden>>
>>> wrote:
>> 
>>> On 21/03/13 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).
>> 
>>> Good - May I suggest, that you write a step - by step howto and mail it 
>>> here or even add it
>>> to worg? This would be a useful addition.
>> 
>>>> I guess it would make a good FAQ entry.
>> 
>> Haven't thought about these - they would even be better then worg.
>> 
>> 
>>>> I also think that maybe the current default is not good, show-siblings 
>>>> should probably 
>>>> default to t for bookmark jump.
>> 
>> Would make much sense - I assume that would then open the location when 
>> doing a search -
>> replace.
>> 
>> Cheers,
>> 
>> Rainer
>> 
>> 
>>>> - Carsten
>> 
>> 
>>>>>> But I should also thank you for finding the words I struggled to find 
>>>>>> ("folded
>>>>>> state").
>> 
>>> And we have to thank you for this useful question!
>> 
>>> Cheers,
>> 
>>> Rainer
>> 
>>>>>> 
>>>>>> I feel honored that royalty stepped into the discussion.
>>>>>> 
>>>>>> Herzlichen Dank,
>>>>>> 
>>>>>> 42
>>>>>> 
>>>>>> 
>>>>>> 2013/3/21 Carsten Dominik <address@hidden
>>>>>> <mailto:address@hidden>
>> <mailto:address@hidden <mailto:address@hidden>>>
>>>>>> 
>>>>>> 
>>>>>> On 20.3.2013, at 19:28, 42 147 <address@hidden <mailto:address@hidden>
>> <mailto:address@hidden <mailto:address@hidden>>> 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
>>>>>> 
>>>>>> 
>> 
>> 
>> 
>> 
>>> 
>>> 
>> 
> 
> - -- 
> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
> UCT), Dipl. Phys.
> (Germany)
> 
> Centre of Excellence for Invasion Biology
> Stellenbosch University
> South Africa
> 
> Tel :       +33 - (0)9 53 10 27 44
> Cell:       +33 - (0)6 85 62 59 98
> Fax :       +33 - (0)9 58 10 27 44
> 
> Fax (D):    +49 - (0)3 21 21 25 22 44
> 
> email:      address@hidden
> 
> Skype:      RMkrug
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.11 (GNU/Linux)
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
> 
> iQEcBAEBAgAGBQJRSu5FAAoJENvXNx4PUvmCjUwH/RUIVrrAJXxiPlC2Kv32+K7X
> MAC6mLb+NFsXLLq4ErJXvajxqy4Q1PAc+FeVo84LaKT3Ad7nRH9le+oQ4U+wOwbR
> HdcVfMKk+Osgbpe9xW/N2/8LW/wjQfvv5ZbM5aq+VgWzUZfSBKvAOxnvHOjFIUFT
> nBqxyj+CAECja23EoWOEhcLozMjfuCgLxxCcTnTCWqW9VUbpXYlbYCO5eV1rLjw9
> IRI3Vpz10zWZtN5TmhyWXYJzYmCpGYynKQAClV3VF/mG3iyn5ceBVBo8T95vSgBh
> A/zFjrWLH+mAqVYOEz7Jg7K2fz6x0oAPuw42H8t0pm5A2cSECaKVZbD9fnuVaUA=
> =6F+X
> -----END PGP SIGNATURE-----




reply via email to

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