From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Kyle Hubert Newsgroups: gmane.emacs.bugs Subject: bug#39353: [PATCH] Use current-prefix-arg instead of prefix-arg Date: Wed, 29 Jan 2020 22:53:58 -0500 Message-ID: References: <20200130033504.64697-1-khubert@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000c66635059d53689e" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="87143"; mail-complaints-to="usenet@ciao.gmane.io" To: 39353@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 30 13:24:13 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ix8rl-000Mbt-0w for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 30 Jan 2020 13:24:13 +0100 Original-Received: from localhost ([::1]:59832 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ix8rk-0001wL-2u for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 30 Jan 2020 07:24:12 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50985) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ix8rb-0001wC-Bn for bug-gnu-emacs@gnu.org; Thu, 30 Jan 2020 07:24:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ix8ra-0002H3-0A for bug-gnu-emacs@gnu.org; Thu, 30 Jan 2020 07:24:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57287) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ix8rZ-0002Gw-Rv for bug-gnu-emacs@gnu.org; Thu, 30 Jan 2020 07:24:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ix8rZ-0000kW-NP for bug-gnu-emacs@gnu.org; Thu, 30 Jan 2020 07:24:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Kyle Hubert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 30 Jan 2020 12:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39353 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15803869832804 (code B ref -1); Thu, 30 Jan 2020 12:24:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 30 Jan 2020 12:23:03 +0000 Original-Received: from localhost ([127.0.0.1]:35027 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ix8qc-0000iy-Fh for submit@debbugs.gnu.org; Thu, 30 Jan 2020 07:23:02 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:46933) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ix0uD-0003Vo-Pq for submit@debbugs.gnu.org; Wed, 29 Jan 2020 22:54:14 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44109) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ix0uC-0001Sf-86 for bug-gnu-emacs@gnu.org; Wed, 29 Jan 2020 22:54:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ix0uA-0007MA-Vi for bug-gnu-emacs@gnu.org; Wed, 29 Jan 2020 22:54:12 -0500 Original-Received: from mail-vk1-xa41.google.com ([2607:f8b0:4864:20::a41]:45236) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ix0uA-0007L4-Cs for bug-gnu-emacs@gnu.org; Wed, 29 Jan 2020 22:54:10 -0500 Original-Received: by mail-vk1-xa41.google.com with SMTP id g7so634294vkl.12 for ; Wed, 29 Jan 2020 19:54:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=vRRIEBOfTecduYR9wOUwXV1kMJJv6EDg1mErmDL7REA=; b=gYFv1xaaEP3JnJVTRfJf+fopQwYlPYhepeoK8rOHKG8IwXWqRQHGTas8lTyneOPhjZ 8IbP1KG2N45+MTbFHmA0rfinqNSZbMIL9qpdfLqK2FNYaNYbMy6tE4fQaWwRzwL1tLSH DssuuL2NWlfbVMOY+X1brVfDxb5faEnVgc9t4NKldI6H3I1QqDLelMt/bD+KL/IoN9le Z+gXoD4tYHY5RZsLlYN9XqyeIaXiejYF6R+mO6mkL7QkLPdPVQ3/qufQl1PIJMSVwcVQ VJTdKF4flNhvsxMJpcb8x03B9JKQakaklI5S+j7bP4k+28xJ+hGftXOT4F5F3EZHv4GQ 7OnQ== 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; bh=vRRIEBOfTecduYR9wOUwXV1kMJJv6EDg1mErmDL7REA=; b=pLxmQNJoIQNa136sQ/AUe7DnamwyPv+f9/pRwNl2ht2OYJOncyXUeAvBrIFi28GqSq gGiIoIxgDbSKYfszCg20+MTnD2K40QEtaO+iK8gXlTql1HU3ta/issTVDpPLZ9jb6SXF Lh6On08cgkPoA5T3llLVmIRgHiowRN3n/dU3VuXNZL6HqAMmknPNxJwq/qaVwo2VjeWM tHITG17AtUYrMPP8MXoMFHBuBbsfaLyt4ldtZmJpF0lyGmm4bHD1GjReNlNLV2+ucu99 28B6/dRMINRas4/uWuA7Qv2wKLK9FBmfkYpLS/BT2oMFRPYoqibYzxlj5viDVOnCkuCD 1gnw== X-Gm-Message-State: APjAAAWoxlbTzzkLTXmuG55QItSPfAMy3UtHSncCShOCFi7Te4dKrklT 9nuOzH1bIidz1AKKsuKIr9OM7fOU4PIbXl43uZfFAiZS X-Google-Smtp-Source: APXvYqy1NK9wbpgbzPI7rKdiLTrenHYcGPfPKi7rsYuasQzdowYSCWsYJK1MdvI9456OVzrFo+NwM1QBkdkw4b3VOMo= X-Received: by 2002:a1f:4193:: with SMTP id o141mr1651892vka.19.1580356449231; Wed, 29 Jan 2020 19:54:09 -0800 (PST) In-Reply-To: <20200130033504.64697-1-khubert@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Mailman-Approved-At: Thu, 30 Jan 2020 07:23:00 -0500 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:175434 Archived-At: --000000000000c66635059d53689e Content-Type: text/plain; charset="UTF-8" I have a hard time testing the change to simple.el, as I don't understand execute-extended-command. Can anyone help here? I'm worried since it isn't using (interactive "P") that this is incorrect. I admit I'm deeper in the guts of emacs than typical. Thanks, -Kyle On Wed, Jan 29, 2020 at 10:35 PM Kyle Hubert wrote: > Forwarding arguments through to children function invocations should > be handled by current-prefix-arg. This was first uncovered when ediff > used full window width scrolling in ediff-scroll-horizontally, when > the call to scroll-left or scroll-right should have been half-window > size. Through further grepping, there was another usage in > simple.el. Note, execute-extended-command was visually inspected that > it was in interactive mode. > > --- > lisp/simple.el | 2 +- > lisp/vc/ediff-util.el | 4 ++-- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/lisp/simple.el b/lisp/simple.el > index 2ec3da680f..53afa7b138 100644 > --- a/lisp/simple.el > +++ b/lisp/simple.el > @@ -1888,7 +1888,7 @@ invoking, give a prefix argument to > `execute-extended-command'." > ;; `function' and not `execute-extended-command'. The difference is > ;; visible in cases such as M-x RET and then C-x z (bug#11506). > (setq real-this-command function) > - (let ((prefix-arg prefixarg)) > + (let ((current-prefix-arg prefixarg)) > (command-execute function 'record)) > ;; If enabled, show which key runs this command. > ;; But first wait, and skip the message if there is input. > diff --git a/lisp/vc/ediff-util.el b/lisp/vc/ediff-util.el > index a8af9ba37a..5f8a4a86b1 100644 > --- a/lisp/vc/ediff-util.el > +++ b/lisp/vc/ediff-util.el > @@ -1540,10 +1540,10 @@ the width of the A/B/C windows." > ;; hscrolling. > (if (= last-command-event ?<) > (lambda (arg) > - (let ((prefix-arg arg)) > + (let ((current-prefix-arg arg)) > (call-interactively #'scroll-left))) > (lambda (arg) > - (let ((prefix-arg arg)) > + (let ((current-prefix-arg arg)) > (call-interactively #'scroll-right)))) > ;; calculate argument to scroll-left/right > ;; if there is an explicit argument > -- > 2.25.0 > > --000000000000c66635059d53689e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I have a hard time testing the change to = simple.el, as I don't understand execute-extended-command. Can anyone h= elp here? I'm worried since it isn't using (interactive "P&quo= t;) that this is incorrect. I admit I'm deeper in the guts of emacs tha= n typical.

Thanks,
-Kyle

<= /div>
O= n Wed, Jan 29, 2020 at 10:35 PM Kyle Hubert <khubert@gmail.com> wrote:
Forwarding arguments through to children functio= n invocations should
be handled by current-prefix-arg. This was first uncovered when ediff
used full window width scrolling in ediff-scroll-horizontally, when
the call to scroll-left or scroll-right should have been half-window
size. Through further grepping, there was another usage in
simple.el. Note, execute-extended-command was visually inspected that
it was in interactive mode.

---
=C2=A0lisp/simple.el=C2=A0 =C2=A0 =C2=A0 =C2=A0 | 2 +-
=C2=A0lisp/vc/ediff-util.el | 4 ++--
=C2=A02 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/simple.el b/lisp/simple.el
index 2ec3da680f..53afa7b138 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1888,7 +1888,7 @@ invoking, give a prefix argument to `execute-extended= -command'."
=C2=A0 =C2=A0 =C2=A0;; `function' and not `execute-extended-command'= ;.=C2=A0 The difference is
=C2=A0 =C2=A0 =C2=A0;; visible in cases such as M-x <cmd> RET and the= n C-x z (bug#11506).
=C2=A0 =C2=A0 =C2=A0(setq real-this-command function)
-=C2=A0 =C2=A0 (let ((prefix-arg prefixarg))
+=C2=A0 =C2=A0 (let ((current-prefix-arg prefixarg))
=C2=A0 =C2=A0 =C2=A0 =C2=A0(command-execute function 'record))
=C2=A0 =C2=A0 =C2=A0;; If enabled, show which key runs this command.
=C2=A0 =C2=A0 =C2=A0;; But first wait, and skip the message if there is inp= ut.
diff --git a/lisp/vc/ediff-util.el b/lisp/vc/ediff-util.el
index a8af9ba37a..5f8a4a86b1 100644
--- a/lisp/vc/ediff-util.el
+++ b/lisp/vc/ediff-util.el
@@ -1540,10 +1540,10 @@ the width of the A/B/C windows."
=C2=A0 =C2=A0 ;; hscrolling.
=C2=A0 =C2=A0 (if (=3D last-command-event ?<)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (lambda (arg)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 (let ((prefix-arg arg))
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 (let ((current-prefix-arg arg))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(call-interactively #'scroll-l= eft)))
=C2=A0 =C2=A0 =C2=A0 (lambda (arg)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0(let ((prefix-arg arg))
+=C2=A0 =C2=A0 =C2=A0 =C2=A0(let ((current-prefix-arg arg))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(call-interactively #'scroll-right)))= )
=C2=A0 =C2=A0 ;; calculate argument to scroll-left/right
=C2=A0 =C2=A0 ;; if there is an explicit argument
--
2.25.0

--000000000000c66635059d53689e--