From: Nick Dokos <nicholas.dokos@hp.com>
To: Carsten Dominik <carsten.dominik@gmail.com>
Cc: Orgmode <emacs-orgmode@gnu.org>, "Xin Shi" <shixin111@gmail.com>,
Christer =?utf-8?Q?Bor=C3=A4ng?= <mort@chalmers.se>
Subject: Re: Org Agenda - revert all agenda files?
Date: Thu, 26 Jul 2012 10:07:29 -0400 [thread overview]
Message-ID: <10619.1343311649@alphaville> (raw)
In-Reply-To: Message from Carsten Dominik <carsten.dominik@gmail.com> of "Thu, 26 Jul 2012 09:27:05 +0200." <231F203A-2C16-4EF8-98E5-9ED5513D7AB0@gmail.com>
Carsten Dominik <carsten.dominik@gmail.com> 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
next prev parent reply other threads:[~2012-07-26 14:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-25 8:09 Org Agenda - revert all agenda files? Xin Shi
2012-07-25 8:18 ` Giovanni Ridolfi
2012-07-25 8:28 ` Xin Shi
2012-07-25 10:52 ` Christer Boräng
2012-07-25 15:39 ` Nick Dokos
2012-07-26 7:27 ` Carsten Dominik
2012-07-26 14:07 ` Nick Dokos [this message]
2012-07-26 21:32 ` Carsten Dominik
2012-07-30 11:26 ` Xin Shi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=10619.1343311649@alphaville \
--to=nicholas.dokos@hp.com \
--cc=carsten.dominik@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=mort@chalmers.se \
--cc=shixin111@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.