changeset 77044:e0a720fbf325

(diary-font-lock-keywords, diary-live-p): Autoload these functions. (diary-date-forms): Add a custom :set form.
author Glenn Morris <rgm@gnu.org>
date Sat, 07 Apr 2007 21:53:39 +0000
parents 694008dfe9c9
children 281faae44c48
files lisp/calendar/calendar.el
diffstat 1 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/calendar/calendar.el	Sat Apr 07 21:53:17 2007 +0000
+++ b/lisp/calendar/calendar.el	Sat Apr 07 21:53:39 2007 +0000
@@ -629,6 +629,10 @@
 				       (choice symbol regexp)))))
   :group 'diary)
 
+(autoload 'diary-font-lock-keywords "diary-lib")
+(autoload 'diary-live-p "diary-lib")
+(defvar diary-font-lock-keywords)
+
 (defcustom diary-date-forms
   (if european-calendar-style
       european-date-diary-pattern
@@ -666,6 +670,15 @@
 			 (repeat (list :inline t :format "%v"
 				       (symbol :tag "Keyword")
 				       (choice symbol regexp)))))
+  :initialize 'custom-initialize-default
+  :set (lambda (symbol value)
+         (unless (equal value (eval symbol))
+           (custom-set-default symbol value)
+           (setq diary-font-lock-keywords (diary-font-lock-keywords))
+           ;; Need to redraw not just to get new font-locking, but also
+           ;; to pick up any newly recognized entries.
+           (and (diary-live-p)
+                (diary))))
   :group 'diary)
 
 ;;;###autoload