emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Takafumi Arakaki <aka.tkf@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: Old entry remains in appt when the original one in org file is changed
Date: Tue, 17 Jan 2012 08:02:26 +0100	[thread overview]
Message-ID: <CAPM+gBTxUjnjqTQNtG1WG1N7U4Bm+_h+vaWO-2YL9wc2nW8zDA@mail.gmail.com> (raw)
In-Reply-To: <877h0sxt68.fsf@norang.ca>

Hi Bernt,

Thanks for your setup recipe. However, I noticed I failed to explain
what I meant; the old entry remains in appt-time-msg-list even if you
call org-agenda-to-appt.

So, the procedure to reproduce my problem is the following:


1. Add the following in the agenda file

* TODO test
 SCHEDULED: <2012-01-14 Sat 12:00>

2. Call org-agenda-to-appt

3. Change the SCHEDULED time-stamp in the entry like this

* TODO test
 SCHEDULED: <2012-01-14 Sat 12:00>

4. Call org-agenda-to-appt again  # ADDED THIS

5. appt-time-msg-list has the old entry

 ((1380)
 #("12:00 TODO test" 6 15
  (org-heading t))
 t)
 ((1390)
 #("12:10 TODO test" 6 15
  (org-heading t))
 t)


I found how to fix this. You can tell org-agenda-to-appt forcefully
clear the old entries by passing non-nil to the first argument of
org-agenda-to-appt.

This is how I use it:


(defun my-org-agenda-to-appt-when-saved ()
 (when (member buffer-file-name (mapcar 'expand-file-name org-agenda-files))
   (org-agenda-to-appt t)))

(add-hook 'after-save-hook 'my-org-agenda-to-appt-when-saved)


Note that this will clear all entries stored in appt, including the
ones unrelated to org-mode. But if you are using appt only from
org-mode, there is no problem.


--
Takafumi

  reply	other threads:[~2012-01-17  7:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-13 16:01 Old entry remains in appt when the original one in org file is changed Takafumi Arakaki
2012-01-16  2:44 ` Bernt Hansen
2012-01-17  7:02   ` Takafumi Arakaki [this message]
2012-01-17 15:01     ` Bernt Hansen
2012-01-18 18:01       ` Takafumi Arakaki

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=CAPM+gBTxUjnjqTQNtG1WG1N7U4Bm+_h+vaWO-2YL9wc2nW8zDA@mail.gmail.com \
    --to=aka.tkf@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).