From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Allen Li Newsgroups: gmane.emacs.bugs Subject: bug#34263: 26.1; documentation for kmacro-insert-counter C-u is wrong Date: Thu, 31 Jan 2019 13:41:41 -0800 Message-ID: References: <83o97wzwd2.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="46573"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 34263@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jan 31 22:42:15 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gpK6A-000Bzx-Mv for geb-bug-gnu-emacs@m.gmane.org; Thu, 31 Jan 2019 22:42:14 +0100 Original-Received: from localhost ([127.0.0.1]:33250 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gpK69-0000W0-KX for geb-bug-gnu-emacs@m.gmane.org; Thu, 31 Jan 2019 16:42:13 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:47501) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gpK60-0000Ul-Pu for bug-gnu-emacs@gnu.org; Thu, 31 Jan 2019 16:42:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gpK5z-000317-NE for bug-gnu-emacs@gnu.org; Thu, 31 Jan 2019 16:42:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54173) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gpK5z-000311-J2 for bug-gnu-emacs@gnu.org; Thu, 31 Jan 2019 16:42:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gpK5x-0000dR-VK for bug-gnu-emacs@gnu.org; Thu, 31 Jan 2019 16:42:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Allen Li Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 31 Jan 2019 21:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34263 X-GNU-PR-Package: emacs Original-Received: via spool by 34263-submit@debbugs.gnu.org id=B34263.15489709202434 (code B ref 34263); Thu, 31 Jan 2019 21:42:01 +0000 Original-Received: (at 34263) by debbugs.gnu.org; 31 Jan 2019 21:42:00 +0000 Original-Received: from localhost ([127.0.0.1]:53454 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gpK5w-0000dC-BC for submit@debbugs.gnu.org; Thu, 31 Jan 2019 16:42:00 -0500 Original-Received: from mail-io1-f47.google.com ([209.85.166.47]:42991) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gpK5t-0000cz-UQ for 34263@debbugs.gnu.org; Thu, 31 Jan 2019 16:41:58 -0500 Original-Received: by mail-io1-f47.google.com with SMTP id x6so4000425ioa.9 for <34263@debbugs.gnu.org>; Thu, 31 Jan 2019 13:41:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=felesatra-moe.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zpOkQgYtpt6Xb7+m0CArT+tLfgB/ttVDGVcdOc1x4ak=; b=xfcilAdoXZs7lXQhemSbv0BGXNYGTHwpiZJ6TD2mROa1lCW1VGRABOwXrijCJxBUNF TjYP0qtRCVtzBoIh910L1jnlRzsWWNmlpl0tDW2DxmUiNM2ZgePq5A4yU15x/62C+mVE h7e5pi+V9Vkda7ulKkCWkj0j/x7zT4sBcjAnnDrQvLmmMcoWqVbTnDBltHIj5XV3wLNY fR7dAZfDae2xq8NXJTlQWR4fjPMS2bvV9melbxsJn2nx1IIesZrHqHTMEm4+bGgSp1bt w89evrlSuXih8SfObHaM2ewnY2lxTSClvU/kDbZKGAU92/+sfyoXeOZFzZEC6/DblSBu navA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zpOkQgYtpt6Xb7+m0CArT+tLfgB/ttVDGVcdOc1x4ak=; b=jjKTqNtux9x1yy9ZnmTOnkiwBKhfkGAikJGUesVpwvIo/zTgCrgSF0KYkvd15eNeeA fm4GKJ2xh2eTFdlmzHFCQEjI9/FZ5Yt7pP4/+jEApjMy6Eh6lLk9xg2LiYOfn1CCCPdY MvvifTvNdBORnEGxVg/MqBboPRF2Aj7V48hZpbeH4M+ZKKcCJ654Ikfvq9rTJV7fNlvk DBNtkwoUt/YlaNAEvNA2HDSaW6YfDv35b3L7YzM9aLgspGUr+EcaBO3q+W0fRshCysXP EsPS4MkGm1njWi3X+TKJbHU5U6KMs7rFlPhS0EJ75RfxZH2tcDgLB2UQ42f/7dhOaSyz V3fw== X-Gm-Message-State: AHQUAuZomNpNqJ8emDQrSjQ3yRawCNXg0gQsueVveI3fp7W5IPRVUQ4M ymDWkzxU4MZXgj/zj4dNq+KYwiDcCMElzqsBn8yxKA== X-Google-Smtp-Source: AHgI3IYv6nQpsAOAWQ1VncqbwxPuLnMUj1S0yzp051TAD1KjrVgUhU+Sj4N7moL1qImb7E3NZ1iZxeT+VBVfvJArXOc= X-Received: by 2002:a6b:2b95:: with SMTP id r143mr6854382ior.217.1548970912048; Thu, 31 Jan 2019 13:41:52 -0800 (PST) In-Reply-To: <83o97wzwd2.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:154944 Archived-At: On Thu, Jan 31, 2019 at 7:21 AM Eli Zaretskii wrote: > > > From: Allen Li > > Date: Thu, 31 Jan 2019 09:54:28 +0000 > > > > The documentation for the behavior of C-u argument to > > kmacro-insert-counter is wrong everywhere (both in the docstring and > > manual, and also for kmacro-start-macro-or-insert-counter). > > Isn't this the same issue as the one you raised in bug#31243? Which > is already solved in the Git repository for Emacs 26.2? > > > It says that supplying C-u is the same as supplying C-u 0. This is > > completely wrong, and has caused confusion for multiple users (I can > > dig up some links if desired). C-u 0 inserts the current value of the > > kmacro counter without incrementing it. C-u inserts the *previous* > > value of the kmacro counter, which is usually one less than the > > current value. > > Please look at the documentation on the emacs-26 branch and tell what > exactly is wrong/unclear/confusing there. On both the master branch and emacs-26: (defun kmacro-insert-counter (arg) "Insert current value of `kmacro-counter', then increment it by ARG. Interactively, ARG defaults to 1. With \\[universal-argument], insert current value of `kmacro-counter', but do not increment it." This is still wrong, C-u inserts the *previous* value of kmacro-counter. (defun kmacro-start-macro-or-insert-counter (arg) "Record subsequent keyboard input, defining a keyboard macro. The commands are recorded even as they are executed. Initializes the macro's `kmacro-counter' to ARG (or 0 if no prefix arg) before defining the macro. With \\[universal-argument], appends to current keyboard macro (keeping the current value of `kmacro-counter'). When used during defining/executing a macro, inserts the current value of `kmacro-counter' and increments the counter value by ARG (or by 1 if no prefix argument). With just \\[universal-argument], inserts the current value of `kmacro-counter', but does not modify the counter; this is the same as incrementing the counter by zero. This is still wrong. C-u is NOT the same as incrementing the counter by zero. C-u 0 inserts the *current* value of the counter, C-u inserts the *previous* value of the counter. @findex kmacro-insert-counter @kindex C-x C-k C-i When you are defining a keyboard macro, the command @key{F3} (@code{kmacro-start-macro-or-insert-counter}) inserts the current value of the keyboard macro's counter into the buffer, and increments the counter by 1. (If you are not defining a macro, @key{F3} begins a macro definition instead. @xref{Basic Keyboard Macro}.) You can use a numeric prefix argument to specify a different increment. If you just specify a @kbd{C-u} prefix, that is the same as an increment of zero: it inserts the current counter value without changing it. This is still wrong. C-u is NOT the same as incrementing the counter by zero. C-u 0 inserts the *current* value of the counter, C-u inserts the *previous* value of the counter. > > Thanks.