# HG changeset patch # User Roland Winkler # Date 1145118944 0 # Node ID 14a3b2b9c00be7ab8fd5f78ab5bbbbc9b6e747e8 # Parent d81780942bb830a06bfc290ddb273ed71d7c9067 (appt-add): Check whether an appointment is already present in appt-time-msg-list. Simplify code. diff -r d81780942bb8 -r 14a3b2b9c00b lisp/calendar/appt.el --- a/lisp/calendar/appt.el Sat Apr 15 00:28:08 2006 +0000 +++ b/lisp/calendar/appt.el Sat Apr 15 16:35:44 2006 +0000 @@ -498,11 +498,11 @@ (interactive "sTime (hh:mm[am/pm]): \nsMessage: ") (unless (string-match appt-time-regexp new-appt-time) (error "Unacceptable time-string")) - (let* ((appt-time-string (concat new-appt-time " " new-appt-msg)) - (appt-time (list (appt-convert-time new-appt-time))) - (time-msg (list appt-time appt-time-string t))) - (setq appt-time-msg-list (nconc appt-time-msg-list (list time-msg))) - (setq appt-time-msg-list (appt-sort-list appt-time-msg-list)))) + (let ((time-msg (list (list (appt-convert-time new-appt-time)) + (concat new-appt-time " " new-appt-msg) t))) + (unless (member time-msg appt-time-msg-list) + (setq appt-time-msg-list + (appt-sort-list (nconc appt-time-msg-list (list time-msg))))))) ;;;###autoload (defun appt-delete ()