Re: [O] Old entry remains in appt when the original one in org file is changed

2012-01-18 Thread Takafumi Arakaki
Hi Bernt,

 My recipe clears the list each time the agenda is generated.  I only use
 appt for org-mode appointments so clearing the list works great for me.

Sorry I missed (setq appt-time-msg-list nil) in your setup code.  This
is exactly what happens when you pass non-nil for REFRESH argument of
org-agenda-to-appt.



Re: [O] Old entry remains in appt when the original one in org file is changed

2012-01-17 Thread Bernt Hansen
Takafumi Arakaki aka@gmail.com writes:

 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.

My recipe clears the list each time the agenda is generated.  I only use
appt for org-mode appointments so clearing the list works great for me.

Regards,
Bernt



Re: [O] Old entry remains in appt when the original one in org file is changed

2012-01-16 Thread Takafumi Arakaki
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



Re: [O] Old entry remains in appt when the original one in org file is changed

2012-01-15 Thread Bernt Hansen
Takafumi Arakaki aka@gmail.com writes:

 I am using org-agenda-to-appt and I noticed a bug.


 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. 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 guess a workaround will be removing any entries which has
 org-heading as property from appt-time-msg-list before adding the new
 entries.

 I think this guy had the same problem:
 http://article.gmane.org/gmane.emacs.orgmode/8008/

Hi Takafumi,

This is the setup I use to deal with this.

There is no magic that updates your appt-time-msg-list just because your
org file changed.  I regenerate the appointment list everytime I visit
the agenda -- and I do that often.

HTH,
Bernt


--8---cut here---start-8---
; Erase all reminders and rebuilt reminders for today from the agenda
(defun bh/org-agenda-to-appt ()
  (interactive)
  (setq appt-time-msg-list nil)
  (org-agenda-to-appt))

; Rebuild the reminders everytime the agenda is displayed
(add-hook 'org-finalize-agenda-hook 'bh/org-agenda-to-appt 'append)

; This is at the end of my .emacs - so appointments are set up when Emacs starts
(bh/org-agenda-to-appt)

; Activate appointments so we get notifications
(appt-activate t)

; If we leave Emacs running overnight - reset the appointments one minute after 
midnight
(run-at-time 24:01 nil 'bh/org-agenda-to-appt)

--8---cut here---end---8---



[O] Old entry remains in appt when the original one in org file is changed

2012-01-13 Thread Takafumi Arakaki
I am using org-agenda-to-appt and I noticed a bug.


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. 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 guess a workaround will be removing any entries which has
org-heading as property from appt-time-msg-list before adding the new
entries.

I think this guy had the same problem:
http://article.gmane.org/gmane.emacs.orgmode/8008/

--
Takafumi