* Re: Open Outline-mode file in collapsed state
2008-03-25 3:28 Open Outline-mode file in collapsed state bev
@ 2008-03-25 3:28 ` Evans Winner
2008-03-26 1:00 ` Xavier Maillard
` (2 more replies)
2008-03-29 15:55 ` Bastien
1 sibling, 3 replies; 12+ messages in thread
From: Evans Winner @ 2008-03-25 3:28 UTC (permalink / raw)
To: help-gnu-emacs
bev <fbe2@comcast.net> writes:
Hi all.
I'd like to figure out a way to open an outline file in
it's fully collapsed state, so that all I see is the
headers.
I believe you can add the string --
#+STARTUP: overview
-- to the very top of your file. Check the info file:
(info "(org)In-buffer settings")
^ permalink raw reply [flat|nested] 12+ messages in thread
* Open Outline-mode file in collapsed state
@ 2008-03-25 3:28 bev
2008-03-25 3:28 ` Evans Winner
2008-03-29 15:55 ` Bastien
0 siblings, 2 replies; 12+ messages in thread
From: bev @ 2008-03-25 3:28 UTC (permalink / raw)
To: help-gnu-emacs
Hi all.
I'd like to figure out a way to open an outline file in it's fully
collapsed state, so that all I see is the headers. As things stand
now, when I open a file in outline-mode it's fully expanded and I have
to run \C-c \C-q - (hide-subtrees) - to get it into the collapsed
state. It's a bore to have to do that every single time I open one of
those files.
I tried adding (eval-after-load (hide-subtrees)) to the outline-mode-
hook, but that doesn't work.
Any ideas?
Thanks
Bev
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Open Outline-mode file in collapsed state
2008-03-25 3:28 ` Evans Winner
@ 2008-03-26 1:00 ` Xavier Maillard
[not found] ` <mailman.9419.1206495571.18990.help-gnu-emacs@gnu.org>
2008-03-29 15:56 ` Bastien
2 siblings, 0 replies; 12+ messages in thread
From: Xavier Maillard @ 2008-03-26 1:00 UTC (permalink / raw)
To: Evans Winner; +Cc: help-gnu-emacs
bev <fbe2@comcast.net> writes:
Hi all.
I'd like to figure out a way to open an outline file in
it's fully collapsed state, so that all I see is the
headers.
I believe you can add the string --
#+STARTUP: overview
-- to the very top of your file. Check the info file:
(info "(org)In-buffer settings")
Does this work with the regular outline-mode ?
Xavier
--
http://www.gnu.org
http://www.april.org
http://www.lolica.org
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Open Outline-mode file in collapsed state
[not found] ` <mailman.9419.1206495571.18990.help-gnu-emacs@gnu.org>
@ 2008-03-27 8:33 ` bev
2008-03-27 14:25 ` Evans Winner
0 siblings, 1 reply; 12+ messages in thread
From: bev @ 2008-03-27 8:33 UTC (permalink / raw)
To: help-gnu-emacs
On Mar 25, 6:00 pm, Xavier Maillard <x...@gnu.org> wrote:
> bev <f...@comcast.net> writes:
>
> Hi all.
>
> I'd like to figure out a way to open an outline file in
> it's fully collapsed state, so that all I see is the
> headers.
>
> I believe you can add the string --
>
> #+STARTUP: overview
>
> -- to the very top of your file. Check the info file:
>
> (info "(org)In-buffer settings")
>
> Does this work with the regular outline-mode ?
>
> Xavier
> --http://www.gnu.orghttp://www.april.orghttp://www.lolica.org
Hi Guys,
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?
Thanks
Bev
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Open Outline-mode file in collapsed state
2008-03-27 8:33 ` bev
@ 2008-03-27 14:25 ` Evans Winner
2008-03-27 19:15 ` bev
2008-03-27 19:27 ` bev
0 siblings, 2 replies; 12+ messages in thread
From: Evans Winner @ 2008-03-27 14:25 UTC (permalink / raw)
To: help-gnu-emacs
bev <fbe2@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.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Open Outline-mode file in collapsed state
2008-03-27 14:25 ` Evans Winner
@ 2008-03-27 19:15 ` bev
2008-03-27 19:27 ` bev
1 sibling, 0 replies; 12+ messages in thread
From: bev @ 2008-03-27 19:15 UTC (permalink / raw)
To: help-gnu-emacs
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
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Open Outline-mode file in collapsed state
2008-03-27 14:25 ` Evans Winner
2008-03-27 19:15 ` bev
@ 2008-03-27 19:27 ` bev
2008-03-27 19:48 ` Evans Winner
1 sibling, 1 reply; 12+ messages in thread
From: bev @ 2008-03-27 19:27 UTC (permalink / raw)
To: help-gnu-emacs
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.
Evans,
Yep, a slight variation of your solution works. I now have in
my .emacs:
(add-hook 'outline-mode-hook '(lambda () (hide-sublevels 1)))
I've never seen that syntax before -- putting a '1' after a function
that takes no args. Does that just mean 'make it so'? I don't know why
just having hide-sublevels without the '1' won't work.
Thanks Evans.
Bev
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Open Outline-mode file in collapsed state
2008-03-27 19:27 ` bev
@ 2008-03-27 19:48 ` Evans Winner
2008-03-27 21:01 ` bev
2008-03-29 16:12 ` Bastien
0 siblings, 2 replies; 12+ messages in thread
From: Evans Winner @ 2008-03-27 19:48 UTC (permalink / raw)
To: help-gnu-emacs
bev <fbe2@comcast.net> writes:
Yep, a slight variation of your solution works. I now
have in my .emacs:
(add-hook 'outline-mode-hook '(lambda () (hide-sublevels 1)))
Forgot to quote it. Sorry.
I've never seen that syntax before -- putting a '1'
after a function that takes no args. Does that just mean
'make it so'? I don't know why just having
hide-sublevels without the '1' won't work.
`hide-sublevels' used non-interactively actually does take
one argument[1]. Its interactive definition must give it some
way around that, since used interactively it behaves as if
it were passed the argument `1'. I am not sure how it works
after a quick glance.
Footnotes:
[1] The documentation for `hide-sublevels' is:
,----[ C-h f hide-sublevels RET ]
| hide-sublevels is an interactive compiled Lisp function in
| `outline.el'.
|
|
| (hide-sublevels LEVELS)
|
| Hide everything but the top LEVELS levels of headers, in whole buffer.
|
| [back]
`----
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Open Outline-mode file in collapsed state
2008-03-27 19:48 ` Evans Winner
@ 2008-03-27 21:01 ` bev
2008-03-29 16:12 ` Bastien
1 sibling, 0 replies; 12+ messages in thread
From: bev @ 2008-03-27 21:01 UTC (permalink / raw)
To: help-gnu-emacs
On Mar 27, 12:48 pm, Evans Winner <tho...@timbral.net> wrote:
> bev <f...@comcast.net> writes:
>
> Yep, a slight variation of your solution works. I now
> have in my .emacs:
> (add-hook 'outline-mode-hook '(lambda () (hide-sublevels 1)))
>
> Forgot to quote it. Sorry.
>
> I've never seen that syntax before -- putting a '1'
> after a function that takes no args. Does that just mean
> 'make it so'? I don't know why just having
> hide-sublevels without the '1' won't work.
>
> `hide-sublevels' used non-interactively actually does take
> one argument[1]. Its interactive definition must give it some
> way around that, since used interactively it behaves as if
> it were passed the argument `1'. I am not sure how it works
> after a quick glance.
>
> Footnotes:
> [1] The documentation for `hide-sublevels' is:
>
> ,----[ C-h f hide-sublevels RET ]
> | hide-sublevels is an interactive compiled Lisp function in
> | `outline.el'.
> |
> |
> | (hide-sublevels LEVELS)
> |
> | Hide everything but the top LEVELS levels of headers, in whole buffer.
> |
> | [back]
> `----
Ahhhh.... a great light begins to dawn!
Gracias amigo.
Bev
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Open Outline-mode file in collapsed state
2008-03-25 3:28 Open Outline-mode file in collapsed state bev
2008-03-25 3:28 ` Evans Winner
@ 2008-03-29 15:55 ` Bastien
1 sibling, 0 replies; 12+ messages in thread
From: Bastien @ 2008-03-29 15:55 UTC (permalink / raw)
To: bev; +Cc: help-gnu-emacs
bev <fbe2@comcast.net> writes:
> I tried adding (eval-after-load (hide-subtrees)) to the outline-mode-
> hook, but that doesn't work.
(add-hook 'outline-mode-hook 'hide-sublevels)
--
Bastien
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Open Outline-mode file in collapsed state
2008-03-25 3:28 ` Evans Winner
2008-03-26 1:00 ` Xavier Maillard
[not found] ` <mailman.9419.1206495571.18990.help-gnu-emacs@gnu.org>
@ 2008-03-29 15:56 ` Bastien
2 siblings, 0 replies; 12+ messages in thread
From: Bastien @ 2008-03-29 15:56 UTC (permalink / raw)
To: help-gnu-emacs
Evans Winner <thorne@timbral.net> writes:
> I believe you can add the string --
>
> #+STARTUP: overview
>
> -- to the very top of your file. Check the info file:
>
> (info "(org)In-buffer settings")
This is for org-mode, not for outline-mode.
--
Bastien
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Open Outline-mode file in collapsed state
2008-03-27 19:48 ` Evans Winner
2008-03-27 21:01 ` bev
@ 2008-03-29 16:12 ` Bastien
1 sibling, 0 replies; 12+ messages in thread
From: Bastien @ 2008-03-29 16:12 UTC (permalink / raw)
To: Evans Winner; +Cc: help-gnu-emacs
Evans Winner <thorne@timbral.net> writes:
> `hide-sublevels' used non-interactively actually does take
> one argument[1].
Missed that, sorry.
So the right solution is the one you already mentioned:
(add-hook 'outline-mode-hook '(lambda () (hide-sublevels 1)))
Just out of curiosity: using both an (interactive) form and a mandatory
argument looks unclean to me. I would expect an (interactive "s") form
when the first argument is not optional (and is expected to be a string)
or only optional arguments when (interactive) is used.
Is there any clean way to decide on this?
--
Bastien
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2008-03-29 16:12 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-25 3:28 Open Outline-mode file in collapsed state bev
2008-03-25 3:28 ` Evans Winner
2008-03-26 1:00 ` Xavier Maillard
[not found] ` <mailman.9419.1206495571.18990.help-gnu-emacs@gnu.org>
2008-03-27 8:33 ` bev
2008-03-27 14:25 ` Evans Winner
2008-03-27 19:15 ` bev
2008-03-27 19:27 ` bev
2008-03-27 19:48 ` Evans Winner
2008-03-27 21:01 ` bev
2008-03-29 16:12 ` Bastien
2008-03-29 15:56 ` Bastien
2008-03-29 15:55 ` Bastien
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).