From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Org Agenda - revert all agenda files? Date: Wed, 25 Jul 2012 11:39:00 -0400 Message-ID: <3886.1343230740@alphaville> References: <10429.1343213540@chalmers.se> Reply-To: nicholas.dokos@hp.com Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:33486) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Su3gO-0007pP-W2 for emacs-orgmode@gnu.org; Wed, 25 Jul 2012 11:39:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Su3g5-0002yu-Kj for emacs-orgmode@gnu.org; Wed, 25 Jul 2012 11:39:28 -0400 Received: from g4t0014.houston.hp.com ([15.201.24.17]:38974) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Su3g5-0002vn-E9 for emacs-orgmode@gnu.org; Wed, 25 Jul 2012 11:39:09 -0400 In-Reply-To: Message from Christer =?us-ascii?Q?=3D=3Futf-8=3FQ=3FBor=3DC3?= =?us-ascii?Q?=3DA4ng=3F=3D?= of "Wed\, 25 Jul 2012 12\:52\:20 +0200." <10429.1343213540@chalmers.se> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Christer =?us-ascii?Q?=3D=3Futf-8=3FQ=3FBor=3DC3=3DA4ng=3F=3D?= Cc: Orgmode , Xin Shi Christer Bor=C3=A4ng wrote: > In message > , Xin Shi writes: > >Hello Experts, >=20 > >In the *Org Agenda* buffer, I usually use the key "r" to refresh the > >content. If some of the agenda files have change from the disk, it will = pop > >up the question in the mini-buffer to ask what to do. As I choose "r" to > >revert most of the time, and I have to do several times to revert all the > >related agenda files. I'm wondering if there is a command to revert all > >agenda files? Or "force revert"? >=20 > Hi. >=20 > You could do what I do and run global-auto-revert-mode. >=20 There are times when you might wish that you didn't use this: I have on some occasions mangled a file outside of emacs, but I still had the buffer with the all-important contents in emacs, so I was able to avert catastrophe: iiuc, global auto-revert would revert the buffer from the file on disk, eliminating the possibility of undoing the mistake. On the OP's question, I'd prefer a more targeted solution: something like this should work (very lightly tested - check the doc for revert-without-query if you want to modify the regexp): --8<---------------cut here---------------start------------->8--- (defun xin-shi-org-revert-agenda-buffers () (interactive) (mapcar (lambda (file) (let ((revert-without-query '(".*\.org$"))) (find-file file) (revert-buffer))) org-agenda-files)) --8<---------------cut here---------------end--------------->8--- Nick