From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Org Agenda - revert all agenda files? Date: Thu, 26 Jul 2012 10:07:29 -0400 Message-ID: <10619.1343311649@alphaville> References: <10429.1343213540@chalmers.se> <3886.1343230740@alphaville> <231F203A-2C16-4EF8-98E5-9ED5513D7AB0@gmail.com> Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([208.118.235.92]:56549) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuOj5-0003T6-68 for emacs-orgmode@gnu.org; Thu, 26 Jul 2012 10:07:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SuOiy-00041D-UY for emacs-orgmode@gnu.org; Thu, 26 Jul 2012 10:07:39 -0400 Received: from g6t0187.atlanta.hp.com ([15.193.32.64]:30388) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuOiy-00040o-PU for emacs-orgmode@gnu.org; Thu, 26 Jul 2012 10:07:32 -0400 In-Reply-To: Message from Carsten Dominik of "Thu, 26 Jul 2012 09:27:05 +0200." <231F203A-2C16-4EF8-98E5-9ED5513D7AB0@gmail.com> 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: Carsten Dominik Cc: Orgmode , Xin Shi , =?us-ascii?Q?Christer_=3D=3Futf-8=3FQ=3FBor=3DC3=3DA4ng=3F=3D?= Carsten Dominik wrote: > > On 25 jul 2012, at 17:39, Nick Dokos wrote: > > > ... > > 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--- > > > The variable org-agenda-files can also contain directories. Therefore > you should use the function call > > (org-agenda-files t) > > to get a list of the files. The t means, even if the agenda > is currently restricted, get all files. > Thanks - I forgot all about that. > Another improvement to this function would be to limit it > to files currently visited - but I guess this is a minor issue > as the next agenda command will visit all those files anyway. > Yes, I thought about that and decided it wasn't worth worrying about. As Kernighan and Plauger say: first get it right, then make it fast; and as we just saw, it wasn't right :-). But for typical setups - a few files or a few dozen files - I don't think it's going to make much difference. OTOH, if one has thousands of agenda files, then one probably has much worse problems than this. Nick