From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Increasing the rate of modeline display Date: Fri, 06 Mar 2015 12:20:01 +0200 Message-ID: <83fv9io2b2.fsf@gnu.org> References: <83oao6o8k8.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1425637221 18820 80.91.229.3 (6 Mar 2015 10:20:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 6 Mar 2015 10:20:21 +0000 (UTC) Cc: emacs-devel@gnu.org To: bruce.connor.am@gmail.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Mar 06 11:20:12 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YTpMZ-0000R9-HE for ged-emacs-devel@m.gmane.org; Fri, 06 Mar 2015 11:20:11 +0100 Original-Received: from localhost ([::1]:57215 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTpMY-0006Oc-RY for ged-emacs-devel@m.gmane.org; Fri, 06 Mar 2015 05:20:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51294) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTpMV-0006L4-Ur for emacs-devel@gnu.org; Fri, 06 Mar 2015 05:20:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YTpMQ-000487-Pu for emacs-devel@gnu.org; Fri, 06 Mar 2015 05:20:07 -0500 Original-Received: from mtaout25.012.net.il ([80.179.55.181]:52253) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTpMQ-00042k-J3 for emacs-devel@gnu.org; Fri, 06 Mar 2015 05:20:02 -0500 Original-Received: from conversion-daemon.mtaout25.012.net.il by mtaout25.012.net.il (HyperSendmail v2007.08) id <0NKS00J00C608J00@mtaout25.012.net.il> for emacs-devel@gnu.org; Fri, 06 Mar 2015 12:14:40 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout25.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NKS00BG7CGGYV80@mtaout25.012.net.il>; Fri, 06 Mar 2015 12:14:40 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.179.55.181 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:183694 Archived-At: > Date: Fri, 6 Mar 2015 06:12:27 -0300 > From: Artur Malabarba > Cc: emacs-devel > > 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?