GNU bug report logs - #38642
'C-x RET c' gets stuck in universal-argument loop

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Mon, 16 Dec 2019 22:53:01 UTC

Severity: normal

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 38642 in the body.
You can then email your comments to 38642 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#38642; Package emacs. (Mon, 16 Dec 2019 22:53:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Juri Linkov <juri <at> linkov.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 16 Dec 2019 22:53:01 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 'C-x RET c' gets stuck in universal-argument loop
Date: Mon, 16 Dec 2019 23:56:08 +0200
emacs -Q
C-x RET c       ;; universal-coding-system-argument
RET             ;; accept default e.g. utf-8-unix
C-u C-b         ;; moves backwards 4 chars
C-b C-b C-b ...

Every C-b still moves backwards 4 chars because it gets stuck with an old
'prefix-arg' in the 'while' loop in 'universal-coding-system-argument'.

It gets out of this loop only on an error such as when point reaches
the beginning of the buffer that signals an error.

PS: this is the simplest reproducible case, but I found this bug
by trying to use 'C-x RET c C-u C-u M-x rgrep' that with two C-u prefixes
allows editing the grep command.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38642; Package emacs. (Mon, 16 Dec 2019 23:08:01 GMT) Full text and rfc822 format available.

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

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 38642 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#38642: 'C-x RET c' gets stuck in universal-argument loop
Date: Tue, 17 Dec 2019 00:07:25 +0100
On Dez 16 2019, Juri Linkov wrote:

> emacs -Q
> C-x RET c       ;; universal-coding-system-argument
> RET             ;; accept default e.g. utf-8-unix
> C-u C-b         ;; moves backwards 4 chars
> C-b C-b C-b ...
>
> Every C-b still moves backwards 4 chars because it gets stuck with an old
> 'prefix-arg' in the 'while' loop in 'universal-coding-system-argument'.

It makes assumptions about universal-argument-map that are no longer
true since commit 02ef6c1a8a.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38642; Package emacs. (Tue, 17 Dec 2019 16:13:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: 38642 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca, juri <at> linkov.net
Subject: Re: bug#38642: 'C-x RET c' gets stuck in universal-argument loop
Date: Tue, 17 Dec 2019 18:11:48 +0200
> From: Andreas Schwab <schwab <at> linux-m68k.org>
> Date: Tue, 17 Dec 2019 00:07:25 +0100
> Cc: 38642 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
> 
> > emacs -Q
> > C-x RET c       ;; universal-coding-system-argument
> > RET             ;; accept default e.g. utf-8-unix
> > C-u C-b         ;; moves backwards 4 chars
> > C-b C-b C-b ...
> >
> > Every C-b still moves backwards 4 chars because it gets stuck with an old
> > 'prefix-arg' in the 'while' loop in 'universal-coding-system-argument'.
> 
> It makes assumptions about universal-argument-map that are no longer
> true since commit 02ef6c1a8a.

Stefan, any ideas for how to fix this unintended consequence?

TIA




Reply sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
You have taken responsibility. (Fri, 20 Dec 2019 22:53:01 GMT) Full text and rfc822 format available.

Notification sent to Juri Linkov <juri <at> linkov.net>:
bug acknowledged by developer. (Fri, 20 Dec 2019 22:53:02 GMT) Full text and rfc822 format available.

Message #16 received at 38642-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 38642-done <at> debbugs.gnu.org, Andreas Schwab <schwab <at> linux-m68k.org>,
 juri <at> linkov.net
Subject: Re: bug#38642: 'C-x RET c' gets stuck in universal-argument loop
Date: Fri, 20 Dec 2019 17:52:17 -0500
> Stefan, any ideas for how to fix this unintended consequence?

I installed a patch which seems to fix it.  We should rewrite this
function completely, but I tried to minimize the changes for now.


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38642; Package emacs. (Sat, 21 Dec 2019 07:11:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 38642 <at> debbugs.gnu.org, schwab <at> linux-m68k.org, juri <at> linkov.net
Subject: Re: bug#38642: 'C-x RET c' gets stuck in universal-argument loop
Date: Sat, 21 Dec 2019 09:10:35 +0200
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: Andreas Schwab <schwab <at> linux-m68k.org>,  juri <at> linkov.net,
>   38642-done <at> debbugs.gnu.org
> Date: Fri, 20 Dec 2019 17:52:17 -0500
> 
> > Stefan, any ideas for how to fix this unintended consequence?
> 
> I installed a patch which seems to fix it.  We should rewrite this
> function completely, but I tried to minimize the changes for now.

Thanks.  I think a more radical change could be installed after the
release branch is cut.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38642; Package emacs. (Mon, 23 Dec 2019 21:11:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 38642 <at> debbugs.gnu.org, schwab <at> linux-m68k.org, juri <at> linkov.net
Subject: Re: bug#38642: 'C-x RET c' gets stuck in universal-argument loop
Date: Mon, 23 Dec 2019 16:09:51 -0500
> Thanks.  I think a more radical change could be installed after the
> release branch is cut.

I have a completely different implementation here, but I'll wait some
more to install it on `master` so the Emacs-27 gets more testing.


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38642; Package emacs. (Sun, 19 Jan 2020 22:12:02 GMT) Full text and rfc822 format available.

Message #25 received at 38642-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 38642-done <at> debbugs.gnu.org, schwab <at> linux-m68k.org, juri <at> linkov.net
Subject: Re: bug#38642: 'C-x RET c' gets stuck in universal-argument loop
Date: Sun, 19 Jan 2020 17:11:26 -0500
> Thanks.  I think a more radical change could be installed after the
> release branch is cut.

Done,


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38642; Package emacs. (Mon, 20 Jan 2020 16:26:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 38642 <at> debbugs.gnu.org, schwab <at> linux-m68k.org, juri <at> linkov.net
Subject: Re: bug#38642: 'C-x RET c' gets stuck in universal-argument loop
Date: Mon, 20 Jan 2020 18:24:58 +0200
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: schwab <at> linux-m68k.org,  juri <at> linkov.net,  38642-done <at> debbugs.gnu.org
> Date: Sun, 19 Jan 2020 17:11:26 -0500
> 
> > Thanks.  I think a more radical change could be installed after the
> > release branch is cut.
> 
> Done,

Thanks, but this:

        (remove-hook 'pre-command-hook #'mule-cmds--prefixed-command)

should be

        (remove-hook 'pre-command-hook #'mule-cmds--prefixed-command-pch)

right?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38642; Package emacs. (Mon, 20 Jan 2020 17:02:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 38642 <at> debbugs.gnu.org, schwab <at> linux-m68k.org, juri <at> linkov.net
Subject: Re: bug#38642: 'C-x RET c' gets stuck in universal-argument loop
Date: Mon, 20 Jan 2020 12:01:03 -0500
> Thanks, but this:
>
>         (remove-hook 'pre-command-hook #'mule-cmds--prefixed-command)
>
> should be
>
>         (remove-hook 'pre-command-hook #'mule-cmds--prefixed-command-pch)
>
> right?

Duh!  Even the byte-compiler noticed it for me.  Not sure how I missed it.
Thanks,


        Stefan





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 18 Feb 2020 12:24:04 GMT) Full text and rfc822 format available.

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

Previous Next


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