* bug#1286: comment-dwim on a comment line does not toggle comment
@ 2008-10-31 21:25 ` xah lee
2008-11-01 1:40 ` bug#1286: marked as done (comment-dwim on a comment line does not toggle comment) Emacs bug Tracking System
2008-11-03 11:25 ` bug#1286: comment-dwim on a comment line does not toggle comment Xavier Maillard
0 siblings, 2 replies; 6+ messages in thread
From: xah lee @ 2008-10-31 21:25 UTC (permalink / raw
To: bug-gnu-emacs
this appears to be like a bug.
in emacs-lisp-mode, if you have a comment like this:
;; This is a comment
and your cursor is somewhere on that line. Now, do comment-dwim, it
doesn't uncomment the line. It just moves the cursor to the “T”
in “This”.
Same behavior in cperl mode and probably all others.
I think this might be by design, but it seems counter-intuitive.
In GNU Emacs 22.2.1 (powerpc-apple-darwin8.11.0, Carbon Version 1.6.0)
of 2008-04-05 on g5.tokyo.stp.isas.jaxa.jp
Xah
∑ http://xahlee.org/
☄
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#1286: marked as done (comment-dwim on a comment line does not toggle comment)
2008-10-31 21:25 ` bug#1286: comment-dwim on a comment line does not toggle comment xah lee
@ 2008-11-01 1:40 ` Emacs bug Tracking System
2008-11-03 11:25 ` bug#1286: comment-dwim on a comment line does not toggle comment Xavier Maillard
1 sibling, 0 replies; 6+ messages in thread
From: Emacs bug Tracking System @ 2008-11-01 1:40 UTC (permalink / raw
To: Stefan Monnier
[-- Attachment #1: Type: text/plain, Size: 901 bytes --]
Your message dated Fri, 31 Oct 2008 21:33:32 -0400
with message-id <jwvabcknsf4.fsf-monnier+emacsbugreports@gnu.org>
and subject line Re: bug#1286: comment-dwim on a comment line does not toggle comment
has caused the Emacs bug report #1286,
regarding comment-dwim on a comment line does not toggle comment
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact don@donarmstrong.com
immediately.)
--
1286: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=1286
Emacs Bug Tracking System
Contact don@donarmstrong.com with problems
[-- Attachment #2: Type: message/rfc822, Size: 2699 bytes --]
From: xah lee <xah@xahlee.org>
To: bug-gnu-emacs@gnu.org
Subject: comment-dwim on a comment line does not toggle comment
Date: Fri, 31 Oct 2008 14:25:09 -0700
Message-ID: <F5DC8BCE-3380-4798-9B5B-32D5731AA837@xahlee.org>
this appears to be like a bug.
in emacs-lisp-mode, if you have a comment like this:
;; This is a comment
and your cursor is somewhere on that line. Now, do comment-dwim, it
doesn't uncomment the line. It just moves the cursor to the “T”
in “This”.
Same behavior in cperl mode and probably all others.
I think this might be by design, but it seems counter-intuitive.
In GNU Emacs 22.2.1 (powerpc-apple-darwin8.11.0, Carbon Version 1.6.0)
of 2008-04-05 on g5.tokyo.stp.isas.jaxa.jp
Xah
∑ http://xahlee.org/
☄
[-- Attachment #3: Type: message/rfc822, Size: 2322 bytes --]
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: xah lee <xah@xahlee.org>
Cc: 1286-done@emacsbugs.donarmstrong.com
Subject: Re: bug#1286: comment-dwim on a comment line does not toggle comment
Date: Fri, 31 Oct 2008 21:33:32 -0400
Message-ID: <jwvabcknsf4.fsf-monnier+emacsbugreports@gnu.org>
> this appears to be like a bug.
> in emacs-lisp-mode, if you have a comment like this:
> ;; This is a comment
> and your cursor is somewhere on that line. Now, do comment-dwim, it doesn't
> uncomment the line. It just moves the cursor to the “T” in “This”.
> Same behavior in cperl mode and probably all others.
> I think this might be by design, but it seems counter-intuitive.
This is the way M-; has worked for as long as I can remember.
It also re-indents the comment, if needed. If you want to uncomment,
then select the line via e.g. C-a C-SPC C-n and then M-; will do what
you asked for.
Stefan
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#1286: comment-dwim on a comment line does not toggle comment
2008-10-31 21:25 ` bug#1286: comment-dwim on a comment line does not toggle comment xah lee
2008-11-01 1:40 ` bug#1286: marked as done (comment-dwim on a comment line does not toggle comment) Emacs bug Tracking System
@ 2008-11-03 11:25 ` Xavier Maillard
2008-11-03 21:10 ` xah lee
1 sibling, 1 reply; 6+ messages in thread
From: Xavier Maillard @ 2008-11-03 11:25 UTC (permalink / raw
To: xah lee, 1286; +Cc: bug-gnu-emacs, bug-submit-list
this appears to be like a bug.
in emacs-lisp-mode, if you have a comment like this:
;; This is a comment
and your cursor is somewhere on that line. Now, do comment-dwim, it
doesn't uncomment the line. It just moves the cursor to the T
in This .
Same behavior in cperl mode and probably all others.
I think this might be by design, but it seems counter-intuitive.
I am sure you read it but just in case:
comment-dwim is an interactive autoloaded Lisp function in
`newcomment.el'.
It is bound to M-;.
(comment-dwim ARG)
Call the comment command you want (Do What I Mean).
If the region is active and `transient-mark-mode' is on, call
`comment-region' (unless it only consists of comments, in which
case it calls `uncomment-region').
Else, if the current line is empty, call `comment-insert-comment-function'
if it is defined, otherwise insert a comment and indent it.
Else if a prefix ARG is specified, call `comment-kill'.
Else, call `comment-indent'.
You can configure `comment-style' to change the way regions are commented.
For my point of view, this is well defined here and it behaves
just as described.
Xavier
--
http://www.gnu.org
http://www.april.org
http://www.lolica.org
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#1286: comment-dwim on a comment line does not toggle comment
2008-11-03 11:25 ` bug#1286: comment-dwim on a comment line does not toggle comment Xavier Maillard
@ 2008-11-03 21:10 ` xah lee
2008-11-04 16:34 ` Stefan Monnier
2008-11-05 7:25 ` Xavier Maillard
0 siblings, 2 replies; 6+ messages in thread
From: xah lee @ 2008-11-03 21:10 UTC (permalink / raw
To: Xavier Maillard; +Cc: bug-gnu-emacs, 1286, bug-submit-list
Xavier Maillard wrote:
«For my point of view, this is well defined here and it behaves just
as described.»
I agree it's well defined and documented. However, i think it is not
intuitive, even people who have used emacs for 3 or more years and
are familiar with its terminologies and behaviors.
when a cursor is on a comment line (whole line is comment) and
there's no active region, i don't see any reason it shouldn't just
uncomment the line when calling comment-dwim. I would say that, any
person, including those using emacs for 3 or more years, who are
using comment-dwim for the first time, would expect it to uncomment it.
is there a reason why it shouldn't uncomment other than “it's that
way for long”?
PS I only started to use comment-dwim in this or last year. In the
past, i've always used string-rectangle and kill-rectangle. I started
to use emacs daily in a day job since 1998, and for the first 7 years
i use it exclusively in terminals.
Xah
∑ http://xahlee.org/
☄
----------------------------------
On Nov 3, 2008, at 3:25 AM, Xavier Maillard wrote:
this appears to be like a bug.
in emacs-lisp-mode, if you have a comment like this:
;; This is a comment
and your cursor is somewhere on that line. Now, do comment-dwim, it
doesn't uncomment the line. It just moves the cursor to the T
in This .
Same behavior in cperl mode and probably all others.
I think this might be by design, but it seems counter-intuitive.
I am sure you read it but just in case:
comment-dwim is an interactive autoloaded Lisp function in
`newcomment.el'.
It is bound to M-;.
(comment-dwim ARG)
Call the comment command you want (Do What I Mean).
If the region is active and `transient-mark-mode' is on, call
`comment-region' (unless it only consists of comments, in which
case it calls `uncomment-region').
Else, if the current line is empty, call `comment-insert-comment-
function'
if it is defined, otherwise insert a comment and indent it.
Else if a prefix ARG is specified, call `comment-kill'.
Else, call `comment-indent'.
You can configure `comment-style' to change the way regions are
commented.
For my point of view, this is well defined here and it behaves
just as described.
-----------------------
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#1286: comment-dwim on a comment line does not toggle comment
2008-11-03 21:10 ` xah lee
@ 2008-11-04 16:34 ` Stefan Monnier
2008-11-05 7:25 ` Xavier Maillard
1 sibling, 0 replies; 6+ messages in thread
From: Stefan Monnier @ 2008-11-04 16:34 UTC (permalink / raw
To: xah lee; +Cc: bug-gnu-emacs, 1286, bug-submit-list
> when a cursor is on a comment line (whole line is comment) and there's no
> active region, i don't see any reason it shouldn't just uncomment the line
> when calling comment-dwim. I would say that, any person, including those
I, on the other hand, don't see why it should do that. What would be
the logic behind it? And according to that logic what should it do if
the line contains a comment as well as some code?
As explained, the M-; behavior you're seeing has been with us for many
many years, so there needs to be a good reason for the change (and the
previous behavior of inserting a comment marker and/or reindenting
a preexisting comment marker, should still be available somewhere).
Stefan
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#1286: comment-dwim on a comment line does not toggle comment
2008-11-03 21:10 ` xah lee
2008-11-04 16:34 ` Stefan Monnier
@ 2008-11-05 7:25 ` Xavier Maillard
1 sibling, 0 replies; 6+ messages in thread
From: Xavier Maillard @ 2008-11-05 7:25 UTC (permalink / raw
To: xah lee; +Cc: bug-gnu-emacs, 1286, bug-submit-list
Xavier Maillard wrote:
«For my point of view, this is well defined here and it behaves just
as described.»
I agree it's well defined and documented. However, i think it is not
intuitive, even people who have used emacs for 3 or more years and
are familiar with its terminologies and behaviors.
when a cursor is on a comment line (whole line is comment) and
there's no active region, i don't see any reason it shouldn't just
uncomment the line when calling comment-dwim. I would say that, any
person, including those using emacs for 3 or more years, who are
using comment-dwim for the first time, would expect it to uncomment it.
Speaking for myself, as a more-than-3-years emacs user, I do not
see why it should uncomment anything here. I am used to activate
a commented region and then M-; to uncomment it. M-; has always
done the right thing: comment and indent.
Dunno what other people think about that though.
Xavier
--
http://www.gnu.org
http://www.april.org
http://www.lolica.org
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-11-05 7:25 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <jwvabcknsf4.fsf-monnier+emacsbugreports@gnu.org>
2008-10-31 21:25 ` bug#1286: comment-dwim on a comment line does not toggle comment xah lee
2008-11-01 1:40 ` bug#1286: marked as done (comment-dwim on a comment line does not toggle comment) Emacs bug Tracking System
2008-11-03 11:25 ` bug#1286: comment-dwim on a comment line does not toggle comment Xavier Maillard
2008-11-03 21:10 ` xah lee
2008-11-04 16:34 ` Stefan Monnier
2008-11-05 7:25 ` Xavier Maillard
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).