unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
Subject: Re: comment-kill and the state of the world
Date: Fri, 24 Oct 2003 19:48:21 GMT	[thread overview]
Message-ID: <jwvsmlipgvc.fsf-monnier+gnu.emacs.help@vor.iro.umontreal.ca> (raw)
In-Reply-To: 87ekx2v9lu.fsf@newsguy.com

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).

But that's the case as well if you call `comment-indent' with a pre-existing
comment, right?  So it's an unrelated bug which comment-padding-foo would
not fix (one I remember fixing a while back, but probably only in
Emacs-CVS).  What was happening is that comment-indent skips the comment
starter and the leading spaces to get to the actual content of the comment,
but with an empty comment, that tends to leave you right before the
commend-end which is not what you want when there's padding.

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.

Believe me I haven't met many people who hate redundancy as much as I do.

> 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.

Feel free to write the patch for it.  It already took significant effort
to get things as they are, such that it all works the way all the major
modes expect it, including using various combinations of comment-start,
comment-end, block-comment-start, block-comment-end, comment-multi-line,
various ways to call auto-fill, ...

And don't forget to come up with a good argument to convince RMS that it's
worth it to change the behavior of comment-indent (he happens to like
code duplication, as odd as it sounds to most of us).

A new pair of eyes will surely help to simplify the code, tho.


        Stefan

  reply	other threads:[~2003-10-24 19:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-16 17:54 comment-kill and the state of the world Ian Zimmerman
2003-10-16 19:11 ` Stefan Monnier
2003-10-17 16:37   ` Ian Zimmerman
2003-10-17 20:01     ` Stefan Monnier
2003-10-18 17:42       ` Ian Zimmerman
2003-10-19 23:14         ` Stefan Monnier
2003-10-23 22:01           ` Ian Zimmerman
2003-10-24 15:41             ` Stefan Monnier
2003-10-24 17:17               ` Ian Zimmerman
2003-10-24 19:48                 ` Stefan Monnier [this message]
2003-10-30 23:59                   ` Ian Zimmerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvsmlipgvc.fsf-monnier+gnu.emacs.help@vor.iro.umontreal.ca \
    --to=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).