From: Roland Winkler Date: Sat, 15 Apr 2006 16:35:44 +0000 (+0000) Subject: (appt-add): Check whether an appointment is already present in X-Git-Tag: emacs-pretest-22.0.90~3133 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7413999478bc4a0eead3247a7a23dd940fabad51;p=emacs.git (appt-add): Check whether an appointment is already present in appt-time-msg-list. Simplify code. --- diff --git a/lisp/calendar/appt.el b/lisp/calendar/appt.el index bce30a1de20..36934783b93 100644 --- a/lisp/calendar/appt.el +++ b/lisp/calendar/appt.el @@ -498,11 +498,11 @@ The time should be in either 24 hour format or am/pm format." (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 ()