emacs-devel
[Top][All Lists]
Advanced

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

Re: Increasing the rate of modeline display


From: Eli Zaretskii
Subject: Re: Increasing the rate of modeline display
Date: Fri, 06 Mar 2015 12:20:01 +0200

> Date: Fri, 6 Mar 2015 06:12:27 -0300
> From: Artur Malabarba <address@hidden>
> Cc: emacs-devel <address@hidden>
> 
> I think I had my wording wrong. General redisplay works fine (I see
> the cursor blinking and stuff like that), but the mode-line content
> doesn't update if I'm not interacting.

Could be a bug: if the contents of mode line changes, Emacs should
redisplay it on the first opportunity.  But see below.

> > In particular, any time the mode line changes it will be redisplayed
> > immediately when Emacs has a chance to do so.  "Takes many seconds"
> > sounds like something I never saw, except when some Lisp code is
> > running during that time.
> 
> I ran the following after emacs -Q.
> 
> (add-to-list 'mode-line-format
>          '(:eval (number-to-string (cadr (current-time))))
>          'append)
> 
> This adds a number to the mode-line which changes at every second. If
> I'm typing text (or otherwise interacting) then I see it updating
> fine. If I just take my hands off the keyboard, then the number stops
> updating indefinitely.

How can Emacs know that the value of the eval form changed?  It can't,
unless it actually eval's it, can it?  When you type, Emacs eval's the
form because other factors cause it do it, that's why you see what you
see.  When nothing happens, Emacs doesn't know that anything on screen
should change, so it doesn't try to see whether the mode line changed,
and doesn't eval the form, because the display engine tries very hard
not to redisplay things that are unchanged, to avoid unpleasant
flickering this causes.

You will see that 'display-time', which does similar things, uses a
timer, which changes the mode-line contents independently of Emacs
recomputing it.

What real-life use case is behind your example?



reply via email to

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