From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: one key-press to comment out lines of code? Date: Thu, 1 May 2014 07:39:51 -0700 (PDT) Message-ID: References: <87fvku94ms.fsf@skimble.plus.com> <874n1ak5b9.fsf@nl106-137-194.student.uu.se> <87ha59ioyw.fsf@nl106-137-194.student.uu.se> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1398955236 28331 80.91.229.3 (1 May 2014 14:40:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 1 May 2014 14:40:36 +0000 (UTC) To: Emanuel Berg , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu May 01 16:40:29 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Wfs9z-0004Qa-3O for geh-help-gnu-emacs@m.gmane.org; Thu, 01 May 2014 16:40:27 +0200 Original-Received: from localhost ([::1]:39923 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wfs9y-0004YW-LT for geh-help-gnu-emacs@m.gmane.org; Thu, 01 May 2014 10:40:26 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59004) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wfs9c-0004UO-00 for help-gnu-emacs@gnu.org; Thu, 01 May 2014 10:40:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wfs9S-0006PE-GD for help-gnu-emacs@gnu.org; Thu, 01 May 2014 10:40:03 -0400 Original-Received: from userp1040.oracle.com ([156.151.31.81]:25802) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wfs9S-0006P7-8s for help-gnu-emacs@gnu.org; Thu, 01 May 2014 10:39:54 -0400 Original-Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s41EdqgD017476 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 1 May 2014 14:39:53 GMT Original-Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by ucsinet22.oracle.com (8.14.5+Sun/8.14.5) with ESMTP id s41Edp8A024546 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 1 May 2014 14:39:52 GMT Original-Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s41EdpWK001409; Thu, 1 May 2014 14:39:51 GMT In-Reply-To: <87ha59ioyw.fsf@nl106-137-194.student.uu.se> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6691.5000 (x86)] X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:97518 Archived-At: > > `M-;' cannot uncomment the commented lines in the > > region when there are also uncommented lines. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ =20 > Alright, nested comments! I never did that so I never > thought about it. But what I can see, M-; works for > those as well: >=20 > ;; ;; commented-out comment > into > ;; commented-out comment See above: "^^^^^". I already pointed out that M-; will nest. And that it will unnest, but only if the region contains only commented lines. > and > ;; (message "done") ; redundant comment > into > (message "done") ; redundant comment > as well as "mulit-;" comments: > ;;;; IMPORTANT > into > IMPORTANT See above - same story. And my previous mails about this. And the doc. And witness the behavior. > I don't really comment-out code - but when I do, M-; > always worked. >=20 > What are the use-cases where M-; doesn't work? Perhaps > that could be solved somehow - depends on how varied, > and how advanced, those situations are, of course. See what I wrote previously. Or look at the doc of `comment-dwim' vs `comment-region'. Or experiment and see. It's not about "solving" `comment-dwim's differences. They are different on purpose, presumably. It is a compromise. If it works well enough for what you want, great. > > A DWIM command is often limited this way; it is a > > compromise. >=20 > It doesn't have to be. It has to be. It is a guess wrt what any given user wants at any given time. Compromises can be good or bad, handy or not, depending on the algorithm, the user, and the situation. All commands are compromises, of course. Some give the user more control. `comment-dwim' doesn't give you the `comment-region' behavior and control. In my case that means it doesn't give me what I want. YMMV.