all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: bruce.connor.am@gmail.com
Cc: emacs-devel@gnu.org
Subject: Re: Increasing the rate of modeline display
Date: Fri, 06 Mar 2015 12:20:01 +0200	[thread overview]
Message-ID: <83fv9io2b2.fsf@gnu.org> (raw)
In-Reply-To: <CAAdUY-K0PrQo6OoRYP_EX0f3MNFchRH=2DDR9N6nWq+fh=5G2g@mail.gmail.com>

> Date: Fri, 6 Mar 2015 06:12:27 -0300
> From: Artur Malabarba <bruce.connor.am@gmail.com>
> Cc: emacs-devel <emacs-devel@gnu.org>
> 
> 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?



  parent reply	other threads:[~2015-03-06 10:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAAdUY-LLaSjRgx3FXi1OdrhS6EgBkhrLknjBW5EKMdhuHAJUeA@mail.gmail.com>
2015-03-05 20:24 ` Increasing the rate of modeline display Artur Malabarba
2015-03-06  8:04   ` Eli Zaretskii
2015-03-06  8:50     ` Artur Malabarba
2015-03-06  9:12     ` Artur Malabarba
2015-03-06  9:13       ` Artur Malabarba
2015-03-06 10:20       ` Eli Zaretskii [this message]
2015-03-06 11:20         ` Artur Malabarba
2015-03-06 11:34           ` Eli Zaretskii
2015-03-06 13:24           ` Thien-Thi Nguyen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83fv9io2b2.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=bruce.connor.am@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.