help-gnu-emacs
[Top][All Lists]
Advanced

[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" <address@hidden> wrote in message
news:address@hidden
>
> "Javier Oviedo" <address@hidden> 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  / address@hidden  /  (55 5) 84076       |                 \
>  | Unifob AS, Avdeling for Beregningsvitenskap (BCCS) | Stabburveien 18 |
>  | CMU                                                | 5231 Paradis    |
>  \ Thormøhlensgt.55, 5020 Bergen.                     | 55 91 28 18     /
>   \--------------------------------------------------------------------/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]