GNU bug report logs - #39353
[PATCH] Use current-prefix-arg instead of prefix-arg

Previous Next

Package: emacs;

Reported by: Kyle Hubert <khubert <at> gmail.com>

Date: Thu, 30 Jan 2020 09:00:01 UTC

Severity: normal

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Kyle Hubert <khubert <at> gmail.com>
To: 39353 <at> debbugs.gnu.org
Subject: bug#39353: [PATCH] Use current-prefix-arg instead of prefix-arg
Date: Wed, 29 Jan 2020 22:53:58 -0500
[Message part 1 (text/plain, inline)]
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 <khubert <at> gmail.com> 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 <cmd> 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
>
>
[Message part 2 (text/html, inline)]

This bug report was last modified 5 years and 103 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.