bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#45999: 28.0.50; repeat does not work when saving files modified outs


From: Lars Ingebrigtsen
Subject: bug#45999: 28.0.50; repeat does not work when saving files modified outside emacs
Date: Tue, 07 Jun 2022 16:29:52 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Gabriel do Nascimento Ribeiro <gabriel376@hotmail.com> writes:

> 2) Problematic case:
> 2.1) Run 'emacs -q'
> 2.2) Open a file with 'C-x C-f'
> 2.3) Make some modification without saving the buffer
> 2.4) Edit the same file outside emacs (with another text editor or with
> shell command 'touch')
> 2.5) Save the buffer with 'C-x C-s'. You will see the message
> '<filename> has changed since visited or saved. Save anyway ?'. Type
> 'yes'
> 2.6)  Repeat last last command with 'C-x z'. You will see the message
> 'Repeating (find-file <path> t)' indicating that the last command before
> 'save-buffer' was repeated, which in this case was 'find-file' command
> with 'C-x C-f'. It's possible to test with some other command before saving
> the buffer to see what happens with the '(repeat)' command.

I can't reproduce this exactly -- in Emacs 29, `C-x z' executes
`exit-minibuffer', since that's the value of `last-repeatable-command'
after typing "yes".  (Most likely due to yes-or-no-p being reimplemented
as non-modal.)

I'm not at all familiar with how `last-repeatable-command' is supposed
to work -- it's just set from command_loop_1, and there's no blocklist
of commands or anything, so it seems like any commands that prompts with
yes-or-no-p/completing-read/etc aren't repeatable (now).

(defun foo ()
  (interactive)
  (yes-or-no-p "Foo")
  (message "%s" last-repeatable-command))

and examine 

last-repeatable-command

I guess a way to fix this would be to introduce a blocklist (containing
minibuffer-exit/self-insert-command/etc/etc), but I'm not sure how much
etc this would be.  Or perhaps there's a different way around this.

Any opinions?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

[Prev in Thread] Current Thread [Next in Thread]