[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to update modelines of all displayed buffers
From: |
José A . Romero L . |
Subject: |
Re: How to update modelines of all displayed buffers |
Date: |
Tue, 04 May 2010 15:44:51 -0000 |
User-agent: |
G2/1.0 |
On 16 Kwi, 09:19, Cecil Westerhof <Ce...@decebal.nl> wrote:
(...)
> > (defun update-mode-line-all-buffers ()
> > (save-current-buffer
> > (dolist (b (buffer-list))
> > (set-buffer b)
> > (buffer-update-mode-line))))
>
> This does all buffers. Is it possible to do it only for displayed
> buffers?
(...)
You could try something like this:
(mapc
(lambda (b) (set-buffer b) (buffer-update-mode-line))
(delete-dups
(mapcar 'window-buffer
(apply 'append
(mapcar 'window-list (frame-list))))))
though if you refactored your buffer-update-mode-line to accept the
buffer as parameter you could write this a bit more elegantly:
(mapc 'buffer-update-mode-line
(delete-dups
(mapcar 'window-buffer
(apply 'append
(mapcar 'window-list (frame-list))))))
Cheers,
--
José A. Romero L.
escherdragon at gmail
"We who cut mere stones must always be envisioning cathedrals."
(Quarry worker's creed)