emacs-wiki-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [emacs-wiki-discuss] Duplicate appointments with planner-appt


From: Jim Ottaway
Subject: Re: [emacs-wiki-discuss] Duplicate appointments with planner-appt
Date: Thu, 23 Jun 2005 11:59:22 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

>>>>> Jim Ottaway <address@hidden> writes:

> Hmm...those appointments really ought ot have been deleted before we
> get to that line.

> What version of Emacs are you using? 

> If you are using the CVS development version, I suspect that the real
> problem is probably in planner-appt-remember-appt: the format has
> changed slightly, so they might not get deleted with
> planner-appt-clear-appts. The change was made 2005-02-23; I wonder
> what the best way of testing for this would be?

I have looked at this using emacs 22.0.50.1, where the
appt-time-msg-list format has definitely changed.  The duplicate
appointment bug is reproduced there, so I suspect even more strongly
that this is the source of the problem.

I have just come up with this as some sort of a solution; does it work
for you?  You would need to comment out your changes to test it.
Regards,

Jim Ottaway

--- orig/planner-appt.el
+++ mod/planner-appt.el
@@ -517,10 +517,21 @@
 
 (defun planner-appt-clear-appts (appt-list)
   "Clear appointments in APPT-LIST from the alert list."
-  (while appt-list
+  ;; Handle the new format in CVS.  This is a temporary fix: I can't
+  ;; think of a better way of finding out exactly which revision is
+  ;; being used.  NB. it would be more efficient to put this test in
+  ;; planner-appt-remember-appt, but there may not be any appts in
+  ;; appt-time-msg-list when it is first called.
+  (when (and appt-time-msg-list
+            (= (length (car appt-time-msg-list)) 3))
+    (setq appt-list (mapcar #'(lambda (a)
+                               (append a (list t)))
+                           appt-list)))
+  (while appt-list 
     (setq appt-time-msg-list
          (delete (pop appt-list) appt-time-msg-list))))
 
+
 (defun planner-appt-remember-appt (time text list)
   "Store details of an appointment with TIME and TEXT in LIST.
 Return the new list."






reply via email to

[Prev in Thread] Current Thread [Next in Thread]