You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Zack Brown <zb...@tumblerings.org> on 2002/10/31 16:33:26 UTC

what is 'outline mode'?

Hi folks,

In 'IDEAS', it says to use "outline-mode format" in the file, but this
isn't described anywhere. My best guess is that it's an emacs thing.
What should vi users do?

Thanks,
Zack

-- 
Zack Brown

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: what is 'outline mode'?

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Kevin Pilch-Bisson <ke...@pilch-bisson.net> writes:
> The last I proposed it, it was shot down, because the settings would have to
> be in every source file, since vim won't load another file from a modeline
> (for security reasons).  The concern was that if the coding style changed, it
> would require a change to every source file in the repos.
> 
> At this point, can we decide that the coding style is not likely to change
> very much, and add the modelines.  (I'll supply a patch if no one dissents).

+1, and thanks.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: what is 'outline mode'?

Posted by Kevin Pilch-Bisson <ke...@pilch-bisson.net>.
On Thu, Oct 31, 2002 at 07:12:06PM +0000, Philip Martin wrote:
> Kevin Pilch-Bisson <ke...@pilch-bisson.net> writes:
> 
> > The last I proposed it, it was shot down, because the settings would have to
> > be in every source file, since vim won't load another file from a modeline
> > (for security reasons).  The concern was that if the coding style changed, it
> > would require a change to every source file in the repos.
> 
> I don't know much about Vim, but is there a way to use an autocmd to
> recognise a particular pattern in the file, and then execute commands
> from a particular file?
> 
> > At this point, can we decide that the coding style is not likely to change
> > very much, and add the modelines.  (I'll supply a patch if no one dissents).
> 
> This is perfectly reasonable in my view.
> 
Yes, that can be done, but only in a .vim file.  Modelines can't do
autocommands, all they can do is set options directly.  So currently we
provide and svn-dev.vim file for people to source if they choose, but by
adding modelines to the source files, we can just set the coding style to
match, without people having to do anything other than open the file.
-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kevin Pilch-Bisson                    http://www.pilch-bisson.net
     "Historically speaking, the presences of wheels in Unix
     has never precluded their reinvention." - Larry Wall
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Re: what is 'outline mode'?

Posted by Philip Martin <ph...@codematters.co.uk>.
Kevin Pilch-Bisson <ke...@pilch-bisson.net> writes:

> The last I proposed it, it was shot down, because the settings would have to
> be in every source file, since vim won't load another file from a modeline
> (for security reasons).  The concern was that if the coding style changed, it
> would require a change to every source file in the repos.

I don't know much about Vim, but is there a way to use an autocmd to
recognise a particular pattern in the file, and then execute commands
from a particular file?

> At this point, can we decide that the coding style is not likely to change
> very much, and add the modelines.  (I'll supply a patch if no one dissents).

This is perfectly reasonable in my view.

-- 
Philip - writing this using Viper VI emulation in XEmacs

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: what is 'outline mode'?

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Greg Stein <gs...@lyra.org> writes:
> This approach is much better than embedding. In fact, I would prefer a
> similar approach for the Emacs support. I really don't like having to refer
> to svn-dev.el in every single file. I also am not comfortable enabling a
> switch to stop asking me whether it should be loaded or not (don't want an
> emacs virus! :-), so each time I visit a file, I get asked.
> 
> Karl: is there a "visit file" hook of some kind? Can we use that to set the
> modes, rather than the auto loading stuff?

Sure.  I'll write something up tomorrow and post it here.

(I'd like to get that cruft out of the source files too.)

> p.s. "fun GnuStyle()" ... huh? there's nothing fun about the GNU style...
> damned space-before-paren and all that rubbish... :-)

And for you, Greg, I'll write a *special version* of the elisp, which
you're not to examine, only load.

:-)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: what is 'outline mode'?

Posted by Paul Houle <pa...@honeylocust.com>.
Greg Hudson wrote:

>My experience as a programmer is that I started out very opinionated, in
>favor of K&R-style four-space indentation.  When work forced me to
>switch to a slightly modified GNU-style, I found that I quickly became
>agnostic, and rarely wince at code which is internally consistent.
>
>  
>
     Consistency is particularly important if you're using some kind of 
version control.  If people start fighting over indentation (if somebody 
sweeps through files to "fix" bad indentation,)  you end up with ugly 
diffs that don't merge well.  It's important how you indent -- it's 
important that people don't fight over it,  so it makes sense to pick 
some convention and stick to it.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: what is 'outline mode'?

Posted by Greg Hudson <gh...@MIT.EDU>.
On Fri, 2002-11-01 at 06:28, Jani Averbach wrote:
> * wearing my asbestos suit...
> 
> Why on the earth gnu-style has been chosen to default coding style?

There are no compelling objective arguments in favor of a particular
indentation style.  It's maybe a little sad that people couldn't agree
on a single idiom for C programming, but here we are.

At the appropriate time in the project's infancy, most of the developers
preferred GNU style.  Over time, we've decided we want project-wide
consistency on some aspects of style (indentation levels and brace
placement) and file-wide consistency on others (whether you put a space
after the function name, whether you declare multiple variables on the
same line).  This is mostly arbitrary; although there are plenty of
wrong answers when it comes to regulating project style (Fibonacci
sequence indentation levels!), there are lots of acceptable answers.

My experience as a programmer is that I started out very opinionated, in
favor of K&R-style four-space indentation.  When work forced me to
switch to a slightly modified GNU-style, I found that I quickly became
agnostic, and rarely wince at code which is internally consistent.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: what is 'outline mode'?

Posted by Greg Stein <gs...@lyra.org>.
On Fri, Nov 01, 2002 at 08:38:31PM +0200, Jani Averbach wrote:
> On 1 Nov 2002, Karl Fogel wrote:
> > Now, why would you ask a question like that :-) ?
> 
> Heh, the reason is simple: in my humble opinion, gnu style is hard to
> read and hard to understand. Also I haven't seen so many project or code
> space that use gnu-style at the same conviction, so I was intrested
> "why gnu".

"at the same convication" ? I think that didn't translate well :-)  Do you
mean "with such consistency throughout the entire codebase?"  If so, well
that is just because we all believe quite strongly in a uniform format, we
chose a format before starting, and since all the code is new, we were able
to consistently use that while we developed the code.

> > The same question could be asked with any style substituted for
> > "gnu-".
>...
> there have to be some conventions. I was just curious what were those
> points to chose gnu-style.

Stylistic conventions are mostly subjective. It is very difficult to have
"points" to support or detract from any given style. What is a benefit in
the eyes of one person is a drawback to the other.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: what is 'outline mode'?

Posted by Jani Averbach <ja...@cc.jyu.fi>.
On 1 Nov 2002, Karl Fogel wrote:

>
> Now, why would you ask a question like that :-) ?
>

Heh, the reason is simple: in my humble opinion, gnu style is hard to
read and hard to understand. Also I haven't seen so many project or code
space that use gnu-style at the same conviction, so I was intrested
"why gnu".

>
> The same question could be asked with any style substituted for
> "gnu-".
>

Yes that is absolutely true, and I don't have intention to start flame
war, or try evangelize people, I understand that for overal readability
there have to be some conventions. I was just curious what were those
points to chose gnu-style. For me it is not obvious choice, and it is
always intresting to heard opposite opinions, you could learn something if
you keep your mind open.


BR, Jani

--
Jani Averbach


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: what is 'outline mode'?

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Jani Averbach <ja...@cc.jyu.fi> writes:
> * wearing my asbestos suit...
> 
> Why on the earth gnu-style has been chosen to default coding style?

Now, why would you ask a question like that :-) ?  The same question
could be asked with any style substituted for "gnu-".  People's tastes
differ.

Anyway, the answer is that a significant majority of developers (at
the time) preferred it.  I don't know if it's still a majority,
though, let alone a significant one.

(Note that we're not strictly gnu-style.  We've made an exception for
what is probably the most controversial element of gnu-style, the
space-before-open-paren thing.  We try to keep each file consistent,
but within that, it's up to whoever wrote the initial bulk of code.)

HTH,
-K

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: what is 'outline mode'?

Posted by Jani Averbach <ja...@cc.jyu.fi>.
On Thu, 31 Oct 2002, Greg Stein wrote:

>
> p.s. "fun GnuStyle()" ... huh? there's nothing fun about the GNU style...
> damned space-before-paren and all that rubbish... :-)
>

* wearing my asbestos suit...

Why on the earth gnu-style has been chosen to default coding style?


BR, Jani

--
Jani Averbach


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: what is 'outline mode'?

Posted by Greg Stein <gs...@lyra.org>.
On Thu, Oct 31, 2002 at 03:51:31PM -0600, Scott Lamb wrote:
>...
> An alternative might be to suggest .vimrc settings that apply only to 
> the Subversion directory. I have something like this:
> 
> fun GnuStyle()
>     setlocal cinoptions={.5s,:.5s,+.5s,t0,g0,^-2,e-2,n-2,p2s,(0,=.5s
>     setlocal formatoptions=croql cindent sw=4 ts=8 expandtab
> endfun
> autocmd BufRead,BufNewFile */subversion/*.[ch]  call GnuStyle()
> 
> the GnuStyle function stolen from <http://www.zellner.org/vim/vimrc>.
> 
> That's not as good for special cases like the outline file. There, I 
> think embedding the modelines would be best.

This approach is much better than embedding. In fact, I would prefer a
similar approach for the Emacs support. I really don't like having to refer
to svn-dev.el in every single file. I also am not comfortable enabling a
switch to stop asking me whether it should be loaded or not (don't want an
emacs virus! :-), so each time I visit a file, I get asked.

Karl: is there a "visit file" hook of some kind? Can we use that to set the
modes, rather than the auto loading stuff?

Cheers,
-g

p.s. "fun GnuStyle()" ... huh? there's nothing fun about the GNU style...
damned space-before-paren and all that rubbish... :-)

-- 
Greg Stein, http://www.lyra.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: what is 'outline mode'?

Posted by Scott Lamb <sl...@slamb.org>.
Kevin Pilch-Bisson wrote:

>The last I proposed it, it was shot down, because the settings would have to
>be in every source file, since vim won't load another file from a modeline
>(for security reasons).  The concern was that if the coding style changed, it
>would require a change to every source file in the repos.
>
An alternative might be to suggest .vimrc settings that apply only to 
the Subversion directory. I have something like this:

fun GnuStyle()
    setlocal cinoptions={.5s,:.5s,+.5s,t0,g0,^-2,e-2,n-2,p2s,(0,=.5s
    setlocal formatoptions=croql cindent sw=4 ts=8 expandtab
endfun
autocmd BufRead,BufNewFile */subversion/*.[ch]  call GnuStyle()

the GnuStyle function stolen from <http://www.zellner.org/vim/vimrc>.

That's not as good for special cases like the outline file. There, I 
think embedding the modelines would be best.

Scott


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: what is 'outline mode'?

Posted by Kevin Pilch-Bisson <ke...@pilch-bisson.net>.
On Thu, Oct 31, 2002 at 12:13:16PM -0600, Karl Fogel wrote:
> Kevin Pilch-Bisson <ke...@pilch-bisson.net> writes:
> > Vim6 can do the same sorts of things, only it's called folding.  Try :help
> > folding for an idea of how to set it up.
> > 
> > I'd still REALLY like to start getting some vim modelines into our files.
> 
> Sure.
> 
> > Why should vim users be relegated to second class just because the CN folks
> > use emacs?
> 
> Exactly -- they shouldn't.  So if you provide a patch, we can have vi
> modelines in our files.  (It's not like anyone's been rejecting such
> patches, either.  There weren't any to reject, as far as I know.)
> 
The last I proposed it, it was shot down, because the settings would have to
be in every source file, since vim won't load another file from a modeline
(for security reasons).  The concern was that if the coding style changed, it
would require a change to every source file in the repos.

At this point, can we decide that the coding style is not likely to change
very much, and add the modelines.  (I'll supply a patch if no one dissents).
-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kevin Pilch-Bisson                    http://www.pilch-bisson.net
     "Historically speaking, the presences of wheels in Unix
     has never precluded their reinvention." - Larry Wall
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Re: what is 'outline mode'?

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Kevin Pilch-Bisson <ke...@pilch-bisson.net> writes:
> Vim6 can do the same sorts of things, only it's called folding.  Try :help
> folding for an idea of how to set it up.
> 
> I'd still REALLY like to start getting some vim modelines into our files.

Sure.

> Why should vim users be relegated to second class just because the CN folks
> use emacs?

Exactly -- they shouldn't.  So if you provide a patch, we can have vi
modelines in our files.  (It's not like anyone's been rejecting such
patches, either.  There weren't any to reject, as far as I know.)

-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: what is 'outline mode'?

Posted by Kevin Pilch-Bisson <ke...@pilch-bisson.net>.
On Thu, Oct 31, 2002 at 11:41:23AM -0500, Paul Lussier wrote:
> In a message dated: Thu, 31 Oct 2002 08:33:26 PST
> Zack Brown said:
> 
> >Hi folks,
> >
> >In 'IDEAS', it says to use "outline-mode format" in the file, but this
> >isn't described anywhere. My best guess is that it's an emacs thing.
> 
> It is.
> 
> >What should vi users do?
> 
> Use Emacs :)
> 
> Seriously, you should be able to view the file just fine.  The only 
> thing the Emacs outline-mode does is allow you to do things like 
> collapse and expand the various sections.
> 
> For example, you'll see things like:
> 
> 	* Header 1
> 	some text
> 	** Header 2
> 	some other text
> 	*** Header 3
> 	a bunch of text
> 	more text
> 
> outline mode will allow you to collapse all the '***' levels if you 
> want so that you only see:
> 	* Header 1
> 	some text
> 	** Header 2
> 	some other text
> 	*** Header 3 ...
> 
> It's just a more convenient way to write things in outline mode for 
> Emacs users.  The resultant file is still 100% plain ascii text, and 
> doesn't look any different regardless of what editor you use.  It's 
> the outline-mode macro which makes things look different based on the 
> '*' prefix of lines.
> 
Vim6 can do the same sorts of things, only it's called folding.  Try :help
folding for an idea of how to set it up.

I'd still REALLY like to start getting some vim modelines into our files.

Why should vim users be relegated to second class just because the CN folks
use emacs?
-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kevin Pilch-Bisson                    http://www.pilch-bisson.net
     "Historically speaking, the presences of wheels in Unix
     has never precluded their reinvention." - Larry Wall
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Re: what is 'outline mode'?

Posted by Rafael Garcia-Suarez <rg...@free.fr>.
Paul Lussier <pl...@lanminds.com> wrote:
> Seriously, you should be able to view the file just fine.  The only 
> thing the Emacs outline-mode does is allow you to do things like 
> collapse and expand the various sections.

For what it's worth, vim 6.x supports something like this, except
it's called "folding".

For example this simplistic setting might be useful :
  set foldmethod=expr
  set foldexpr=getline(v:lnum)=~'^$'&&getline(v:lnum+1)=~'^\\*'?'<1':1
altough it doesn't do nested sections.
With a little bit of tweaking in one's ~/.vimrc, this
could even be set by default on all files where the first line
contains "-*- outline -*-". In fact this is likely to have been done
before.

But IIRC foldexpr can't be set from a modeline -- emacs has to be better
for something. :-)

> For example, you'll see things like:
> 
> 	* Header 1
> 	some text
> 	** Header 2
> 	some other text
> 	*** Header 3
> 	a bunch of text
> 	more text
> 
> outline mode will allow you to collapse all the '***' levels if you 
> want so that you only see:
> 	* Header 1
> 	some text
> 	** Header 2
> 	some other text
> 	*** Header 3 ...
> 
> It's just a more convenient way to write things in outline mode for 
> Emacs users.  The resultant file is still 100% plain ascii text, and 
> doesn't look any different regardless of what editor you use.  It's 
> the outline-mode macro which makes things look different based on the 
> '*' prefix of lines.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

PATCH: Re: what is 'outline mode'?

Posted by Zack Brown <zb...@tumblerings.org>.
On Thu, Oct 31, 2002 at 11:41:23AM -0500, Paul Lussier wrote:
> In a message dated: Thu, 31 Oct 2002 08:33:26 PST
> Zack Brown said:
> 
> >In 'IDEAS', it says to use "outline-mode format" in the file, but this
> >isn't described anywhere. My best guess is that it's an emacs thing.
> 
> It is.
> 
> >What should vi users do?
> 
> Use Emacs :)
> 
> Seriously, you should be able to view the file just fine.  The only 
> thing the Emacs outline-mode does is allow you to do things like 
> collapse and expand the various sections.

OK, cool. Maybe this should be explained in the file though.

Log Message:
Added a paragraph at the top of the file, explaining how to conform to emacs
outline mode. Patch from Zack Brown <zb...@tumblerings.org>

Index: IDEAS
===================================================================
--- IDEAS
+++ IDEAS	2002-10-31 09:09:24.000000000 -0800
@@ -1,7 +1,12 @@
    Oh Most High and Puissant Emacs, please be in -*- outline -*- mode!
 
+When modifying this file with emacs or any other editor, please conform to
+emacs' outline-mode format, i.e. use '*' as the first character on a line,
+to indicate the start of a new section. The rest of the text on that line
+will be considered the title of that section. Subsections can be indicated
+by '**', sub-sub-sections by '***', and so on.
+
 Some ideas for the future.
-(Please use outline-mode format for this file.)
 
 * todo: move the ideas in doc/programmer/design/future.texi to here
 

> HTH,
> -- 
> 
> Seeya,
> Paul
> --
> 	It may look like I'm just sitting here doing nothing,
>    but I'm really actively waiting for all my problems to go away.
> 
> 	 If you're not having fun, you're not doing it right!
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org
> 

-- 
Zack Brown

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: what is 'outline mode'?

Posted by Paul Lussier <pl...@lanminds.com>.
In a message dated: Thu, 31 Oct 2002 08:33:26 PST
Zack Brown said:

>Hi folks,
>
>In 'IDEAS', it says to use "outline-mode format" in the file, but this
>isn't described anywhere. My best guess is that it's an emacs thing.

It is.

>What should vi users do?

Use Emacs :)

Seriously, you should be able to view the file just fine.  The only 
thing the Emacs outline-mode does is allow you to do things like 
collapse and expand the various sections.

For example, you'll see things like:

	* Header 1
	some text
	** Header 2
	some other text
	*** Header 3
	a bunch of text
	more text

outline mode will allow you to collapse all the '***' levels if you 
want so that you only see:
	* Header 1
	some text
	** Header 2
	some other text
	*** Header 3 ...

It's just a more convenient way to write things in outline mode for 
Emacs users.  The resultant file is still 100% plain ascii text, and 
doesn't look any different regardless of what editor you use.  It's 
the outline-mode macro which makes things look different based on the 
'*' prefix of lines.

HTH,
-- 

Seeya,
Paul
--
	It may look like I'm just sitting here doing nothing,
   but I'm really actively waiting for all my problems to go away.

	 If you're not having fun, you're not doing it right!



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: what is 'outline mode'?

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Zack Brown <zb...@tumblerings.org> writes:
> In 'IDEAS', it says to use "outline-mode format" in the file, but this
> isn't described anywhere. My best guess is that it's an emacs thing.
> What should vi users do?

Well, the format can be used by any editor.  Emacs happens to have
special support for it; maybe vi does too, I don't know.

Just follow the file format intuitively.  It uses `*' to indicate
heading levels.  More `*'s means deeper nesting (so a single star is
the highest heading level).

   * This is Heading A
   
     some text
   
   ** This is a sub-heading inside section A
   
     some more text
   
   *** This is a sub-sub-heading inside the first sub-heading above
   *** So is this
   
   * This is Heading B
   

...and so on

-K

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org