From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Javier Oviedo" Newsgroups: gmane.emacs.help Subject: Re: reloading all open buffers Date: Mon, 8 Dec 2003 11:08:31 -0500 Organization: Texas Instruments Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <4yr7zfqsm1.fsf@skjellgran.ii.uib.no> NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1070900110 23760 80.91.224.253 (8 Dec 2003 16:15:10 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 8 Dec 2003 16:15:10 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Dec 08 17:15:07 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1ATO2N-00041O-00 for ; Mon, 08 Dec 2003 17:15:07 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1ATOz3-0004iw-Dc for geh-help-gnu-emacs@m.gmane.org; Mon, 08 Dec 2003 12:15:45 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!elnk-nf2-pas!elnk-pas-nf1!newsfeed.earthlink.net!west.cox.net!east.cox.net!filt01.cox.net!peer02.cox.net!cox.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!attdl1!attdl2!ip.att.net!news.ti.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 45 Original-NNTP-Posting-Host: gt64v7121.telogy.design.ti.com Original-X-Trace: home.itg.ti.com 1070899708 5430 158.218.103.164 (8 Dec 2003 16:08:28 GMT) Original-X-Complaints-To: usenet@news.ti.com Original-NNTP-Posting-Date: 8 Dec 2003 16:08:28 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Original-Xref: shelby.stanford.edu gnu.emacs.help:119111 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:15051 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:15051 I will give this a try. Thanks!! -- Javier "Joakim Hove" wrote in message news:4yr7zfqsm1.fsf@skjellgran.ii.uib.no... > > "Javier Oviedo" 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 / > \--------------------------------------------------------------------/