From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#12872: 24.2; Provide a feature to trigger mode-line redisplay Date: Mon, 12 Nov 2012 21:46:26 +0200 Message-ID: <831ufywqnh.fsf@gnu.org> References: <837gpqwuai.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1352749608 21156 80.91.229.3 (12 Nov 2012 19:46:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 12 Nov 2012 19:46:48 +0000 (UTC) Cc: 12872@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Nov 12 20:46:58 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1TXzyA-0005Nr-4O for geb-bug-gnu-emacs@m.gmane.org; Mon, 12 Nov 2012 20:46:54 +0100 Original-Received: from localhost ([::1]:41775 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXzy0-0003FO-Hp for geb-bug-gnu-emacs@m.gmane.org; Mon, 12 Nov 2012 14:46:44 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:59516) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXzxw-0003Dz-6z for bug-gnu-emacs@gnu.org; Mon, 12 Nov 2012 14:46:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TXzxt-0002JH-4g for bug-gnu-emacs@gnu.org; Mon, 12 Nov 2012 14:46:40 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54006) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXzxt-0002JB-0q for bug-gnu-emacs@gnu.org; Mon, 12 Nov 2012 14:46:37 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TXzyI-0002NC-Bj for bug-gnu-emacs@gnu.org; Mon, 12 Nov 2012 14:47:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 12 Nov 2012 19:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12872 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 12872-submit@debbugs.gnu.org id=B12872.13527496019090 (code B ref 12872); Mon, 12 Nov 2012 19:47:02 +0000 Original-Received: (at 12872) by debbugs.gnu.org; 12 Nov 2012 19:46:41 +0000 Original-Received: from localhost ([127.0.0.1]:36023 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TXzxw-0002MZ-Qp for submit@debbugs.gnu.org; Mon, 12 Nov 2012 14:46:41 -0500 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:41001) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TXzxt-0002MQ-T8 for 12872@debbugs.gnu.org; Mon, 12 Nov 2012 14:46:39 -0500 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MDE00M00448LD00@a-mtaout20.012.net.il> for 12872@debbugs.gnu.org; Mon, 12 Nov 2012 21:46:10 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MDE00MQZ48Y7D70@a-mtaout20.012.net.il>; Mon, 12 Nov 2012 21:46:10 +0200 (IST) In-reply-to: <837gpqwuai.fsf@gnu.org> X-012-Sender: halo1@inter.net.il X-Spam-Score: 1.5 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-Spam-Score: 1.5 (+) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:66821 Archived-At: > From: "Drew Adams" > Cc: <12872@debbugs.gnu.org> > Date: Mon, 12 Nov 2012 11:07:11 -0800 > > > Would it be good enough to redisplay whenever point moves, and let > > your code you run from :eval decide whether the text on the mode line > > needs to be changed? I think this will be a more general solution. > > Yes, it would be good enough. > > But the advantage that I'm supposing %l has is that the line-counting is done in > C, as part of the display engine. What do you need the line number for, in your code? If you need it today, you are probably already calling something like what-line, because the mode line itself doesn't give you the line number back, right? You are aware that under certain conditions, the mode line can be redisplayed although point didn't move at all? > If my code had to check whether the line has changed then it would do that in > Lisp. Not saying that's a big deal. But it still looks to me like the %l > triggering is convenient. Yes, but you want to be independent of it, i.e. even when %l is not in the mode line format. > Perhaps the option could handle both cases: the general point-change case and > the more particular line-change case, depending on the option value? We could do that, yes. > BTW, why would this be a user option, rather than just a variable that code can > bind? The use case for users is not too clear to me. Yes, a variable sounds better. > Anyway, I don't have much to say about what should be done for this enhancement. Some wizardry with flags that control which redisplay optimizations can be used.