[Top][All Lists]

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

Re: comment-kill and the state of the world

From: Ian Zimmerman
Subject: Re: comment-kill and the state of the world
Date: 24 Oct 2003 10:17:17 -0700
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Stefan> Could you explain why you'd want the code to be moved into
Stefan> comment-indent?

The next part of the thread/post.

Ian> Second, do you have any advice for me when I _want_ them to behave
Ian> the same?

Stefan> Which difference are you referring to ?  Since I have trouble
Stefan> understanding your problems, please try to be very precise and
Stefan> concrete.

Ian> Let's say the language's comment delimiters look like this: {- -} .
Ian> I can configure comment-dwim to leave appropriate amount of
Ian> whitespace and put the point in the right place, so the situation
Ian> after an empty comment is inserted looks like this: {- | -} .  But
Ian> that won't affect non-empty lines, because that is handled by
Ian> comment-indent.  And vice versa.

Stefan> By "configure comment-dwim", I assume you mean "configure
Stefan> comment-padding".

Stefan> Note that if you "configure comment-dwim" by changing
Stefan> comment-end and comment-start instead (by setting them to "{- "
Stefan> and " -}" for example), it will work the same way for
Stefan> comment-indent.

I'd tried that.  comment-indent then leaves point in the wrong place
(right before the second hyphen).

Stefan> Sometimes you want it to behave the same in both case, sometimes
Stefan> you want it to behave differently, which is why there are two
Stefan> ways to configure the spacing.  Admittedly, the
Stefan> `comment-padding' way is easier and very different from the
Stefan> other, so it's pretty ugly, but that's the way it worked in
Stefan> Emacs-20, so I had to support it in Emacs-21.  RMS would
Stefan> probably accept a patch for a new config option something like
Stefan> `comment-padding-foo' which would be used for comments on
Stefan> non-empty lines and could be set to nil to mean use the same
Stefan> value as `comment-padding'.  You'd have to come up with a good
Stefan> name for the variable, tho.  It's just that the need hasn't come
Stefan> up yet because configuring comment-start and comment-end works
Stefan> as well in all the actual cases I've come across.

I think it's just sound engineering.  Even if the two branches can be
made to behave the same now, the more they change the harder it will be
to achieve that.

I'll see what I can do regarding the name :-)

reply via email to

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