>From d17b6cfd2b6369afe5e4f6032787d871492c59a0 Mon Sep 17 00:00:00 2001 From: Ivan Kanis Date: Thu, 24 Mar 2011 19:18:02 +0100 Subject: [PATCH 08/13] always refresh the mode line The operation is not expensive every 60s. Don't pass t to force-mode-line-update since we are only updating the mode line. Remove prev-appt-mode-string since it's not needed anymore. --- appt.el | 15 ++++----------- 1 files changed, 4 insertions(+), 11 deletions(-) diff --git a/appt.el b/appt.el index 51cc5e1..a940831 100644 --- a/appt.el +++ b/appt.el @@ -308,9 +308,8 @@ displayed in a window: `appt-delete-window-function' Function called to remove appointment window and buffer." (interactive "P") ; so people can force updates - (let* ((prev-appt-mode-string appt-mode-string) + (let* ((now (decode-time)) ;; Convert current time to minutes after midnight (12.01am = 1). - (now (decode-time)) (cur-comp-time (+ (* 60 (nth 2 now)) (nth 1 now))) appt-comp-time appt-warn-time min-to-app) (save-excursion @@ -363,15 +362,9 @@ displayed in a window: (if (zerop min-to-app) (setq appt-time-msg-list (cdr appt-time-msg-list) appt-display-count 0)))) - ;; If we have changed the mode line string, redisplay all mode lines. - (and appt-display-mode-line - (not (string-equal appt-mode-string - prev-appt-mode-string)) - (progn - (force-mode-line-update t) - ;; If the string now has a notification, redisplay right now. - (if appt-mode-string - (sit-for 0))))))) + ;; Redisplay all mode lines. + (when appt-display-mode-line + (force-mode-line-update))))) (defun appt-check-diary (force cur-comp-time) "Update appointments to today's list." -- 1.7.1