help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Open Outline-mode file in collapsed state


From: bev
Subject: Re: Open Outline-mode file in collapsed state
Date: Thu, 27 Mar 2008 12:15:26 -0700 (PDT)
User-agent: G2/1.0

On Mar 27, 7:25 am, Evans Winner <tho...@timbral.net> wrote:
> bev <f...@comcast.net> writes:
>
>     I'm not sure what you mean by that. Are you saying add that to the top
>     of every single outline file I have? (Hundreds). I don't want to do
>     that. I need a function that will simply run (hide-trees) every time I
>     open an outline file. I really can't take the time to go add a line to
>     hundreds of files. Also, I've never seen that before. Is that lisp
>     code?
>
> No, as I already said, this was a mistake on my part.  I
> thought the question was about org-mode.  I am pretty sure
> this will not work for outline mode.
>
> Maybe try putting in your .emacs something like
>
>   (add-to-list 'outline-mode-hook (lambda (hide-sublevels 1)))
>
> I haven't tested it, but I think something like this would
> be the answer.

Ah, ok, sorry about not getting the org-mode mistake.
That looks good. I'll try it. In the meantime I figured out one
solution, which seems a little klugey, but it works:

(add-hook 'outline-mode-hook '(lambda ()
       (beginning-of-buffer)
       (outline-next-visible-heading 1)
       (hide-other)
       (hide-subtree)))

Thanks for taking the time to reply to me. I appreciate it. I'll try
your solution as it's more elegant, and seems much closer to THE RIGHT
WAY to do it.

Bev


reply via email to

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