From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: master 97cb255: newcomment.el (comment-line): New command on C-x C-; . Date: Sun, 8 Feb 2015 17:13:14 -0800 (PST) Message-ID: <2d8fcbc0-7f63-43de-9376-da8ed881d3e2@default> References: <20150208190338.30436.1351@vcs.savannah.gnu.org> <87lhk8w4jt.fsf@gmx.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1423444426 18284 80.91.229.3 (9 Feb 2015 01:13:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 9 Feb 2015 01:13:46 +0000 (UTC) Cc: emacs-devel To: Artur Malabarba Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 09 02:13:45 2015 Return-path: Envelope-to: ged-emacs-devel@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 1YKcv2-0000sj-6P for ged-emacs-devel@m.gmane.org; Mon, 09 Feb 2015 02:13:44 +0100 Original-Received: from localhost ([::1]:58375 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKcv1-0004si-Es for ged-emacs-devel@m.gmane.org; Sun, 08 Feb 2015 20:13:43 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55120) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKcup-0004sH-7c for emacs-devel@gnu.org; Sun, 08 Feb 2015 20:13:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YKcul-0002xH-3X for emacs-devel@gnu.org; Sun, 08 Feb 2015 20:13:31 -0500 Original-Received: from userp1040.oracle.com ([156.151.31.81]:49998) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKcuk-0002xA-SO for emacs-devel@gnu.org; Sun, 08 Feb 2015 20:13:27 -0500 Original-Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t191DNJ0013148 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 9 Feb 2015 01:13:24 GMT Original-Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id t191DMew020586 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Mon, 9 Feb 2015 01:13:23 GMT Original-Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id t191DMQ3003886; Mon, 9 Feb 2015 01:13:22 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8.2 (807160) [OL 12.0.6691.5000 (x86)] X-Source-IP: acsinet21.oracle.com [141.146.126.237] 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: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:182650 Archived-At: > + (when (and (eq last-command 'comment-line-backward) > + (natnump n)) > + (setq n (- n))) It's really too bad (IMO) that you didn't take my suggestion. It sounded like you were going to... ("Good idea. Will do.") You did part of it - repeated upward commenting when started with a negative prefix arg. So far, so good. Thx. But this other feature, which you left out, is also useful, IMO: When repeated, a negative prefix arg switches direction. If you change the above predicate to just (eq last-command 'comment-line-backward) then you get the direction-switching that I suggested. You then still get inheritance of a negative prefix arg when you repeat (upward commenting instead of downward). The direction-switching feature does not change the behavior in any way, except if you use a negative prefix arg again, while you are repeating. With your implementation, hitting `C--' while you are repeating has an effect only if you are going downward. In that case it does switch direction. But if you hit `C--' when going up then it is a no-op. And in fact I see no way to switch to going down again - not `C-1' or `C-u' or ... The direction-switching behavior is thus not symmetric. It's not very useful for it to work only when moving down, IMO. If someone does not want to switch direction when repeating moving down, then s?he just won't hit `C-' again. Since the initial prefix arg is inherited, there is no reason to hit `C--' again, if it does nothing. In that context, `C--' is useless anyway. Did you try what I suggested in this regard? If so, did you find something wrong with it? To me it is handy to be able to always reverse direction (by hitting `C--') - not only when you are moving downward. It is in general handy to have a quick way to reverse the direction of an operation that is bound to a repeating key. One can easily repeat quickly and go past a target position. A quick way to reverse, while staying within the repeating command (e.g. as opposed to using `undo'), is an advantage in general - not just for this command. Anyway, not a big deal. It won't be the first time I will have my own local version of something. ;-) I would prefer not to have to, of course. And I am curious what downside you saw to this feature, if you even tried it at all.