[Top][All Lists]

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

Re: Support for explicitly resetting the idle timer?

From: Campbell Barton
Subject: Re: Support for explicitly resetting the idle timer?
Date: Sat, 27 Nov 2021 20:14:44 +1100

On Sat, Nov 27, 2021 at 8:01 PM Eli Zaretskii <eliz@gnu.org> wrote:
> > From: Campbell Barton <ideasman42@gmail.com>
> > Date: Sat, 27 Nov 2021 19:42:15 +1100
> > Cc: Emacs developers <emacs-devel@gnu.org>
> >
> > > The cleanest solution in this case would be to call timer_stop_idle if
> > > Emacs is executing a command, no matter how it was invoked.  In fact,
> > > I'm surprised that we don't stop idle timers when track-mouse invokes
> > > commands: it sounds like a bug we should fix.
> >
> > Not sure if this would solve my case (is there some formal definition
> > of what is meant by a command?).
> > I'm changing the scroll position using `set-window-vscroll` - so I'm
> > not sure if that counts as a command.
> Which code invokes set-window-vscroll, and what triggers that code?

There is a while loop that uses  (read-event) inside a `(track-mouse
...)` block that changes the scroll location and redraws.

(any solution shouldn't be so specific to my use-case of course,
AFAICS it's just a case that is reasonable to support with whatever
fix/feature is used).

> > As a workaround it may be possible to define a dummy command that does
> > nothing but reset the idle timer.
> Btw, what do you mean by "reset" here?  timer_stop_idle has a
> counterpart, timer_resume_idle.

I've probably misunderstood the purpose of this function, I only meant
to reset the idle timer (as already happens when a key has been

> Would the resumption work under your proposal, and if so, how?

Yes, resuming is would be fine,
I considered some alternative solution too, e.g. a
`(without-idle-timers ...)` macro - which would be useful in my case -
but doesn't seem necessary if the idle timer can be reset either
explicitly or automatically in more cases than it is currently being
- Campbell

reply via email to

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