From 5a9589a97b099c6171488d7176350d9a8d6e670a Mon Sep 17 00:00:00 2001 From: Steve Youngs Date: Sun, 1 Jul 2012 00:51:35 +1000 Subject: [PATCH] Finally do something about the famous "midnight bug" For years my SXEmacs would crash at midnight if I were running Sawfish and no SXEmacs frame had the focus. And even though this changeset doesn't actually fix the bug, it does mean it won't get triggered again. * 12-cal-sy.el (sy-update-diary-font-lock-keywords): Removed. Also remove the #'run-at-time call * 12-cal-sy.el (calendar-move-hook): Have it update the displayed diary entries as you move to different dates. * 12-cal-sy.el (calendar-mode-hook): Update the font-lock keywords here. Signed-off-by: Steve Youngs --- 12-cal-sy.el | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/12-cal-sy.el b/12-cal-sy.el index 93a798c..fdfaa81 100644 --- a/12-cal-sy.el +++ b/12-cal-sy.el @@ -5,7 +5,7 @@ ;; Author: Steve Youngs ;; Maintainer: Steve Youngs ;; Created: <2007-12-02> -;; Time-stamp: +;; Time-stamp: ;; Download: ;; HTMLised: ;; Git Repo: git clone http://git.sxemacs.org/syinit @@ -145,15 +145,6 @@ for a fontified Diary buffer." (defvar fancy-diary-font-lock-keywords (fancy-diary-font-lock-keywords)) -(defun sy-update-diary-font-lock-keywords () - (sit-for 1.1) - (setq fancy-diary-font-lock-keywords (fancy-diary-font-lock-keywords)) - ;(with-current-buffer (get-buffer-create fancy-diary-buffer) - ; (font-lock-fontify-buffer)) - ) - -(run-at-time "23:59:59" 86400 'sy-update-diary-font-lock-keywords) - ;:*======================= ;:* Display ISO week numbers ;; @@ -250,6 +241,11 @@ characters on the line." (include-other-diary-files))) (add-hook 'mark-diary-entries-hook #'mark-included-diary-files) (add-hook 'today-visible-calendar-hook #'calendar-mark-today) +(add-hook 'calendar-move-hook #'(lambda () (diary-view-entries 1))) +(add-hook 'calendar-mode-hook + #'(lambda () + (setq fancy-diary-font-lock-keywords + (fancy-diary-font-lock-keywords)))) ;:*======================= ;:* Appointments -- 2.25.1