>From 0d6589584bc8059f3de85bdf5c2be6e8583c56c0 Mon Sep 17 00:00:00 2001 From: Ivan Kanis Date: Sat, 26 Mar 2011 15:55:04 +0100 Subject: [PATCH 10/13] precede all local variable in appt-check with ac- This helps distinguishing local variables from global variables. There is no code change, just substitution of variables name. --- appt.el | 38 +++++++++++++++++++------------------- 1 files changed, 19 insertions(+), 19 deletions(-) diff --git a/appt.el b/appt.el index 48184ea..17473d2 100644 --- a/appt.el +++ b/appt.el @@ -308,57 +308,57 @@ displayed in a window: `appt-delete-window-function' Function called to remove appointment window and buffer." (interactive "P") ; so people can force updates - (let* ((now (decode-time)) + (let* ((ac-now (decode-time)) ;; Convert current time to minutes after midnight (12.01am = 1). - (cur-comp-time (+ (* 60 (nth 2 now)) (nth 1 now))) - appt-comp-time appt-warn-time min-to-app) + (ac-cur-time (+ (* 60 (nth 2 ac-now)) (nth 1 ac-now))) + ac-appt-time ac-warn-time ac-min-to-app) (save-excursion - (appt-check-diary force cur-comp-time) + (appt-check-diary force ac-cur-time) (setq appt-mode-string nil) ;; If there are entries in the list, and the user wants a ;; message issued, get the first time off of the list and ;; calculate the number of minutes until the appointment. (when appt-time-msg-list - (setq appt-comp-time (caar (car appt-time-msg-list)) - appt-warn-time (or (nth 3 (car appt-time-msg-list)) + (setq ac-appt-time (caar (car appt-time-msg-list)) + ac-warn-time (or (nth 3 (car appt-time-msg-list)) appt-message-warning-time) - min-to-app (- appt-comp-time cur-comp-time)) + ac-min-to-app (- ac-appt-time ac-cur-time)) (while (and appt-time-msg-list - (< appt-comp-time cur-comp-time)) + (< ac-appt-time ac-cur-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))))) + (setq ac-appt-time (caar (car appt-time-msg-list))))) ;; If we have an appointment between midnight and - ;; `appt-warn-time' minutes after midnight, we + ;; `ac-warn-time' minutes after midnight, we ;; must begin to issue a message before midnight. Midnight ;; is considered 0 minutes and 11:59pm is 1439 ;; minutes. Therefore we must recalculate the minutes to ;; appointment variable. It is equal to the number of ;; minutes before midnight plus the number of minutes after ;; midnight our appointment is. - (if (and (< appt-comp-time appt-warn-time) - (> (+ cur-comp-time appt-warn-time) + (if (and (< ac-appt-time ac-warn-time) + (> (+ ac-cur-time ac-warn-time) appt-max-time)) - (setq min-to-app (+ (- (1+ appt-max-time) cur-comp-time) - appt-comp-time))) + (setq ac-min-to-app (+ (- (1+ appt-max-time) ac-cur-time) + ac-appt-time))) ;; Issue warning if the appointment time is within ;; appt-message-warning time. - (when (and (<= min-to-app appt-warn-time) - (>= min-to-app 0)) + (when (and (<= ac-min-to-app ac-warn-time) + (>= ac-min-to-app 0)) ;; This is true every appt-display-interval minutes. (if (zerop (mod appt-display-count appt-display-interval)) (appt-display-message (cadr (car appt-time-msg-list)) - min-to-app)) + ac-min-to-app)) (setq appt-display-count (1+ appt-display-count)) (when appt-display-mode-line (setq appt-mode-string (concat " " (propertize - (format "App't in %s min." min-to-app) + (format "App't in %s min." ac-min-to-app) 'face 'mode-line-emphasis)))) ;; When an appointment is reached, delete it from the ;; list. Reset the count to 0 in case we display another ;; appointment on the next cycle. - (if (zerop min-to-app) + (if (zerop ac-min-to-app) (setq appt-time-msg-list (cdr appt-time-msg-list) appt-display-count 0)))) ;; Redisplay all mode lines. -- 1.7.1