From: Glenn Morris Date: Fri, 13 May 2011 01:31:53 +0000 (-0700) Subject: * lisp/calendar/appt.el (appt-make-list): Simplify. X-Git-Tag: emacs-pretest-24.0.90~104^2~618^2~291 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5233edd7e8b9b5bfdb200b5fa287689a65ff794f;p=emacs.git * lisp/calendar/appt.el (appt-make-list): Simplify. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a592ae39ac0..0eda5afc12d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2011-05-13 Glenn Morris + + * calendar/appt.el (appt-make-list): Simplify. + 2011-05-12 Andreas Schwab * progmodes/ld-script.el (ld-script-keywords) diff --git a/lisp/calendar/appt.el b/lisp/calendar/appt.el index dce6cc28239..366117277d3 100644 --- a/lisp/calendar/appt.el +++ b/lisp/calendar/appt.el @@ -569,15 +569,12 @@ Any appointments made with `appt-add' are not affected by this function." (setq entry-list (cdr entry-list))))) (setq appt-time-msg-list (appt-sort-list appt-time-msg-list)) ;; Convert current time to minutes after midnight (12:01am = 1), - ;; so that elements in the list that are earlier than the - ;; present time can be removed. + ;; and remove elements in the list that are in the past. (let* ((now (decode-time)) - (cur-comp-time (+ (* 60 (nth 2 now)) (nth 1 now))) - (appt-comp-time (caar (car appt-time-msg-list)))) - (while (and appt-time-msg-list (< appt-comp-time cur-comp-time)) - (setq appt-time-msg-list (cdr appt-time-msg-list)) - (if appt-time-msg-list - (setq appt-comp-time (caar (car appt-time-msg-list))))))))) + (now-mins (+ (* 60 (nth 2 now)) (nth 1 now)))) + (while (and appt-time-msg-list + (< (caar (car appt-time-msg-list)) now-mins)) + (setq appt-time-msg-list (cdr appt-time-msg-list))))))) (defun appt-sort-list (appt-list)