From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Org Agenda - revert all agenda files? Date: Thu, 26 Jul 2012 23:32:20 +0200 Message-ID: <51FFFFFB-B4DC-47BC-84C8-34A1D5A8F250@gmail.com> References: <10429.1343213540@chalmers.se> <3886.1343230740@alphaville> <231F203A-2C16-4EF8-98E5-9ED5513D7AB0@gmail.com> Reply-To: nicholas.dokos@hp.com Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:53286) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuVfV-0005iD-6K for emacs-orgmode@gnu.org; Thu, 26 Jul 2012 17:32:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SuVfT-0008B3-R4 for emacs-orgmode@gnu.org; Thu, 26 Jul 2012 17:32:25 -0400 Received: from mail-wi0-f171.google.com ([209.85.212.171]:65391) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuVfT-0008AT-KK for emacs-orgmode@gnu.org; Thu, 26 Jul 2012 17:32:23 -0400 Received: by wibhq4 with SMTP id hq4so5543713wib.12 for ; Thu, 26 Jul 2012 14:32:22 -0700 (PDT) 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. Uhhh, yes, indeed! - Carsten Nick