From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mirko Newsgroups: gmane.emacs.help Subject: Re: elisp: how to detect if a file has changed on disk Date: Tue, 16 Dec 2008 16:41:10 -0800 (PST) Organization: http://groups.google.com Message-ID: <44598eb7-ce11-4482-89d2-fc936f87899f@q30g2000vbn.googlegroups.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1229478057 26925 80.91.229.12 (17 Dec 2008 01:40:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 17 Dec 2008 01:40:57 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Dec 17 02:42:02 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LClQH-0002jB-4m for geh-help-gnu-emacs@m.gmane.org; Wed, 17 Dec 2008 02:42:01 +0100 Original-Received: from localhost ([127.0.0.1]:49986 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LClP5-0003Qo-5C for geh-help-gnu-emacs@m.gmane.org; Tue, 16 Dec 2008 20:40:47 -0500 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!q30g2000vbn.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 37 Original-NNTP-Posting-Host: 208.218.238.20 Original-X-Trace: posting.google.com 1229474470 11255 127.0.0.1 (17 Dec 2008 00:41:10 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Wed, 17 Dec 2008 00:41:10 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: q30g2000vbn.googlegroups.com; posting-host=208.218.238.20; posting-account=yS7ZzQoAAACbDncxMo9UeCyhsLtcDWPM User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4,gzip(gfe),gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:165379 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:60708 Archived-At: On Dec 16, 5:51=A0pm, "Peter Milliken" wrote: > See section 27.6 of the Elisp Manual (comparison of modification time). > > See also 26.3 (Reverting) for reverting mechanisms. > > Pete > > On Wed, Dec 17, 2008 at 1:03 AM, Mirko wrote: > > Hello, > > > I use emacs on my desktop and laptop, and unison to synchronize > > modified files between the machines. > > > But that means that after synchronization, some of the files that a > > buffer is visiting will change, and I will have to revert the buffer. > > I would like to automatically revert all such buffers. =A0What function > > can I use to test whether a the file that a buffer is visiting has > > changed? > > > Thanks, > > > Mirko > > Thank you: (defun revert-buffers () "Loop over all buffers with modified files and offer to revert them" (interactive) (save-excursion (dolist (buffer (buffer-list)) (unless (verify-visited-file-modtime buffer) (set-buffer buffer) (revert-buffer))))) Mirko