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


Message #103 received at 3370 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: "Drew Adams" <drew.adams <at> oracle.com>
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: Re: bug#3370: 23.0.94; `comment-region' indents comment chars  inappropriately
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



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.