emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: Christer =?utf-8?Q?Bor=C3=A4ng?= <mort@chalmers.se>
Cc: Orgmode <emacs-orgmode@gnu.org>, Xin Shi <shixin111@gmail.com>
Subject: Re: Org Agenda - revert all agenda files?
Date: Wed, 25 Jul 2012 11:39:00 -0400	[thread overview]
Message-ID: <3886.1343230740@alphaville> (raw)
In-Reply-To: Message from Christer =?utf-8?Q?Bor=C3=A4ng?= <mort@chalmers.se> of "Wed\, 25 Jul 2012 12\:52\:20 +0200." <10429.1343213540@chalmers.se>

Christer Boräng <mort@chalmers.se> wrote:

> In message <CAJN7d86LrDuFQibeTCh3g-WvgTk75ituqXccVf=Y1qDvWPPjRA@mail.gmail.com>
> , Xin Shi writes:
> >Hello Experts,
> 
> >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"?
> 
> Hi.
> 
> You could do what I do and run global-auto-revert-mode.
> 

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

  reply	other threads:[~2012-07-25 15:39 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 [this message]
2012-07-26  7:27     ` Carsten Dominik
2012-07-26 14:07       ` Nick Dokos
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

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3886.1343230740@alphaville \
    --to=nicholas.dokos@hp.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 public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).