comparison lisp/calendar/calendar.el @ 48683:ead34b521994

(facemenu-unlisted-faces): Only update after facemenu was loaded. (calendar-font-lock-keywords): Accept non-ASCII month names. Use regexp-opt.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Thu, 05 Dec 2002 18:42:33 +0000
parents 9dad713d153a
children b243692710b4
comparison
equal deleted inserted replaced
48682:a74dd42cf01d 48683:ead34b521994
202 "*Determine how the calendar mode removes a frame no longer needed. 202 "*Determine how the calendar mode removes a frame no longer needed.
203 If nil, make an icon of the frame. If non-nil, delete the frame." 203 If nil, make an icon of the frame. If non-nil, delete the frame."
204 :type 'boolean 204 :type 'boolean
205 :group 'view) 205 :group 'view)
206 206
207 (add-to-list 'facemenu-unlisted-faces 'diary-face)
208 (defvar diary-face 'diary-face 207 (defvar diary-face 'diary-face
209 "Face name to use for diary entries.") 208 "Face name to use for diary entries.")
210 (defface diary-face 209 (defface diary-face
211 '((((class color) (background light)) 210 '((((class color) (background light))
212 :foreground "red") 211 :foreground "red")
215 (t 214 (t
216 :weight bold)) 215 :weight bold))
217 "Face for highlighting diary entries." 216 "Face for highlighting diary entries."
218 :group 'diary) 217 :group 'diary)
219 218
220 (add-to-list 'facemenu-unlisted-faces 'calendar-today-face)
221 (defface calendar-today-face 219 (defface calendar-today-face
222 '((t (:underline t))) 220 '((t (:underline t)))
223 "Face for indicating today's date." 221 "Face for indicating today's date."
224 :group 'diary) 222 :group 'diary)
225 223
226 (add-to-list 'facemenu-unlisted-faces 'holiday-face)
227 (defface holiday-face 224 (defface holiday-face
228 '((((class color) (background light)) 225 '((((class color) (background light))
229 :background "pink") 226 :background "pink")
230 (((class color) (background dark)) 227 (((class color) (background dark))
231 :background "chocolate4") 228 :background "chocolate4")
232 (t 229 (t
233 :inverse-video t)) 230 :inverse-video t))
234 "Face for indicating dates that have holidays." 231 "Face for indicating dates that have holidays."
235 :group 'diary) 232 :group 'diary)
233
234 (eval-after-load "facemenu"
235 '(progn
236 (add-to-list 'facemenu-unlisted-faces 'diary-face)
237 (add-to-list 'facemenu-unlisted-faces 'calendar-today-face)
238 (add-to-list 'facemenu-unlisted-faces 'holiday-face)))
236 239
237 (defcustom diary-entry-marker 240 (defcustom diary-entry-marker
238 (if (not (display-color-p)) 241 (if (not (display-color-p))
239 "+" 242 "+"
240 'diary-face) 243 'diary-face)
2474 ["January" "February" "March" "April" "May" "June" 2477 ["January" "February" "March" "April" "May" "June"
2475 "July" "August" "September" "October" "November" "December"] 2478 "July" "August" "September" "October" "November" "December"]
2476 "Array of capitalized strings giving, in order, the month names.") 2479 "Array of capitalized strings giving, in order, the month names.")
2477 2480
2478 (defvar calendar-font-lock-keywords 2481 (defvar calendar-font-lock-keywords
2479 (list 2482 `((,(concat (regexp-opt (mapcar 'identity calendar-month-name-array) t)
2480 '("[A-Z][a-z]+ -?[0-9]+" . font-lock-function-name-face) ; month and year 2483 " -?[0-9]+")
2481 (cons 2484 . font-lock-function-name-face) ; month and year
2482 (concat (substring (aref calendar-day-name-array 6) 0 2) 2485 (,(regexp-opt
2483 "\\|" 2486 (list (substring (aref calendar-day-name-array 6) 0 2)
2484 (substring (aref calendar-day-name-array 0) 0 2)) 2487 (substring (aref calendar-day-name-array 0) 0 2)))
2485 'font-lock-comment-face) 2488 ;; Saturdays and Sundays are hilited differently.
2486 (cons 2489 . font-lock-comment-face)
2487 (mapconcat 'identity 2490 (,(regexp-opt (mapcar (lambda (x) (substring x 0 2)) calendar-day-name-array))
2488 (mapcar '(lambda (x) (substring x 0 2)) 2491 . font-lock-reference-face))
2489 calendar-day-name-array)
2490 "\\|")
2491 'font-lock-reference-face))
2492 "Default keywords to highlight in Calendar mode.") 2492 "Default keywords to highlight in Calendar mode.")
2493 2493
2494 2494
2495 (defun calendar-make-alist (sequence &optional start-index filter) 2495 (defun calendar-make-alist (sequence &optional start-index filter)
2496 "Make an assoc list corresponding to SEQUENCE. 2496 "Make an assoc list corresponding to SEQUENCE.