Subject: bug#3370: 23.0.94; `comment-region' indents comment chars inappropriately

From: Stefan Monnier <[email-masked]>
Date: Mon, 25 May 2009 17:22:02 -0400

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

If you use comment-region in such places, the result should also be at
column-0, AFAIK.

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

Then I misunderstood your use case.  Please give a recipe.  Normally,
code at top-level should have some part of it in column-0, so the
resulting commented-out version should also be placed at column-0.

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

Good.

> This is about commenting out a region, however, not about inserting
> a comment at the current indentation level.

Yes, I know that.

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

I know.  Yet, most cases of commented-out code would use

    ;; `abcdef'

Obviously, you don't like it, just like Richard doesn't like it.  I do
believe you're in the minority, tho.

        Stefan