From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: Rationale behind conversion of a nil prefix arg to numeric 1 Date: Mon, 5 Sep 2016 16:32:23 -0700 (PDT) Message-ID: <1cded8d3-2296-4226-aea6-7f46278b4ae1@default> References: <<87y437c0qg.fsf@bertrandrussell.Speedport_W_723V_1_40_000> <83oa43d9r8.fsf@gnu.org> <06d4a7f1-f116-fb5c-9bd2-c4d1f98934c9@easy-emacs.de> <83k2ercy5u.fsf@gnu.org> <56fae654-627a-41bd-8bdb-55418ed2e93f@default>> <<877faqvxfp.fsf@bertrandrussell.Speedport_W_723V_1_40_000>> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1473118390 28941 195.159.176.226 (5 Sep 2016 23:33:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 5 Sep 2016 23:33:10 +0000 (UTC) To: "Florian v. Savigny" , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Sep 06 01:33:06 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bh3Nw-0006hY-2Q for geh-help-gnu-emacs@m.gmane.org; Tue, 06 Sep 2016 01:33:04 +0200 Original-Received: from localhost ([::1]:57443 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bh3Nt-0002nS-43 for geh-help-gnu-emacs@m.gmane.org; Mon, 05 Sep 2016 19:33:01 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43005) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bh3NQ-0002nK-Vr for help-gnu-emacs@gnu.org; Mon, 05 Sep 2016 19:32:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bh3NM-0008My-Pz for help-gnu-emacs@gnu.org; Mon, 05 Sep 2016 19:32:31 -0400 Original-Received: from userp1040.oracle.com ([156.151.31.81]:48870) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bh3NM-0008Mu-HQ for help-gnu-emacs@gnu.org; Mon, 05 Sep 2016 19:32:28 -0400 Original-Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u85NWOa7031424 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 5 Sep 2016 23:32:24 GMT Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u85NWOWF024827 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 5 Sep 2016 23:32:24 GMT Original-Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id u85NWNFh017907; Mon, 5 Sep 2016 23:32:23 GMT In-Reply-To: <<877faqvxfp.fsf@bertrandrussell.Speedport_W_723V_1_40_000>> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6753.5000 (x86)] X-Source-IP: userv0021.oracle.com [156.151.31.71] 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.21 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" Xref: news.gmane.org gmane.emacs.help:111276 Archived-At: > > This is really one of the first things that someone writing > > a command learns. >=20 > Oops. I must confess this did not happen in my case. I should not have been so black-&-white in saying that. I really meant that only in the context of writing commands that use a prefix arg, and in particular, commands where not explicitly providing a prefix arg has a different behavior from providing a prefix arg of 1. IOW, it only matters if you in fact care about whether the user provided a prefix arg. If you are writing a command where the prefix arg is used only as the number of times to repeat the behavior then you will likely not be aware of, or see the point of, a raw prefix argument. > I have written > commands in Elisp for about 15 years, and I although I was soon > familiar with there somehow being a "raw" prefix arg (meaning I often > read this term in passing), I nevertheless always thought C-u was > simply a way of passing a command a number. (I did not even know that > you can also pass prefix commands typing M-..) I'm sure your experience is not unusual. See above: if you never write a command that cares whether the user provided a prefix arg then you are not so likely to have learned this. > > It's really not a big deal. It's a flexible feature and is > > easy to learn. Admittedly (like much in Emacs), if you have > > not yet learned it, and you try to write a command that > > takes advantage of a prefix arg, then you might be surprised > > to learn it. Your surprise should be a welcome one, as you > > now know what you can do with it. >=20 > Absolutely, at least now. Your post has been a very enlightening > lecture indeed, as have the other explanatory posts. (I am wondering > why I never grasped it from the Elisp Manual, but I guess because you > have stated the whys and wherefores, it is much easier for me to store > in memory somewhere.) It's often the case that the same bit of info really registers only after we've come into contact with the particular problem (use case) that it was put there to address. > Thanks very much to you all! Thanks for posing the question, as I'm sure you are not the only one for whom the question and the answer are helpful.