From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xavier Maillard Newsgroups: gmane.emacs.bugs Subject: bug#1286: comment-dwim on a comment line does not toggle comment Date: Mon, 3 Nov 2008 12:25:08 +0100 Organization: GNU's Not UNIX! Message-ID: <200811031125.mA3BP8eZ024503@zogzog.maillard.mobi> References: Reply-To: Xavier Maillard , 1286@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1225713025 14048 80.91.229.12 (3 Nov 2008 11:50:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 3 Nov 2008 11:50:25 +0000 (UTC) Cc: bug-gnu-emacs@gnu.org, bug-submit-list@donarmstrong.com To: xah lee , 1286@emacsbugs.donarmstrong.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Nov 03 12:51:26 2008 connect(): Connection refused Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Kwxxs-0005r5-Tf for geb-bug-gnu-emacs@m.gmane.org; Mon, 03 Nov 2008 12:51:25 +0100 Original-Received: from localhost ([127.0.0.1]:34163 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kwxwm-0000EC-63 for geb-bug-gnu-emacs@m.gmane.org; Mon, 03 Nov 2008 06:50:16 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kwxwi-0000Dz-K2 for bug-gnu-emacs@gnu.org; Mon, 03 Nov 2008 06:50:12 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kwxwf-0000D7-Tz for bug-gnu-emacs@gnu.org; Mon, 03 Nov 2008 06:50:11 -0500 Original-Received: from [199.232.76.173] (port=36435 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kwxwf-0000Cu-NS for bug-gnu-emacs@gnu.org; Mon, 03 Nov 2008 06:50:09 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:52966) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kwxwf-0005CZ-4t for bug-gnu-emacs@gnu.org; Mon, 03 Nov 2008 06:50:09 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mA3Bo46j023284; Mon, 3 Nov 2008 03:50:05 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id mA3BZ3QW019675; Mon, 3 Nov 2008 03:35:03 -0800 X-Loop: don@donarmstrong.com Resent-From: Xavier Maillard Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Mon, 03 Nov 2008 11:35:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1286 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 1286-submit@emacsbugs.donarmstrong.com id=B1286.122571167518380 (code B ref 1286); Mon, 03 Nov 2008 11:35:03 +0000 Original-Received: (at 1286) by emacsbugs.donarmstrong.com; 3 Nov 2008 11:27:55 +0000 Original-Received: from master.uucpssh.org (master.uucpssh.org [193.218.105.66]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mA3BRoCY018374 for <1286@emacsbugs.donarmstrong.com>; Mon, 3 Nov 2008 03:27:52 -0800 Original-Received: by master.uucpssh.org (Postfix, from userid 10) id 7C467F42DA; Mon, 3 Nov 2008 12:27:35 +0100 (CET) Original-Received: from zogzog.maillard.mobi (IDENT:1000@localhost [127.0.0.1]) by zogzog.maillard.mobi (8.14.2/8.13.8) with ESMTP id mA3BPEx1024508; Mon, 3 Nov 2008 12:25:14 +0100 Original-Received: (from xma@localhost) by zogzog.maillard.mobi (8.14.2/8.13.8/Submit) id mA3BP8eZ024503; Mon, 3 Nov 2008 12:25:08 +0100 In-reply-to: (message from xah lee on Fri, 31 Oct 2008 14:25:09 -0700) User-Agent: Rmail in GNU Emacs 23.0.60.12 on GNU/Linux Jabber-ID: xma01@jabber.fr X-uucpssh: Found to be clean X-uucpssh-SpamCheck: not spam, SpamAssassin (SpamAssassin rebuilding) X-uucpssh-From: xma@gnu.org X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Mon, 03 Nov 2008 06:50:11 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:22123 Archived-At: 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