unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: Why do idle timers trigger redisplay?
       [not found] <m2wpqa6ayz.wl%esq@lawlist.com>
@ 2016-02-12  8:25 ` Eli Zaretskii
  0 siblings, 0 replies; 3+ messages in thread
From: Eli Zaretskii @ 2016-02-12  8:25 UTC (permalink / raw)
  To: Keith David Bershatsky; +Cc: emacs-devel

> Date:  Thu, 11 Feb 2016 16:14:44 -0800
> From:  Keith David Bershatsky <esq@lawlist.com>
> Cc:  22404@debbugs.gnu.org
> 
> Question, please:  Is it a necessary evil that the `timer-idle-list` must always trigger a redisplay?

Emacs does another redisplay cycle each time there was some kind of
input.  The logic of this is that any input could potentially affect
what is displayed (the job of figuring out what, if anything, does
need to be redrawn is integral part of what redisplay does, and it
might as well conclude that no redisplay is actually needed).

Code run by timers is one such kind of input, since any code run by
timers runs with the purpose of doing something with Emacs data:
buffers, strings, windows, frames, etc.

Other kinds of input include: keyboard input, input from subprocesses,
mouse gestures, events that come from sources like D-bus and file
notifications, etc.  They all cause a cycle of redisplay.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Why do idle timers trigger redisplay?
@ 2016-02-12 16:38 Keith David Bershatsky
  2016-02-14 13:51 ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: Keith David Bershatsky @ 2016-02-12 16:38 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Thank you, Eli, for helping me to better understand why code run by timers is considered input that triggers redisplay (which in turn figures out what to do).

As always, your tutoring is greatly appreciated.

Keith

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

At Fri, 12 Feb 2016 10:25:51 +0200,
Eli Zaretskii wrote:
> 
> > Date:  Thu, 11 Feb 2016 16:14:44 -0800
> > From:  Keith David Bershatsky <esq@lawlist.com>
> > 
> > Question, please:  Is it a necessary evil that the `timer-idle-list` must always trigger a redisplay?
> 
> Emacs does another redisplay cycle each time there was some kind of
> input.  The logic of this is that any input could potentially affect
> what is displayed (the job of figuring out what, if anything, does
> need to be redrawn is integral part of what redisplay does, and it
> might as well conclude that no redisplay is actually needed).
> 
> Code run by timers is one such kind of input, since any code run by
> timers runs with the purpose of doing something with Emacs data:
> buffers, strings, windows, frames, etc.
> 
> Other kinds of input include: keyboard input, input from subprocesses,
> mouse gestures, events that come from sources like D-bus and file
> notifications, etc.  They all cause a cycle of redisplay.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Why do idle timers trigger redisplay?
  2016-02-12 16:38 Why do idle timers trigger redisplay? Keith David Bershatsky
@ 2016-02-14 13:51 ` Stefan Monnier
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2016-02-14 13:51 UTC (permalink / raw)
  To: emacs-devel

> Thank you, Eli, for helping me to better understand why code run by timers
> is considered input that triggers redisplay (which in turn figures out what
> to do).

Presumably idle timers have effects (their return value is ignored, so
if they have no effect they're useless).  So they may change buffers or
elements that affect the mode-line.  So a redisplay cycle needs to be
triggered after running them.


        Stefan




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-02-14 13:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-12 16:38 Why do idle timers trigger redisplay? Keith David Bershatsky
2016-02-14 13:51 ` Stefan Monnier
     [not found] <m2wpqa6ayz.wl%esq@lawlist.com>
2016-02-12  8:25 ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).