[Top][All Lists]

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

Re: Q: How to programatically terminate repeat-mode

From: Juri Linkov
Subject: Re: Q: How to programatically terminate repeat-mode
Date: Mon, 03 Oct 2022 09:56:32 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)

> Replacing the earlier (push 7 unread-command-events)
> with
> (when repeat-exit-timer
>       (timer-set-idle-time repeat-exit-timer 0))
> in my disable-repeat function that I called from the process-sentinel of
> the media player -- with check for exit as the guard condition has no
> effect and the repeat remains in effect.

Maybe you are starting multiple timers?  Currently repeat-mode cancels
all previously started timers, but unfortunately cancel-timer for
repeat-exit-timer doesn't run its timer function that should exit
the repeat map.  I propose to add a new optional argument RUN-FUNCTION
to cancel-timer, that will run the timer function after canceling the timer.
This means copying this part of timer-event-handler to cancel-timer:

    (apply (timer--function timer) (timer--args timer)))

reply via email to

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