From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takafumi Arakaki 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 Message-ID: References: <877h0sxt68.fsf@norang.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:44345) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rn34E-00007W-3Y for emacs-orgmode@gnu.org; Tue, 17 Jan 2012 02:02:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rn34C-0003Qi-EX for emacs-orgmode@gnu.org; Tue, 17 Jan 2012 02:02:50 -0500 Received: from mail-qy0-f169.google.com ([209.85.216.169]:57141) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rn34C-0003QP-CJ for emacs-orgmode@gnu.org; Tue, 17 Jan 2012 02:02:48 -0500 Received: by qcsf14 with SMTP id f14so506103qcs.0 for ; Mon, 16 Jan 2012 23:02:47 -0800 (PST) In-Reply-To: <877h0sxt68.fsf@norang.ca> 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: emacs-orgmode@gnu.org 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