GNU bug report logs - #71277
30.0.50; last-prefix-arg lost when universal-argument used

Previous Next

Package: emacs;

Reported by: Sean Whitton <spwhitton <at> spwhitton.name>

Date: Thu, 30 May 2024 11:48:02 UTC

Severity: normal

Found in version 30.0.50

Done: Sean Whitton <spwhitton <at> spwhitton.name>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 71277 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Sean Whitton <spwhitton <at> spwhitton.name>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 71277 <at> debbugs.gnu.org
Subject: Re: bug#71277: 30.0.50;
 last-prefix-arg lost when universal-argument used
Date: Thu, 30 May 2024 15:14:26 +0300
> Date: Thu, 30 May 2024 12:47:29 +0100
> From:  Sean Whitton via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
>     (defun counter ()
>       (interactive)
>       (when (eq last-command this-command)
> 	(setq current-prefix-arg
> 	      (+ (prefix-numeric-value current-prefix-arg)
> 		 (prefix-numeric-value last-prefix-arg))))
>       (message "%s!" (prefix-numeric-value current-prefix-arg)))
>     (global-set-key "\M-." #'counter)
> 
> If you type M-. M-. M-. then you see "3!" as expected.
> 
> Similarly if you type "C-u M-. M-. M-." then you see "6!".
> 
> However, if you type "M-. M-. C-u M-." then you get "5!".
> 
> Unlses something is wrong with my arithmetic, this is not correct.
> You should get "6!" after the third example too.
> The use of C-u clobbers last-prefix-arg, basically.
> 
> I believe this will fix it:

Thanks, I'm adding Stefan to this discussion.




This bug report was last modified 356 days ago.

Previous Next


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