From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Barry Margolin Newsgroups: gmane.emacs.help Subject: Re: How to update modelines of all displayed buffers Date: Thu, 15 Apr 2010 22:17:16 -0400 Organization: A noiseless patient Spider Message-ID: References: <87y6gor07c.fsf@linux-lqcw.site> NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1273007109 11326 80.91.229.12 (4 May 2010 21:05:09 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 4 May 2010 21:05:09 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue May 04 23:05:07 2010 connect(): No such file or directory Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O9PIg-0002w3-0Z for geh-help-gnu-emacs@m.gmane.org; Tue, 04 May 2010 23:05:06 +0200 Original-Received: from localhost ([127.0.0.1]:48117 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9PIf-0003um-BY for geh-help-gnu-emacs@m.gmane.org; Tue, 04 May 2010 17:05:05 -0400 Original-Path: usenet.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.straub-nv.de!feeder.eternal-september.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 38 Injection-Date: Fri, 16 Apr 2010 02:17:15 +0000 (UTC) Injection-Info: barmar.motzarella.org; posting-host="+bxBiZT/p0ZLLuDb5H+JCw"; logging-data="17369"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+LMsfUIoArooae2B/2uOzT" User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) Cancel-Lock: sha1:7vRqirQjacGbJq9GnVWJMD6vIx0= Original-Xref: usenet.stanford.edu gnu.emacs.help:177713 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:73166 Archived-At: In article <87y6gor07c.fsf@linux-lqcw.site>, Cecil Westerhof wrote: > I have defined the following function: > (defun buffer-update-mode-line () > (setq buffer-mode-line (buffer-mode-line-extra)) > (force-mode-line-update t)) > > The function buffer-mode-line-extra gives the extra data I want to > display in the modeline. What's the variable buffer-mode-line? I can't find it in the Emacs Lisp documentation, is it something you added? > > It is called every minute with: > (run-with-timer 60 60 'buffer-update-mode-line) > > With this only the modeline of the current buffer is updated. In > principal (force-mode-line-update t) makes all modelines updated, but > that will only work if for every (visible) buffer buffer-mode-line is > updated with the function buffer-mode-line-extra. Is there a way to get > this done? If buffer-mode-line is a buffer-local variable, you need to loop through all buffers, changing to each one and running your function. (defun update-mode-line-all-buffers () (save-current-buffer (dolist (b (buffer-list)) (set-buffer b) (buffer-update-mode-line)))) -- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me *** *** PLEASE don't copy me on replies, I'll read them in the group ***