GNU bug report logs - #1286
comment-dwim on a comment line does not toggle comment

Previous Next

Package: emacs;

Reported by: xah lee <xah <at> xahlee.org>

Date: Fri, 31 Oct 2008 21:35:02 UTC

Severity: normal

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Xavier Maillard <xma <at> gnu.org>
To: xah lee <xah <at> xahlee.org>, 1286 <at> debbugs.gnu.org
Cc: bug-gnu-emacs <at> gnu.org, bug-submit-list <at> donarmstrong.com,
        bug-gnu-emacs <at> gnu.org
Subject: bug#1286: comment-dwim on a comment line does not toggle comment
Date: Mon, 3 Nov 2008 12:25:08 +0100
   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




This bug report was last modified 16 years and 203 days ago.

Previous Next


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