[Top][All Lists]

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

Re: Function write-region resets idle time

From: Cecil Westerhof
Subject: Re: Function write-region resets idle time
Date: Thu, 11 Jan 2018 20:14:15 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

>> From: Cecil Westerhof <address@hidden>
>> Date: Thu, 11 Jan 2018 18:43:53 +0100
>> I found a strange problem: write-region resets idle-time. But only
>> after the calling function has returned.
> ??? Any Lisp you run resets idle-time.  Idleness starts when Emacs
> gets to its command loop and finds that there's no pending input.  It
> ends when there's some input event that causes the command loop to run
> the Lisp interpreter.  In your case, the input event is supplied by
> the timer you set up.
> So why is what you discovered surprising, let alone a problem?  Am I
> missing something?

The definition of idle:
    Emacs becomes idle when it starts waiting for user input, and it
    remains idle until the user provides some input. If a timer is set
    for five seconds of idleness, it runs approximately five seconds
    after Emacs first becomes idle.

And to make it even more clear:
    Even if repeat is non-nil, this timer will not run again as long
    as Emacs remains idle, because the duration of idleness will
    continue to increase and will not go down to five seconds again.

So the running of the function should NOT reset idle time.

The behaviour changed (for me) on the 19th of December.

And if what you say would be true: then there should be also no
difference if my function uses write-region or not. But there is.
Without write-region idle time is NOT reset. With write-region
idle-time IS reset.

I certainly find it surprising that write-region does something else
as all other functions with idle time.

Cecil Westerhof
Senior Software Engineer

reply via email to

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