GNU bug report logs - #3370
23.0.94; `comment-region' indents comment chars inappropriately

Previous Next

Package: emacs;

Reported by: "Drew Adams" <drew.adams <at> oracle.com>

Date: Sun, 24 May 2009 22:40:04 UTC

Severity: wishlist

Tags: wontfix

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: "Drew Adams" <drew.adams <at> oracle.com>
To: "'Stefan Monnier'" <monnier <at> iro.umontreal.ca>
Cc: <3370 <at> debbugs.gnu.org>,
        "'Chong Yidong'" <cyd <at> stupidchicken.com>,
        "'Jason Rumney'" <jasonr <at> gnu.org>,
        "'Dan Nicolaescu'" <dann <at> ics.uci.edu>, <rms <at> gnu.org>
Subject: bug#3370: 23.0.94; `comment-region' indents comment chars  inappropriately
Date: Mon, 25 May 2009 10:42:05 -0700
> Emacs put the comment-starters at column-0 because that code 
> was written a looooonnng time ago and keeping things simple
> was more important than now.

Emacs Lisp files still use ;; in column 0 in file headers, AFAICT. What column
would you prefer to indent them to?

That is exactly the use case here: commenting a line that will be in a file
header. There is nothing in the surrounding code that would indicate an
indentation level (other than 0 indent).

> Emacs-21's new commenting code was improved to be able to
> comment and uncomment at other columns than column-0, 

I have no problem with that.

> which made it more useful since most commenting styles use
> other indentation styles.

No idea what that means. Please define "commenting style" and "indentation
style" or otherwise explain what you're trying to say here.

> Emacs-21's default (as well as 22) was set to `plain' because Richard
> always puts such comments at column-0 (the `plain' setting 
> had actually to be added specifically for this).

Well I don't always put "such comments" (depending on what you mean by that) at
column 0. I put `;;' comments where Emacs has always put them: at the same level
of indentation that TAB puts code.

This is about commenting out a region, however, not about inserting a comment at
the current indentation level. Commenting out this line:

  `abcdef'

gives this, prior to Emacs 23:

;;   `abcdef'

Commenting out the line is different from inserting a comment at the same level:

  ;;
  `abcdef'

> If you don't like it, just (setq comment-style 'plain) and 
> live happily ever after.

Done (just let-bound in the pertinent code context). That's all I needed.

I would prefer, however, to _understand_, by getting some information about
`comment-style', `comment-styles', etc. Please document `comment-style' and the
rest of what might be missing. Please document this change in NEWS also.

Thx.





This bug report was last modified 13 years and 94 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.