+2002-08-23 Alan Shutko <ats@acm.org>
+
+ * calendar/diary-lib.el (list-diary-entries): Pass a marker
+ indicating source of entry to add-to-diary-list.
+ (diary-button-face, diary-entry, diary-goto-entry): New, to
+ support click to diary file.
+ (fancy-diary-display): Buttonize diary entries.
+ (list-sexp-diary-entries): Pass a marker indicating source of
+ entry to add-to-diary-list.
+ (diary-date): Return mark as well as entry.
+
+ * calendar/calendar.el (diary-face): New.
+ (european-calendar-display-form, describe-calendar-mode)
+ (mark-visible-calendar-date, calendar-mark-today): Tidy doc string.
+ (calendar-make-alist): New.
+ (calendar-mode): Set up font-lock mode.
+ (generate-calendar-window): Fontify if font-lock-mode is on.
+
2002-11-16 Ivan Zakharyaschev <imz@altlinux.org> (tiny change)
* international/codepage.el (cp866-decode-table): Fix the
:group 'view)
(add-to-list 'facemenu-unlisted-faces 'diary-face)
+(defvar diary-face 'diary-face
+ "Face name to use for diary entries.")
(defface diary-face
'((((class color) (background light))
:foreground "red")
(defcustom european-calendar-display-form
'((if dayname (concat dayname ", ")) day " " monthname " " year)
"*Pseudo-pattern governing the way a date appears in the European style.
-See the documentation of calendar-date-display-form for an explanation."
+See the documentation of `calendar-date-display-form' for an explanation."
:type 'sexp
:group 'calendar)
;; Adjust the window to exactly fit the displayed calendar
(fit-window-to-buffer))
(sit-for 0)
+ (if font-lock-mode
+ (font-lock-fontify-buffer))
(and mark-holidays-in-calendar
(mark-calendar-holidays)
(sit-for 0))
(define-key calendar-mode-map "tY" 'cal-tex-cursor-year-landscape))
(defun describe-calendar-mode ()
- "Create a help buffer with a brief description of the calendar-mode."
+ "Create a help buffer with a brief description of the `calendar-mode'."
(interactive)
(with-output-to-temp-buffer "*Help*"
(princ
(info))
(Info-find-node (car (car where)) (car (cdr (car where)))))))
+
+
(defun calendar-mode ()
"A major mode for the calendar window.
(add-hook 'activate-menubar-hook 'cal-menu-update nil t)
(make-local-variable 'calendar-mark-ring)
(make-local-variable 'displayed-month);; Month in middle of window.
- (make-local-variable 'displayed-year));; Year in middle of window.
+ (make-local-variable 'displayed-year) ;; Year in middle of window.
+ (set (make-local-variable 'font-lock-defaults)
+ '(calendar-font-lock-keywords t)))
(defun calendar-string-spread (strings char length)
"Concatenate list of STRINGS separated with copies of CHAR to fill LENGTH.
"July" "August" "September" "October" "November" "December"]
"Array of capitalized strings giving, in order, the month names.")
+(defvar calendar-font-lock-keywords
+ (list
+ '("[A-Z][a-z]+ -?[0-9]+" . font-lock-function-name-face) ; month and year
+ (cons
+ (concat (substring (aref calendar-day-name-array 6) 0 2)
+ "\\|"
+ (substring (aref calendar-day-name-array 0) 0 2))
+ 'font-lock-comment-face)
+ (cons
+ (mapconcat 'identity
+ (mapcar '(lambda (x) (substring x 0 2))
+ calendar-day-name-array)
+ "\\|")
+ 'font-lock-reference-face))
+ "Default keywords to highlight in Calendar mode.")
+
+
(defun calendar-make-alist (sequence &optional start-index filter)
"Make an assoc list corresponding to SEQUENCE.
Start at index 1, unless optional START-INDEX is provided.
(defun mark-visible-calendar-date (date &optional mark)
"Mark DATE in the calendar window with MARK.
MARK is either a single-character string or a face.
-MARK defaults to diary-entry-marker."
+MARK defaults to `diary-entry-marker'."
(if (calendar-date-is-legal-p date)
(save-excursion
(set-buffer calendar-buffer)
(defun calendar-mark-today ()
"Mark the date under the cursor in the calendar window.
-The date is marked with calendar-today-marker. This function can be used with
+The date is marked with `calendar-today-marker'. This function can be used with
the `today-visible-calendar-hook' run after the calendar window has been
prepared."
(mark-visible-calendar-date