[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: reloading all open buffers
From: |
Javier Oviedo |
Subject: |
Re: reloading all open buffers |
Date: |
Mon, 8 Dec 2003 11:08:31 -0500 |
I will give this a try. Thanks!!
--
Javier
"Joakim Hove" <hove@bccs.no> wrote in message
4yr7zfqsm1.fsf@skjellgran.ii.uib.no">news:4yr7zfqsm1.fsf@skjellgran.ii.uib.no...
>
> "Javier Oviedo" <email_joviedo@yahoo.com> writes:
>
> > Hello all. I like to call a function that would "reload" all buffers
that I
> > have open...with the exception of buffers that have been modified but
not
> > yet saved. Can someone help me out with this? Thanks in advance.
>
> This is at least a start:
>
> (defun reload-all-buffers ()
> (interactive)
> (dolist (buffer (buffer-list))
> (if (and (buffer-file-name buffer) ;; Ignoring buffers like
*scratch* and *Messages*
> (not (buffer-modified-p buffer))) ;; Ignoring buffers which have
been modified
> (let ((file (buffer-file-name buffer)))
> (if (file-exists-p file) ;; Checking that the file still
exists
> (save-excursion
> (set-buffer buffer)
> (revert-buffer t t)))))))
>
>
> HTH - Joakim
>
> --
> /--------------------------------------------------------------------\
> / Joakim Hove / hove@bccs.no / (55 5) 84076 | \
> | Unifob AS, Avdeling for Beregningsvitenskap (BCCS) | Stabburveien 18 |
> | CMU | 5231 Paradis |
> \ Thormøhlensgt.55, 5020 Bergen. | 55 91 28 18 /
> \--------------------------------------------------------------------/