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

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

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


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

>>>>> Jim Ottaway <address@hidden> writes:
> Good point, I was thinking that some of the later 21.3 versions might
> have the change, but I see that they don't.  I will improve on the
> "solution" I posted a while ago.

Here's another, better solution to the duplicate appt bug.

Also at:

Location: http://www.users.zetnet.co.uk/jeho/archives/2005
Archive name: address@hidden
Branch: planner--jeho--1.0
Patch: 74


--- orig/planner-appt.el
+++ mod/planner-appt.el
@@ -516,20 +516,29 @@
 Tracks appointments ignored because they were too early.")
 
 (defun planner-appt-clear-appts (appt-list)
-  "Clear appointments in APPT-LIST from the alert list."
-  (while appt-list
+  (while appt-list 
     (setq appt-time-msg-list
          (delete (pop appt-list) appt-time-msg-list))))
 
+(eval-and-compile
+  (if (> emacs-major-version 21)
+      (defun planner-appt-make-appt-element (time text)
+       (list
+        (list (appt-convert-time time))
+        (concat time " " text)
+        t))
+    (defun planner-appt-make-appt-element (time text)
+       (list
+        (list (appt-convert-time time))
+        (concat time " " text)))))
+
+
 (defun planner-appt-remember-appt (time text list)
   "Store details of an appointment with TIME and TEXT in LIST.
 Return the new list."
   ;; NB: copies the format from appt.el; could
   ;; break if the format is ever changed
-  (push (list
-        (list (appt-convert-time time))
-        (concat time " " text))
-       list))
+  (push (planner-appt-make-appt-element time text) list))
 
 (defun planner-appt-forget-appt (appt appt-list)
   "Remove APPT from APPT-LIST and return the new list.
@@ -625,8 +634,10 @@
 
 (defun planner-appt-task-member (description time appt-list)
   "Return non-nil if DESCRIPTION at TIME in APPT-LIST has been scheduled."
-  (let ((appt (concat time " " description)))
-    (member (list (list (appt-convert-time appt)) appt) appt-list)))
+  (member (planner-appt-make-appt-element time description) appt-list))
+;;  (let ((appt (concat time " " description)))
+
+;;    (member (list (list (appt-convert-time appt)) appt) appt-list)))
 
 
 
@@ -775,7 +786,7 @@
          (progn 
            ;; Remember earlier appts separately [principally for
            ;; their addition in an appointment section].
-           (unless (planner-appt-task-member
+           (unless (planner-appt-task-member    
                     desc time --planner-appt-tasks-earlier-appts)
              (setq --planner-appt-tasks-earlier-appts
                    (planner-appt-remember-appt




reply via email to

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