unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#38642: 'C-x RET c' gets stuck in universal-argument loop
@ 2019-12-16 21:56 Juri Linkov
  2019-12-16 23:07 ` Andreas Schwab
  0 siblings, 1 reply; 9+ messages in thread
From: Juri Linkov @ 2019-12-16 21:56 UTC (permalink / raw)
  To: 38642

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.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#38642: 'C-x RET c' gets stuck in universal-argument loop
  2019-12-16 21:56 bug#38642: 'C-x RET c' gets stuck in universal-argument loop Juri Linkov
@ 2019-12-16 23:07 ` Andreas Schwab
  2019-12-17 16:11   ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Andreas Schwab @ 2019-12-16 23:07 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 38642, Stefan Monnier

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@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#38642: 'C-x RET c' gets stuck in universal-argument loop
  2019-12-16 23:07 ` Andreas Schwab
@ 2019-12-17 16:11   ` Eli Zaretskii
  2019-12-20 22:52     ` Stefan Monnier
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2019-12-17 16:11 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: 38642, monnier, juri

> From: Andreas Schwab <schwab@linux-m68k.org>
> Date: Tue, 17 Dec 2019 00:07:25 +0100
> Cc: 38642@debbugs.gnu.org, Stefan Monnier <monnier@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





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#38642: 'C-x RET c' gets stuck in universal-argument loop
  2019-12-17 16:11   ` Eli Zaretskii
@ 2019-12-20 22:52     ` Stefan Monnier
  2019-12-21  7:10       ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2019-12-20 22:52 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Andreas Schwab, 38642-done, juri

> 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






^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#38642: 'C-x RET c' gets stuck in universal-argument loop
  2019-12-20 22:52     ` Stefan Monnier
@ 2019-12-21  7:10       ` Eli Zaretskii
  2019-12-23 21:09         ` Stefan Monnier
  2020-01-19 22:11         ` Stefan Monnier
  0 siblings, 2 replies; 9+ messages in thread
From: Eli Zaretskii @ 2019-12-21  7:10 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: schwab, 38642, juri

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: Andreas Schwab <schwab@linux-m68k.org>,  juri@linkov.net,
>   38642-done@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.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#38642: 'C-x RET c' gets stuck in universal-argument loop
  2019-12-21  7:10       ` Eli Zaretskii
@ 2019-12-23 21:09         ` Stefan Monnier
  2020-01-19 22:11         ` Stefan Monnier
  1 sibling, 0 replies; 9+ messages in thread
From: Stefan Monnier @ 2019-12-23 21:09 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: schwab, 38642, juri

> 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






^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#38642: 'C-x RET c' gets stuck in universal-argument loop
  2019-12-21  7:10       ` Eli Zaretskii
  2019-12-23 21:09         ` Stefan Monnier
@ 2020-01-19 22:11         ` Stefan Monnier
  2020-01-20 16:24           ` Eli Zaretskii
  1 sibling, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2020-01-19 22:11 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: schwab, 38642-done, juri

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

Done,


        Stefan






^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#38642: 'C-x RET c' gets stuck in universal-argument loop
  2020-01-19 22:11         ` Stefan Monnier
@ 2020-01-20 16:24           ` Eli Zaretskii
  2020-01-20 17:01             ` Stefan Monnier
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2020-01-20 16:24 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: schwab, 38642, juri

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: schwab@linux-m68k.org,  juri@linkov.net,  38642-done@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?





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#38642: 'C-x RET c' gets stuck in universal-argument loop
  2020-01-20 16:24           ` Eli Zaretskii
@ 2020-01-20 17:01             ` Stefan Monnier
  0 siblings, 0 replies; 9+ messages in thread
From: Stefan Monnier @ 2020-01-20 17:01 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: schwab, 38642, juri

> 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






^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-01-20 17:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-16 21:56 bug#38642: 'C-x RET c' gets stuck in universal-argument loop Juri Linkov
2019-12-16 23:07 ` Andreas Schwab
2019-12-17 16:11   ` Eli Zaretskii
2019-12-20 22:52     ` Stefan Monnier
2019-12-21  7:10       ` Eli Zaretskii
2019-12-23 21:09         ` Stefan Monnier
2020-01-19 22:11         ` Stefan Monnier
2020-01-20 16:24           ` Eli Zaretskii
2020-01-20 17:01             ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).