emacs-devel
[Top][All Lists]
Advanced

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

Re: Fwd: idle exit hook


From: Ergus
Subject: Re: Fwd: idle exit hook
Date: Thu, 23 Jul 2020 00:00:24 +0200
User-agent: NeoMutt/20180716

On Wed, Jul 22, 2020 at 04:59:24PM +0300, Eli Zaretskii wrote:
Date: Wed, 22 Jul 2020 13:32:42 +0200
From: Ergus <spacibba@aol.com>

Is there an idle-time-exit-hook? or, what's the canonical method to call
a function after breaking an idle? something like on-idle-exit?

How do you define "breaking the idle"?  IOW, what events or activities
will potentially be considered as "breaking the idle"?

Hi Eli:

When I say "breaking the idle" I mean any event that potentially could
be considered as not in idle anymore... or anything that resets the idle
counter.

The idea came to me when trying to implement my own version of
idle-highlight-mode to propose to add it to vanilla. I would like to
provide a different behaviour.

Not sure why you need a new hook for implementing that behavior.
maybe tell more details about what you intend to implement.

The idea is extremely simple (that's why I thing it could be in
vanilla). When in idle for some seconds a run-with-idle-timer calls a
function to set a highlight for thing-at-point. (useful when
programming for example)

https://github.com/nonsequitur/idle-highlight-mode/blob/master/idle-highlight-mode.el

The problem with the original implementation (apart from being abandon
and re-implemented by many packages and configuration) is that the
unhighlight function is called only when the idled function is executed
again.

A more common behavior (as in vs-code, atom and so on) is that when we
press any key o perform any action to exit the "highlighted thing"; the
highlight disappears immediately.

This could be performed using a different hook, (post-command-hook) but
it will require add and remove the hook constantly...

WDYT?
Best
Ergus


reply via email to

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