GNU bug report logs -
#3370
23.0.94; `comment-region' indents comment chars inappropriately
Previous Next
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.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 3370 in the body.
You can then email your comments to 3370 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#3370
; Package
emacs
.
(Sun, 24 May 2009 22:40:04 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
"Drew Adams" <drew.adams <at> oracle.com>
:
New bug report received and forwarded. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Sun, 24 May 2009 22:40:04 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):
emacs -Q
In buffer *scratch*, type this: SPC SPC ` a b c d e f ' RET
That inserts this line, followed by a newline:
`abcdef'
Select the line, including the newline at its end: `M-< C-SPC C-n'.
M-x comment-region
In Emacs 23, this is the result:
;; `abcdef'
In all previous versions of Emacs, the comment chars are inserted at
the start of the line - they are not indented two spaces:
;; `abcdef'
This is so for Emacs 20, 21, and 22. (Though in Emacs 20 only one
semicolon is used.)
This breaks any code that depends on the traditional behavior. For
instance, I have code that updates file-header lines, and now, instead
of this:
;; Features that might be required by this library:
;;
;; `abcdef', `ghijk', `lmnop'.
;;
I get this;
;; Features that might be required by this library:
;;
;; `abcdef', `ghijk', `lmnop'.
;;
I need this code to work in all Emacs versions. I certainly hope you
do not consider this change to be a feature instead of a bug.
In GNU Emacs 23.0.94.1 (i386-mingw-nt5.1.2600)
of 2009-05-24 on SOFT-MJASON
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4)'
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#3370
; Package
emacs
.
(Sun, 24 May 2009 23:40:07 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Chong Yidong <cyd <at> stupidchicken.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Sun, 24 May 2009 23:40:08 GMT)
Full text and
rfc822 format available.
Message #10 received at 3370 <at> emacsbugs.donarmstrong.com (full text, mbox):
> In buffer *scratch*, type this: SPC SPC ` a b c d e f ' RET
>
> Select the line, including the newline at its end: `M-< C-SPC C-n'.
> M-x comment-region
>
> In Emacs 23, this is the result:
>
> ;; `abcdef'
>
> In all previous versions of Emacs, the comment chars are inserted at
> the start of the line - they are not indented two spaces
Wrong. The behavior is identical in Emacs 22.
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#3370
; Package
emacs
.
(Mon, 25 May 2009 00:00:05 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
"Drew Adams" <drew.adams <at> oracle.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Mon, 25 May 2009 00:00:05 GMT)
Full text and
rfc822 format available.
Message #15 received at 3370 <at> emacsbugs.donarmstrong.com (full text, mbox):
> From: Chong Yidong Sent: Sunday, May 24, 2009 4:32 PM
> > In buffer *scratch*, type this: SPC SPC ` a b c d e f ' RET
> >
> > Select the line, including the newline at its end: `M-< C-SPC C-n'.
> > M-x comment-region
> >
> > In Emacs 23, this is the result:
> >
> > ;; `abcdef'
> >
> > In all previous versions of Emacs, the comment chars are inserted at
> > the start of the line - they are not indented two spaces
>
> Wrong. The behavior is identical in Emacs 22.
You are absolutely incorrect.
I just did it again, in `emacs -Q' in 22.3:
GNU Emacs 22.3.1 (i386-mingw-nt5.1.2600)
of 2008-09-06 on SOFT-MJASON
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4)'
The result is, exactly as I stated:
;; `abcdef'
Please do not reply that way, without even trying the recipe. It doesn't help.
Let me repeat the instructions differently, just so you are clear. Insert this
text at the beginning of *scratch*: " `abcdef'". Follow that by hitting RET to
insert a newline.
Put point at bob and hit C-SPC to set mark. Use C-n to move past the inserted
line.
Do M-x comment-region
You will *NOT* see this in Emacs 22 (or 21 or 20 or ...):
;; `abcdef'
You WILL see this in Emacs 22:
;; `abcdef'
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#3370
; Package
emacs
.
(Mon, 25 May 2009 00:10:06 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Lennart Borgman <lennart.borgman <at> gmail.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Mon, 25 May 2009 00:10:06 GMT)
Full text and
rfc822 format available.
Message #20 received at 3370 <at> emacsbugs.donarmstrong.com (full text, mbox):
On Mon, May 25, 2009 at 1:31 AM, Chong Yidong <cyd <at> stupidchicken.com> wrote:
>> In buffer *scratch*, type this: SPC SPC ` a b c d e f ' RET
>>
>> Select the line, including the newline at its end: `M-< C-SPC C-n'.
>> M-x comment-region
>>
>> In Emacs 23, this is the result:
>>
>> ;; `abcdef'
>>
>> In all previous versions of Emacs, the comment chars are inserted at
>> the start of the line - they are not indented two spaces
>
> Wrong. The behavior is identical in Emacs 22.
Are you sure? I never noticed it there.
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#3370
; Package
emacs
.
(Mon, 25 May 2009 00:55:09 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Chong Yidong <cyd <at> stupidchicken.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Mon, 25 May 2009 00:55:09 GMT)
Full text and
rfc822 format available.
Message #25 received at 3370 <at> emacsbugs.donarmstrong.com (full text, mbox):
> > In buffer *scratch*, type this: SPC SPC ` a b c d e f ' RET
> >
> > Select the line, including the newline at its end: `M-< C-SPC C-n'.
> > M-x comment-region
> >
> > In Emacs 23, this is the result:
> >
> > ;; `abcdef'
> >
> > In all previous versions of Emacs, the comment chars are inserted at
> > the start of the line - they are not indented two spaces
> Wrong. The behavior is identical in Emacs 22.
Aha, I was mistaken. Sorry for the confusion.
The default for `comment-style' has been changed, it is no longer
`plain'. See Richard's 2007-10-26 changing it to `indent-or-tripe', and
Dan's 2008-12-18 change making it `indent' (Bug#1153).
This should have been documented in NEWS; I'll do that.
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#3370
; Package
emacs
.
(Mon, 25 May 2009 01:35:04 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Jason Rumney <jasonr <at> gnu.org>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Mon, 25 May 2009 01:35:04 GMT)
Full text and
rfc822 format available.
Message #30 received at 3370 <at> emacsbugs.donarmstrong.com (full text, mbox):
Chong Yidong wrote:
> Aha, I was mistaken. Sorry for the confusion.
>
> The default for `comment-style' has been changed, it is no longer
> `plain'. See Richard's 2007-10-26 changing it to `indent-or-tripe', and
> Dan's 2008-12-18 change making it `indent' (Bug#1153).
>
> This should have been documented in NEWS; I'll do that.
>
Or perhaps it would have been better putting it back to plain if
Richard's new indent-or-triple option was found to not be a suitable
default. I'm not sure that Dan looked into the history when he changed
it to indent.
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#3370
; Package
emacs
.
(Mon, 25 May 2009 02:15:03 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
"Drew Adams" <drew.adams <at> oracle.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Mon, 25 May 2009 02:15:04 GMT)
Full text and
rfc822 format available.
Message #35 received at 3370 <at> emacsbugs.donarmstrong.com (full text, mbox):
> > Aha, I was mistaken. Sorry for the confusion.
> >
> > The default for `comment-style' has been changed, it is no longer
> > `plain'. See Richard's 2007-10-26 changing it to
> > `indent-or-tripe', and Dan's 2008-12-18 change making it
> > `indent' (Bug#1153).
> >
> > This should have been documented in NEWS; I'll do that.
>
> Or perhaps it would have been better putting it back to plain if
> Richard's new indent-or-triple option was found to not be a suitable
> default. I'm not sure that Dan looked into the history when
> he changed it to indent.
Please restore the traditional behavior.
A mere doc change does not cut the mustard.
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#3370
; Package
emacs
.
(Mon, 25 May 2009 04:55:07 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Chong Yidong <cyd <at> stupidchicken.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Mon, 25 May 2009 04:55:08 GMT)
Full text and
rfc822 format available.
Message #40 received at 3370 <at> emacsbugs.donarmstrong.com (full text, mbox):
Jason Rumney <jasonr <at> gnu.org> writes:
> Or perhaps it would have been better putting it back to plain if
> Richard's new indent-or-triple option was found to not be a suitable
> default. I'm not sure that Dan looked into the history when he
> changed it to indent.
Maybe. Could Dan or Richard weigh in on this?
Personally, all else being equal, I think `indent' is a better comment
style. For instance, all the Emacs sources use that style.
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#3370
; Package
emacs
.
(Mon, 25 May 2009 05:35:04 GMT)
Full text and
rfc822 format available.
Message #43 received at 3370 <at> emacsbugs.donarmstrong.com (full text, mbox):
Jason Rumney <jasonr <at> gnu.org> writes:
> Chong Yidong wrote:
> > Aha, I was mistaken. Sorry for the confusion.
> >
> > The default for `comment-style' has been changed, it is no longer
> > `plain'. See Richard's 2007-10-26 changing it to `indent-or-tripe', and
> > Dan's 2008-12-18 change making it `indent' (Bug#1153).
> >
> > This should have been documented in NEWS; I'll do that.
> >
>
> Or perhaps it would have been better putting it back to plain if
> Richard's new indent-or-triple option was found to not be a suitable
> default. I'm not sure that Dan looked into the history when he
> changed it to indent.
I am quite sure I did.
'indent was also the preference of the person that wrote the new
incarnation of the region indent code and who explicitly approved the
change: Stefan.
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#3370
; Package
emacs
.
(Mon, 25 May 2009 07:10:06 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
"Drew Adams" <drew.adams <at> oracle.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Mon, 25 May 2009 07:10:06 GMT)
Full text and
rfc822 format available.
Message #48 received at 3370 <at> emacsbugs.donarmstrong.com (full text, mbox):
> > Or perhaps it would have been better putting it back to plain if
> > Richard's new indent-or-triple option was found to not be a suitable
> > default. I'm not sure that Dan looked into the history when he
> > changed it to indent.
>
> Maybe. Could Dan or Richard weigh in on this?
>
> Personally, all else being equal,
Why would everything else be equal? What's wrong with considering what Emacs has
always done, and perhaps even thinking about breaking existing code (such as
what I reported)? Everything else is not equal.
> I think `indent' is a better comment
> style. For instance, all the Emacs sources use that style.
I don't know what `comment-style' is, so it's difficult for me to discuss it.
There is no doc for it that explains anything - see bug #2271.
What do you mean by "all the Emacs sources use that style"? I was guessing from
your previous mail that `comment-style' somehow controls `comment-region' (which
is what this bug report is about), which performs an action. How can static
source code be said to "use that style"?
If you are referring to ;; always being indented instead of starting a line
(which is not what I reported about), then no, there are plenty of source code
lines that start with ;; - in file headers, for instance.
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#3370
; Package
emacs
.
(Mon, 25 May 2009 07:10:08 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
"Drew Adams" <drew.adams <at> oracle.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Mon, 25 May 2009 07:10:08 GMT)
Full text and
rfc822 format available.
Message #53 received at 3370 <at> emacsbugs.donarmstrong.com (full text, mbox):
> 'indent was also the preference of the person that wrote the new
> incarnation of the region indent code and who explicitly approved the
> change: Stefan.
`comment-region' is not, or at least was not, about indenting. It is about
commenting out the code in the region.
There is nothing in the Elisp manual about `comment-region'. What there is about
it in the Emacs manual does not mention at all how it affects indenting or is
affected by indenting, and it does not mention `comment-style' at all.
The only mention of indenting in a node that talks also about `comment-region'
is the mention that lines with multiple comment delimiters can sometimes be
indented differently, depending on the number of comment delimiters. That has
always been the case in Emacs (;;; vs ;; vs ; - indented differently by TAB or
C-M-q etc.). Previously, there was no relation between `comment-region' and
indenting, AFAIK. And there is still no documented relation, that I can find.
Finally, the doc string for `comment-region' still says exactly what it said for
Emacs 22. And it says that it comments (or uncomments) "each line" in the
region. Not just some text in the line, starting after some whitespace, but the
(whole) line. And it says nothing about indenting the commented line.
And it says, "By default, comments start at the left margin". Admittedly, that
is vague and could be interpreted to mean different things. But there is
definitely no mention that `comment-region' indents lines that it comments, that
is, that it produces an indented comment.
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#3370
; Package
emacs
.
(Mon, 25 May 2009 21:30:12 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
"Drew Adams" <drew.adams <at> oracle.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Mon, 25 May 2009 21:30:12 GMT)
Full text and
rfc822 format available.
Message #58 received at 3370 <at> emacsbugs.donarmstrong.com (full text, mbox):
> 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.
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#3370
; Package
emacs
.
(Mon, 25 May 2009 21:30:13 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Stefan Monnier <monnier <at> iro.umontreal.ca>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Mon, 25 May 2009 21:30:14 GMT)
Full text and
rfc822 format available.
Message #63 received at 3370 <at> emacsbugs.donarmstrong.com (full text, mbox):
> C-M-q etc.). Previously, there was no relation between
> `comment-region' and indenting, AFAIK. And there is still no
> documented relation, that I can find.
And indeed, there isn't. The new style just preserves the indentation
that's present when you call comment-region. It doesn't use the
indentation code.
Stefan
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#3370
; Package
emacs
.
(Mon, 25 May 2009 21:30:26 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
"Drew Adams" <drew.adams <at> oracle.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Mon, 25 May 2009 21:30:26 GMT)
Full text and
rfc822 format available.
Message #68 received at 3370 <at> emacsbugs.donarmstrong.com (full text, mbox):
> > Why would everything else be equal? What's wrong with
> > considering what Emacs has always done, and perhaps even
> > thinking about breaking existing code (such as what I
> > reported)? Everything else is not equal.
>
> Obviously. But if changing the default provides significantly better
> behavior, there is case for doing it anyway. My point is that this
> default is indeed better.
Are you aware that you provide no reasons for your assertion that it "is indeed
better"? Better how? Why? For whom? In what contexts?
> >> I think `indent' is a better comment style. For instance, all the
> >> Emacs sources use that style.
> >
> > If you are referring to ;; always being indented instead of
> > starting a line (which is not what I reported about), then no,
> > there are plenty of source code lines that start with ;; -
> > in file headers, for instance.
>
> The overwhelming majority of commented lines are indented, including
> file headers, which are indented to top-level (column 0).
Indented to column 0? Are you just trying to win an argument? Sure, then
everything in the universe is indented. If you count no-op indentation as
indentation, then the third policeman going up the middle elevator is indented.
So far, you have provided zero content for this thread, AFAICT.
And we still have no definition of "comment style" or `comment-style'...
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#3370
; Package
emacs
.
(Mon, 25 May 2009 21:35:07 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Stefan Monnier <monnier <at> iro.umontreal.ca>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Mon, 25 May 2009 21:35:07 GMT)
Full text and
rfc822 format available.
Message #73 received at 3370 <at> emacsbugs.donarmstrong.com (full text, mbox):
> Why would everything else be equal? What's wrong with considering what
> Emacs has always done, and perhaps even thinking about breaking
> existing code (such as what I reported)? Everything else is not equal.
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-21's new commenting code was improved to be able to
comment and uncomment at other columns than column-0, which made it more
useful since most commenting styles use other indentation styles.
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).
If you don't like it, just (setq comment-style 'plain) and live happily
ever after.
Stefan
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#3370
; Package
emacs
.
(Mon, 25 May 2009 21:50:04 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Chong Yidong <cyd <at> stupidchicken.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Mon, 25 May 2009 21:50:04 GMT)
Full text and
rfc822 format available.
Message #78 received at 3370 <at> emacsbugs.donarmstrong.com (full text, mbox):
"Drew Adams" <drew.adams <at> oracle.com> writes:
> Why would everything else be equal? What's wrong with considering what
> Emacs has always done, and perhaps even thinking about breaking
> existing code (such as what I reported)? Everything else is not equal.
Obviously. But if changing the default provides significantly better
behavior, there is case for doing it anyway. My point is that this
default is indeed better.
>> I think `indent' is a better comment style. For instance, all the
>> Emacs sources use that style.
>
> If you are referring to ;; always being indented instead of starting a
> line (which is not what I reported about), then no, there are plenty
> of source code lines that start with ;; - in file headers, for
> instance.
The overwhelming majority of commented lines are indented, including
file headers, which are indented to top-level (column 0).
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#3370
; Package
emacs
.
(Mon, 25 May 2009 21:55:05 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Chong Yidong <cyd <at> stupidchicken.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Mon, 25 May 2009 21:55:05 GMT)
Full text and
rfc822 format available.
Message #83 received at 3370 <at> emacsbugs.donarmstrong.com (full text, mbox):
"Drew Adams" <drew.adams <at> oracle.com> writes:
> Finally, the doc string for `comment-region' still says exactly what
> it said for Emacs 22.
I will fix this.
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#3370
; Package
emacs
.
(Mon, 25 May 2009 22:00:05 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
"Drew Adams" <drew.adams <at> oracle.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Mon, 25 May 2009 22:00:05 GMT)
Full text and
rfc822 format available.
Message #88 received at 3370 <at> emacsbugs.donarmstrong.com (full text, mbox):
> 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'
No, that was not an example of commenting-out code. It was an example of
inserting a comment - as I said.
> Obviously, you don't like it, just like Richard doesn't like it. I do
> believe you're in the minority, tho.
No, you're mistaken. I don't really care one way or the other about it.
The information that was missing (and is still missing) is about `comment-style'
and `comment-styles'. You gave me a solution for the code I have, but still no
explanation of `comment-style'. There is still no doc for it.
I don't need to use a different value of `comment-style' for my own use
interactively - I don't really care whether the commented lines are indented or
not. (At least I don't have a preference at the moment.) My question was about
use of `comment-region' in code, not interactively. See the original bug
report's use case.
The real bug I guess is that there is no explanation of `comment-style'.
Whenever things like this change, there is the potential (almost the certainty)
that existing code will break, as it did in my case. My real need, I came to
realize here, is not that `comment-region' act, by default, as it did before,
but that I know how to fix the broken code due to its behavior change. The
answer was to bind `comment-style', as you suggested.
But there is no explanation, hence no understanding, of that answer - no doc for
`comment-style'. And, as I said, the doc string for `comment-style' (which is
pretty much useless) refers to `comment-styles', which is not recognized (and
therefore has no link).
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#3370
; Package
emacs
.
(Mon, 25 May 2009 22:30:06 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Stefan Monnier <monnier <at> iro.umontreal.ca>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Mon, 25 May 2009 22:30:06 GMT)
Full text and
rfc822 format available.
Message #93 received at 3370 <at> emacsbugs.donarmstrong.com (full text, mbox):
The comment-syle was changed to `indent' because experience shows it to
be closer to the style used by most people. But yes, thanks for
pointing out the fact that it was poorly mentioned in NEWS.
Stefan
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#3370
; Package
emacs
.
(Mon, 25 May 2009 22:55:05 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Jason Rumney <jasonr <at> gnu.org>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Mon, 25 May 2009 22:55:05 GMT)
Full text and
rfc822 format available.
Message #98 received at 3370 <at> emacsbugs.donarmstrong.com (full text, mbox):
Stefan Monnier wrote:
> Obviously, you don't like it, just like Richard doesn't like it. I do
> believe you're in the minority, tho.
>
I don't think we can say that without polling the users. FWIW, I prefer
commented out code (as opposed to standard comments) to have plain
style, and 99% of my use of comment-region would be to comment code. For
the other 1%, there is indent-region.
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#3370
; Package
emacs
.
(Mon, 25 May 2009 23:10:06 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Stefan Monnier <monnier <at> IRO.UMontreal.CA>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Mon, 25 May 2009 23:10:06 GMT)
Full text and
rfc822 format available.
Message #103 received at 3370 <at> emacsbugs.donarmstrong.com (full text, mbox):
>> 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
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#3370
; Package
emacs
.
(Tue, 26 May 2009 01:25:07 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Stefan Monnier <monnier <at> iro.umontreal.ca>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Tue, 26 May 2009 01:25:08 GMT)
Full text and
rfc822 format available.
Message #108 received at 3370 <at> emacsbugs.donarmstrong.com (full text, mbox):
>> Obviously, you don't like it, just like Richard doesn't like it. I do
>> believe you're in the minority, tho.
> I don't think we can say that without polling the users.
It's based on examination of code rather than querying users.
Stefan
Severity set to 'wishlist' from 'normal'
Request was from
Glenn Morris <rgm <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Tue, 26 Jan 2010 18:42:01 GMT)
Full text and
rfc822 format available.
Added tag(s) wontfix.
Request was from
Glenn Morris <rgm <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Tue, 26 Jan 2010 18:42:01 GMT)
Full text and
rfc822 format available.
Reply sent
to
Glenn Morris <rgm <at> gnu.org>
:
You have taken responsibility.
(Wed, 22 Feb 2012 02:49:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
"Drew Adams" <drew.adams <at> oracle.com>
:
bug acknowledged by developer.
(Wed, 22 Feb 2012 02:49:02 GMT)
Full text and
rfc822 format available.
Message #117 received at 3370-done <at> debbugs.gnu.org (full text, mbox):
It was explained that this can be customized with comment-style.
The default isn't going to change.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Wed, 21 Mar 2012 11:24:12 GMT)
Full text and
rfc822 format available.
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.