all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Barry Margolin <barmar@alum.mit.edu>
To: help-gnu-emacs@gnu.org
Subject: Re: How to update modelines of all displayed buffers
Date: Thu, 15 Apr 2010 22:17:16 -0400	[thread overview]
Message-ID: <barmar-A88AB4.22171615042010@news.eternal-september.org> (raw)
In-Reply-To: 87y6gor07c.fsf@linux-lqcw.site

In article <87y6gor07c.fsf@linux-lqcw.site>,
 Cecil Westerhof <Cecil@decebal.nl> 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 ***


  reply	other threads:[~2010-04-16  2:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-15 19:21 How to update modelines of all displayed buffers Cecil Westerhof
2010-04-16  2:17 ` Barry Margolin [this message]
2010-04-16  7:19   ` Cecil Westerhof
2010-04-16 21:58     ` José A. Romero L.
2010-04-16 22:49 ` Andreas Politz

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=barmar-A88AB4.22171615042010@news.eternal-september.org \
    --to=barmar@alum.mit.edu \
    --cc=help-gnu-emacs@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.