From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: xah lee Newsgroups: gmane.emacs.bugs Subject: bug#1286: comment-dwim on a comment line does not toggle comment Date: Mon, 3 Nov 2008 13:10:24 -0800 Message-ID: <244A228E-2192-4165-8495-C760C253DE9E@xahlee.org> References: <200811031125.mA3BP8eZ024503@zogzog.maillard.mobi> Reply-To: xah lee , 1286@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v753.1) Content-Type: text/plain; charset=UTF-8; delsp=yes; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1225747838 7017 80.91.229.12 (3 Nov 2008 21:30:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 3 Nov 2008 21:30:38 +0000 (UTC) Cc: bug-gnu-emacs@gnu.org, 1286@emacsbugs.donarmstrong.com, bug-submit-list@donarmstrong.com To: Xavier Maillard Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Nov 03 22:31:36 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 1Kx71H-0004K8-Ph for geb-bug-gnu-emacs@m.gmane.org; Mon, 03 Nov 2008 22:31:32 +0100 Original-Received: from localhost ([127.0.0.1]:45901 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kx709-0005l8-DQ for geb-bug-gnu-emacs@m.gmane.org; Mon, 03 Nov 2008 16:30:21 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kx704-0005kn-Sg for bug-gnu-emacs@gnu.org; Mon, 03 Nov 2008 16:30:16 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kx703-0005kC-Ax for bug-gnu-emacs@gnu.org; Mon, 03 Nov 2008 16:30:16 -0500 Original-Received: from [199.232.76.173] (port=49064 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kx702-0005k8-UK for bug-gnu-emacs@gnu.org; Mon, 03 Nov 2008 16:30:14 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:44601) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kx702-0001gy-DC for bug-gnu-emacs@gnu.org; Mon, 03 Nov 2008 16:30:15 -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 mA3LU40j007154; Mon, 3 Nov 2008 13:30:05 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id mA3LK3OW004607; Mon, 3 Nov 2008 13:20:03 -0800 X-Loop: don@donarmstrong.com Resent-From: xah lee Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Mon, 03 Nov 2008 21:20:02 +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 submit@emacsbugs.donarmstrong.com id=B.12257466523300 (code B ref -1); Mon, 03 Nov 2008 21:20:02 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 3 Nov 2008 21:10:52 +0000 Original-Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mA3LAniR003293 for ; Mon, 3 Nov 2008 13:10:50 -0800 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kx6hE-0008HF-NA for bug-gnu-emacs@gnu.org; Mon, 03 Nov 2008 16:10:48 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kx6hD-0008H2-AX for bug-gnu-emacs@gnu.org; Mon, 03 Nov 2008 16:10:48 -0500 Original-Received: from [199.232.76.173] (port=33772 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kx6hD-0008Gz-7U for bug-gnu-emacs@gnu.org; Mon, 03 Nov 2008 16:10:47 -0500 Original-Received: from mout.perfora.net ([74.208.4.196]:57889) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kx6hB-0007sz-HR; Mon, 03 Nov 2008 16:10:45 -0500 Original-Received: from [192.168.1.2] (c-24-6-185-159.hsd1.ca.comcast.net [24.6.185.159]) by mrelay.perfora.net (node=mrus0) with ESMTP (Nemesis) id 0MKp8S-1Kx6gp07Pw-0001X7; Mon, 03 Nov 2008 16:10:27 -0500 In-Reply-To: <200811031125.mA3BP8eZ024503@zogzog.maillard.mobi> X-Mailer: Apple Mail (2.753.1) X-Provags-ID: V01U2FsdGVkX19NXsP9pDy/SMDmi/n+hKbFywTszQF4LC/jR1i K+TnwMj6vpn/Rm04RMFa2hHphw0ph88zK8C1cQBWydUsu0/dFL n7+xwyrjqy9ineTPr5DJQ== X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-CrossAssassin-Score: 2 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Mon, 03 Nov 2008 16:30:16 -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:22140 Archived-At: Xavier Maillard wrote: =C2=ABFor my point of view, this is well defined here and it behaves = just =20 as described.=C2=BB I agree it's well defined and documented. However, i think it is not =20 intuitive, even people who have used emacs for 3 or more years and =20 are familiar with its terminologies and behaviors. when a cursor is on a comment line (whole line is comment) and =20 there's no active region, i don't see any reason it shouldn't just =20 uncomment the line when calling comment-dwim. I would say that, any =20 person, including those using emacs for 3 or more years, who are =20 using comment-dwim for the first time, would expect it to uncomment it. is there a reason why it shouldn't uncomment other than =E2=80=9Cit's = that =20 way for long=E2=80=9D? PS I only started to use comment-dwim in this or last year. In the =20 past, i've always used string-rectangle and kill-rectangle. I started =20= to use emacs daily in a day job since 1998, and for the first 7 years =20= i use it exclusively in terminals. Xah =E2=88=91 http://xahlee.org/ =E2=98=84 ---------------------------------- 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-=20 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 =20 commented. For my point of view, this is well defined here and it behaves just as described. -----------------------