emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/calendar/diary-lib.el [lexbind]


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/calendar/diary-lib.el [lexbind]
Date: Tue, 14 Oct 2003 19:42:19 -0400

Index: emacs/lisp/calendar/diary-lib.el
diff -c emacs/lisp/calendar/diary-lib.el:1.54.2.1 
emacs/lisp/calendar/diary-lib.el:1.54.2.2
*** emacs/lisp/calendar/diary-lib.el:1.54.2.1   Fri Apr  4 01:20:15 2003
--- emacs/lisp/calendar/diary-lib.el    Tue Oct 14 19:42:14 2003
***************
*** 1,7 ****
  ;;; diary-lib.el --- diary functions
  
! ;; Copyright (C) 1989, 1990, 1992, 1993, 1994, 1995 Free Software
! ;; Foundation, Inc.
  
  ;; Author: Edward M. Reingold <address@hidden>
  ;; Keywords: calendar
--- 1,7 ----
  ;;; diary-lib.el --- diary functions
  
! ;; Copyright (C) 1989, 1990, 1992, 1993, 1994, 1995, 2003
! ;;           Free Software Foundation, Inc.
  
  ;; Author: Edward M. Reingold <address@hidden>
  ;; Keywords: calendar
***************
*** 38,43 ****
--- 38,53 ----
  
  (require 'calendar)
  
+ (defun diary-check-diary-file ()
+   "Check that the file specified by `diary-file' exists and is readable.
+ If so, return the expanded file name, otherwise signal an error."
+   (let ((d-file (substitute-in-file-name diary-file)))
+     (if (and d-file (file-exists-p d-file))
+         (if (file-readable-p d-file)
+             d-file
+           (error "Diary file `%s' is not readable" diary-file))
+       (error "Diary file `%s' does not exist" diary-file))))
+ 
  ;;;###autoload
  (defun diary (&optional arg)
    "Generate the diary window for ARG days starting with the current date.
***************
*** 45,63 ****
  by the variable `number-of-diary-entries'.  This function is suitable for
  execution in a `.emacs' file."
    (interactive "P")
!   (let ((d-file (substitute-in-file-name diary-file))
!         (date (calendar-current-date)))
!     (if (and d-file (file-exists-p d-file))
!         (if (file-readable-p d-file)
!             (list-diary-entries
!              date
!              (cond
!               (arg (prefix-numeric-value arg))
!               ((vectorp number-of-diary-entries)
!                (aref number-of-diary-entries (calendar-day-of-week date)))
!               (t number-of-diary-entries)))
!         (error "Your diary file is not readable!"))
!       (error "You don't have a diary file!"))))
  
  (defun view-diary-entries (arg)
    "Prepare and display a buffer with diary entries.
--- 55,68 ----
  by the variable `number-of-diary-entries'.  This function is suitable for
  execution in a `.emacs' file."
    (interactive "P")
!   (diary-check-diary-file)
!   (let ((date (calendar-current-date)))
!     (list-diary-entries
!      date
!      (cond (arg (prefix-numeric-value arg))
!            ((vectorp number-of-diary-entries)
!             (aref number-of-diary-entries (calendar-day-of-week date)))
!            (t number-of-diary-entries)))))
  
  (defun view-diary-entries (arg)
    "Prepare and display a buffer with diary entries.
***************
*** 65,86 ****
  match ARG days starting with the date indicated by the cursor position
  in the displayed three-month calendar."
    (interactive "p")
!   (let ((d-file (substitute-in-file-name diary-file)))
!     (if (and d-file (file-exists-p d-file))
!         (if (file-readable-p d-file)
!             (list-diary-entries (calendar-cursor-to-date t) arg)
!           (error "Diary file is not readable!"))
!       (error "You don't have a diary file!"))))
  
  (defun view-other-diary-entries (arg d-file)
    "Prepare and display buffer of diary entries from an alternative diary file.
! Prompts for a file name and searches that file for entries that match ARG
! days starting with the date indicated by the cursor position in the displayed
! three-month calendar."
    (interactive
!    (list (cond ((null current-prefix-arg) 1)
!                ((listp current-prefix-arg) (car current-prefix-arg))
!                (t current-prefix-arg))
           (read-file-name "Enter diary file name: " default-directory nil t)))
    (let ((diary-file d-file))
      (view-diary-entries arg)))
--- 70,85 ----
  match ARG days starting with the date indicated by the cursor position
  in the displayed three-month calendar."
    (interactive "p")
!   (diary-check-diary-file)
!   (list-diary-entries (calendar-cursor-to-date t) arg))
  
  (defun view-other-diary-entries (arg d-file)
    "Prepare and display buffer of diary entries from an alternative diary file.
! Searches for entries that match ARG days, starting with the date indicated
! by the cursor position in the displayed three-month calendar.
! D-FILE specifies the file to use as the diary file."
    (interactive
!    (list (if arg (prefix-numeric-value arg) 1)
           (read-file-name "Enter diary file name: " default-directory nil t)))
    (let ((diary-file d-file))
      (view-diary-entries arg)))
***************
*** 169,180 ****
  (defvar diary-syntax-table (copy-syntax-table (standard-syntax-table))
    "The syntax table used when parsing dates in the diary file.
  It is the standard syntax table used in Fundamental mode, but with the
! syntax of `*' changed to be a word constituent.")
  
  (modify-syntax-entry ?* "w" diary-syntax-table)
  (modify-syntax-entry ?: "w" diary-syntax-table)
  
- (defvar diary-modified)
  (defvar diary-entries-list)
  (defvar displayed-year)
  (defvar displayed-month)
--- 168,178 ----
  (defvar diary-syntax-table (copy-syntax-table (standard-syntax-table))
    "The syntax table used when parsing dates in the diary file.
  It is the standard syntax table used in Fundamental mode, but with the
! syntax of `*' and `:' changed to be word constituents.")
  
  (modify-syntax-entry ?* "w" diary-syntax-table)
  (modify-syntax-entry ?: "w" diary-syntax-table)
  
  (defvar diary-entries-list)
  (defvar displayed-year)
  (defvar displayed-month)
***************
*** 182,193 ****
  (defvar date)
  (defvar number)
  (defvar date-string)
- (defvar d-file)
  (defvar original-date)
  
  (defun diary-attrtype-convert (attrvalue type)
!   "Convert the attrvalue from a string to the appropriate type for using
! in a face description"
    (let (ret)
      (setq ret (cond ((eq type 'string) attrvalue)
                    ((eq type 'symbol) (read attrvalue))
--- 180,190 ----
  (defvar date)
  (defvar number)
  (defvar date-string)
  (defvar original-date)
  
  (defun diary-attrtype-convert (attrvalue type)
!   "Convert string ATTRVALUE to TYPE appropriate for a face description.
! Valid TYPEs are: string, symbol, int, stringtnil, tnil."
    (let (ret)
      (setq ret (cond ((eq type 'string) attrvalue)
                    ((eq type 'symbol) (read attrvalue))
***************
*** 201,219 ****
                           ((string= "nil" attrvalue) nil)))))
  ;    (message "(%s)[%s]=[%s]" (print type) attrvalue ret)
      ret))
!       
  
  (defun diary-pull-attrs (entry fileglobattrs)
!   "Pull the face-related attributes off the entry, merge with the 
! fileglobattrs, and return the (possibly modified) entry and face 
! data in a list of attrname attrvalue values.  
  The entry will be modified to drop all tags that are used for face matching.
! If entry is nil, then the fileglobattrs are being searched for, 
! the fileglobattrs variable is ignored, and 
! diary-glob-file-regexp-prefix is prepended to the regexps before each 
  search."
    (save-excursion
!     (let (regexp regnum attrname attr-list attrname attrvalue type)
        (if (null entry)
          (progn
            (setq ret-attr '()
--- 198,217 ----
                           ((string= "nil" attrvalue) nil)))))
  ;    (message "(%s)[%s]=[%s]" (print type) attrvalue ret)
      ret))
! 
  
  (defun diary-pull-attrs (entry fileglobattrs)
!   "Pull the face-related attributes off the entry, merge with the
! fileglobattrs, and return the (possibly modified) entry and face
! data in a list of attrname attrvalue values.
  The entry will be modified to drop all tags that are used for face matching.
! If entry is nil, then the fileglobattrs are being searched for,
! the fileglobattrs variable is ignored, and
! diary-glob-file-regexp-prefix is prepended to the regexps before each
  search."
    (save-excursion
!     (let (regexp regnum attrname attr-list attrname attrvalue type
!                  ret-attr attr)
        (if (null entry)
          (progn
            (setq ret-attr '()
***************
*** 248,254 ****
                  type (nth 3 attr))
            (setq attrvalue nil)
            (if (string-match regexp entry)
!               (progn 
                  (setq attrvalue (substring-no-properties entry
                                                           (match-beginning 
regnum)
                                                           (match-end regnum)))
--- 246,252 ----
                  type (nth 3 attr))
            (setq attrvalue nil)
            (if (string-match regexp entry)
!               (progn
                  (setq attrvalue (substring-no-properties entry
                                                           (match-beginning 
regnum)
                                                           (match-end regnum)))
***************
*** 256,265 ****
            (if (and attrvalue
                     (setq attrvalue (diary-attrtype-convert attrvalue type)))
                (setq ret-attr (append ret-attr (list attrname attrvalue))))
!           (setq attr-list (cdr attr-list)))))))
!   (list entry ret-attr))
!   
!   
  
  (defun list-diary-entries (date number)
    "Create and display a buffer containing the relevant lines in diary-file.
--- 254,284 ----
            (if (and attrvalue
                     (setq attrvalue (diary-attrtype-convert attrvalue type)))
                (setq ret-attr (append ret-attr (list attrname attrvalue))))
!           (setq attr-list (cdr attr-list)))))
!       (list entry ret-attr))))
! 
! 
! ;; This can be removed once the kill/yank treatment of invisible text
! ;; (see etc/TODO) is fixed. -- gm
! (defcustom diary-header-line-flag t
!   "*If non-nil, `simple-diary-display' will show a header line.
! The format of the header is specified by `diary-header-line-format'."
!   :group   'diary
!   :type    'boolean
!   :version "21.4")
! 
! (defcustom diary-header-line-format
!   '(:eval (calendar-string-spread
!            (list (if selective-display
!                      "Selective display active - press \"s\" in calendar \
! before edit/copy"
!                    "Diary"))
!            ?\ (frame-width)))
!   "*Format of the header line displayed by `simple-diary-display'.
! Only used if `diary-header-line-flag' is non-nil."
!   :group   'diary
!   :type    'sexp
!   :version "21.4")
  
  (defun list-diary-entries (date number)
    "Create and display a buffer containing the relevant lines in diary-file.
***************
*** 296,307 ****
          notification function."
  
    (if (< 0 number)
!       (let* ((original-date date);; save for possible use in the hooks
!              old-diary-syntax-table
!              diary-entries-list
!            file-glob-attrs
!              (date-string (calendar-date-string date))
!              (d-file (substitute-in-file-name diary-file)))
          (message "Preparing diary...")
          (save-excursion
            (let ((diary-buffer (find-buffer-visiting d-file)))
--- 315,326 ----
          notification function."
  
    (if (< 0 number)
!       (let ((original-date date);; save for possible use in the hooks
!             old-diary-syntax-table
!             diary-entries-list
!             file-glob-attrs
!             (date-string (calendar-date-string date))
!             (d-file (substitute-in-file-name diary-file)))
          (message "Preparing diary...")
          (save-excursion
            (let ((diary-buffer (find-buffer-visiting d-file)))
***************
*** 313,318 ****
--- 332,339 ----
          (setq file-glob-attrs (nth 1 (diary-pull-attrs nil "")))
            (setq selective-display t)
            (setq selective-display-ellipses nil)
+           (if diary-header-line-flag
+               (setq header-line-format diary-header-line-format))
            (setq old-diary-syntax-table (syntax-table))
            (set-syntax-table diary-syntax-table)
            (unwind-protect
***************
*** 343,356 ****
                                          (car d)))
                            (backup (equal (car (car d)) 'backup))
                            (dayname
!                            (concat
!                             (calendar-day-name date) "\\|"
!                             (substring (calendar-day-name date) 0 3) ".?"))
                            (monthname
!                            (concat
!                             "\\*\\|"
!                             (calendar-month-name month) "\\|"
!                             (substring (calendar-month-name month) 0 3) ".?"))
                            (month (concat "\\*\\|0*" (int-to-string month)))
                            (day (concat "\\*\\|0*" (int-to-string day)))
                            (year
--- 364,376 ----
                                          (car d)))
                            (backup (equal (car (car d)) 'backup))
                            (dayname
!                            (format "%s\\|%s\\.?"
!                             (calendar-day-name date)
!                             (calendar-day-name date 'abbrev)))
                            (monthname
!                            (format "\\*\\|%s\\|%s\\.?"
!                             (calendar-month-name month)
!                             (calendar-month-name month 'abbrev)))
                            (month (concat "\\*\\|0*" (int-to-string month)))
                            (day (concat "\\*\\|0*" (int-to-string day)))
                            (year
***************
*** 377,383 ****
                             ;; add it to the list.
                             (setq entry-found t)
                             (let ((entry-start (point))
!                                  (date-start))
                               (re-search-backward "\^M\\|\n\\|\\`")
                               (setq date-start (point))
                               (re-search-forward "\^M\\|\n" nil t 2)
--- 397,403 ----
                             ;; add it to the list.
                             (setq entry-found t)
                             (let ((entry-start (point))
!                                  date-start temp)
                               (re-search-backward "\^M\\|\n\\|\\`")
                               (setq date-start (point))
                               (re-search-forward "\^M\\|\n" nil t 2)
***************
*** 388,401 ****
                                  (point) ?\^M ?\n t)
                             (setq entry (buffer-substring entry-start (point))
                                   temp (diary-pull-attrs entry file-glob-attrs)
!                                  entry (nth 0 temp)
!                                  marks (nth 1 temp))
                               (add-to-diary-list
                                date
                              entry
                                (buffer-substring
                                 (1+ date-start) (1- entry-start))
!                             (copy-marker entry-start) marks)))))
                       (setq d (cdr d)))
                     (or entry-found
                         (not diary-list-include-blanks)
--- 408,420 ----
                                  (point) ?\^M ?\n t)
                             (setq entry (buffer-substring entry-start (point))
                                   temp (diary-pull-attrs entry file-glob-attrs)
!                                  entry (nth 0 temp))
                               (add-to-diary-list
                                date
                              entry
                                (buffer-substring
                                 (1+ date-start) (1- entry-start))
!                             (copy-marker entry-start) (nth 1 temp))))))
                       (setq d (cdr d)))
                     (or entry-found
                         (not diary-list-include-blanks)
***************
*** 469,485 ****
    "Display the diary buffer if there are any relevant entries or holidays."
    (let* ((holiday-list (if holidays-in-diary-buffer
                             (check-calendar-holidays original-date)))
!          (msg (format "No diary entries for %s %s"
!                       (concat date-string (if holiday-list ":" ""))
!                       (mapconcat 'identity holiday-list "; "))))
!     (calendar-set-mode-line
!      (concat "Diary for " date-string
!              (if holiday-list ": " "")
!              (mapconcat 'identity holiday-list "; ")))
      (if (or (not diary-entries-list)
              (and (not (cdr diary-entries-list))
                   (string-equal (car (cdr (car diary-entries-list))) "")))
!         (if (<= (length msg) (frame-width))
              (message "%s" msg)
            (set-buffer (get-buffer-create holiday-buffer))
            (setq buffer-read-only nil)
--- 488,506 ----
    "Display the diary buffer if there are any relevant entries or holidays."
    (let* ((holiday-list (if holidays-in-diary-buffer
                             (check-calendar-holidays original-date)))
!          (hol-string (format "%s%s%s"
!                              date-string
!                              (if holiday-list ": " "")
!                              (mapconcat 'identity holiday-list "; ")))
!          (msg (format "No diary entries for %s" hol-string))
!          ;; If selected window is dedicated (to the calendar),
!          ;; need a new one to display the diary.
!          (pop-up-frames (window-dedicated-p (selected-window))))
!     (calendar-set-mode-line (format "Diary for %s" hol-string))
      (if (or (not diary-entries-list)
              (and (not (cdr diary-entries-list))
                   (string-equal (car (cdr (car diary-entries-list))) "")))
!         (if (< (length msg) (frame-width))
              (message "%s" msg)
            (set-buffer (get-buffer-create holiday-buffer))
            (setq buffer-read-only nil)
***************
*** 491,497 ****
            (setq buffer-read-only t)
            (display-buffer holiday-buffer)
            (message  "No diary entries for %s" date-string))
!       (display-buffer (find-buffer-visiting d-file))
        (message "Preparing diary...done"))))
  
  (defface diary-button-face '((((type pc) (class color))
--- 512,519 ----
            (setq buffer-read-only t)
            (display-buffer holiday-buffer)
            (message  "No diary entries for %s" date-string))
!       (display-buffer (find-buffer-visiting
!                        (substitute-in-file-name diary-file)))
        (message "Preparing diary...done"))))
  
  (defface diary-button-face '((((type pc) (class color))
***************
*** 604,625 ****
                                   :type 'diary-entry)
                  (insert entry ?\n))
                (save-excursion
!                 (setq marks (nth 4 (car entry-list)))
!                 (setq temp-face (make-symbol (apply 'concat "temp-face-" 
(mapcar '(lambda (sym) (if (not (stringp sym)) (symbol-name sym) sym)) marks))))
!                 (make-face temp-face)
!                 ;; Remove :face info from the marks, copy the face info into 
temp-face
!                 (setq faceinfo marks)
!                 (while (setq faceinfo (memq :face faceinfo))
!                   (copy-face (read (nth 1 faceinfo)) temp-face)
!                   (setcar faceinfo nil)
!                   (setcar (cdr faceinfo) nil))
!                 (setq marks (delq nil marks))
                  ;; Apply the font aspects
!                 (apply 'set-face-attribute temp-face nil marks)
!                 (search-backward entry)
!                 (overlay-put
!                  (make-overlay (match-beginning 0) (match-end 0)) 'face 
temp-face))
!               ))
          (setq entry-list (cdr entry-list))))
        (set-buffer-modified-p nil)
        (goto-char (point-min))
--- 626,655 ----
                                   :type 'diary-entry)
                  (insert entry ?\n))
                (save-excursion
!                   (let* ((marks (nth 4 (car entry-list)))
!                          (temp-face (make-symbol
!                                      (apply
!                                       'concat "temp-face-"
!                                       (mapcar '(lambda (sym)
!                                                  (if (stringp sym)
!                                                      sym
!                                                    (symbol-name sym)))
!                                               marks))))
!                          faceinfo)
!                     ;; Remove :face info from the marks, 
!                     ;; copy the face info into temp-face
!                     (setq faceinfo marks)
!                     (while (setq faceinfo (memq :face faceinfo))
!                       (copy-face (read (nth 1 faceinfo)) temp-face)
!                       (setcar faceinfo nil)
!                       (setcar (cdr faceinfo) nil))
!                     (setq marks (delq nil marks))
                  ;; Apply the font aspects
!                     (apply 'set-face-attribute temp-face nil marks)
!                     (search-backward entry)
!                     (overlay-put
!                      (make-overlay (match-beginning 0) (match-end 0))
!                      'face temp-face)))))
          (setq entry-list (cdr entry-list))))
        (set-buffer-modified-p nil)
        (goto-char (point-min))
***************
*** 633,639 ****
    (save-excursion
      (set-buffer (get-buffer-create fancy-diary-buffer))
      (setq buffer-read-only nil)
-     (make-local-variable 'mode-line-format)
      (calendar-set-mode-line "Diary Entries")
      (erase-buffer)
      (set-buffer-modified-p nil)
--- 663,668 ----
***************
*** 686,721 ****
  all entries, not just some, are visible.  If there is no diary buffer, one
  is created."
    (interactive)
!   (let ((d-file (substitute-in-file-name diary-file)))
!     (if (and d-file (file-exists-p d-file))
!         (if (file-readable-p d-file)
!             (save-excursion
!               (let ((diary-buffer (find-buffer-visiting d-file)))
!                 (set-buffer (if diary-buffer
!                                 diary-buffer
!                               (find-file-noselect d-file t)))
!                 (let ((buffer-read-only nil)
!                       (diary-modified (buffer-modified-p)))
!                   (subst-char-in-region (point-min) (point-max) ?\^M ?\n t)
!                   (setq selective-display nil)
!                   (make-local-variable 'mode-line-format)
!                   (setq mode-line-format default-mode-line-format)
!                   (display-buffer (current-buffer))
!                   (set-buffer-modified-p diary-modified))))
!           (error "Your diary file is not readable!"))
!       (error "You don't have a diary file!"))))
! 
! 
  
  (defcustom diary-mail-addr
!   (if (boundp 'user-mail-address) user-mail-address nil)
    "*Email address that `diary-mail-entries' will send email to."
    :group 'diary
!   :type '(choice string (const nil))
    :version "20.3")
  
  (defcustom diary-mail-days 7
!   "*Number of days for `diary-mail-entries' to check."
    :group 'diary
    :type 'integer
    :version "20.3")
--- 715,741 ----
  all entries, not just some, are visible.  If there is no diary buffer, one
  is created."
    (interactive)
!   (let ((d-file (diary-check-diary-file)))
!     (save-excursion
!       (set-buffer (or (find-buffer-visiting d-file)
!                       (find-file-noselect d-file t)))
!       (let ((buffer-read-only nil)
!             (diary-modified (buffer-modified-p)))
!         (subst-char-in-region (point-min) (point-max) ?\^M ?\n t)
!         (setq selective-display nil
!               mode-line-format default-mode-line-format)
!         (display-buffer (current-buffer))
!         (set-buffer-modified-p diary-modified)))))
  
  (defcustom diary-mail-addr
!   (if (boundp 'user-mail-address) user-mail-address "")
    "*Email address that `diary-mail-entries' will send email to."
    :group 'diary
!   :type  'string
    :version "20.3")
  
  (defcustom diary-mail-days 7
!   "*Default number of days for `diary-mail-entries' to check."
    :group 'diary
    :type 'integer
    :version "20.3")
***************
*** 724,729 ****
--- 744,750 ----
  (defun diary-mail-entries (&optional ndays)
    "Send a mail message showing diary entries for next NDAYS days.
  If no prefix argument is given, NDAYS is set to `diary-mail-days'.
+ Mail is sent to the address specified by `diary-mail-addr'.
  
  You can call `diary-mail-entries' every night using an at/cron job.
  For example, this script will run the program at 2am daily.  Since
***************
*** 734,739 ****
--- 755,761 ----
  # diary-rem.sh -- repeatedly run the Emacs diary-reminder
  emacs -batch \\
  -eval \"(setq diary-mail-days 3 \\
+              diary-file \\\"/path/to/diary.file\\\" \\
               european-calendar-style t \\
               diary-mail-addr \\\"address@hidden" )\" \\
  -l diary-lib -f diary-mail-entries
***************
*** 744,782 ****
  0 1 * * * diary-rem.sh
  to run it every morning at 1am."
    (interactive "P")
!   (let* ((diary-display-hook 'fancy-diary-display)
!          (text (progn (list-diary-entries (calendar-current-date)
!                                           (if ndays ndays diary-mail-days))
!                       (set-buffer fancy-diary-buffer)
!                       (buffer-substring (point-min) (point-max)))))
      (compose-mail diary-mail-addr
!                 (if (string-equal text "")
!                     "No entries found"
!                   (concat "Diary entries generated "
!                           (calendar-date-string (calendar-current-date)))))
!     (insert text)
!     (funcall (get mail-user-agent 'sendfunc))))
! 
! 
! (defun diary-name-pattern (string-array &optional fullname)
!   "Convert a STRING-ARRAY, an array of strings to a pattern.
! The pattern will match any of the strings, either entirely or abbreviated
! to three characters.  An abbreviated form will match with or without a period;
! If the optional FULLNAME is t, abbreviations will not match, just the full
! name."
!   (let ((pattern ""))
!     (calendar-for-loop i from 0 to (1- (length string-array)) do
!       (setq pattern
!             (concat
!              pattern
!              (if (string-equal pattern "") "" "\\|")
!              (aref string-array i)
!              (if fullname
!                  ""
!                (concat
!                 "\\|"
!                 (substring (aref string-array i) 0 3) ".?")))))
!     pattern))
  
  (defvar marking-diary-entries nil
    "True during the marking of diary entries, nil otherwise.")
--- 766,803 ----
  0 1 * * * diary-rem.sh
  to run it every morning at 1am."
    (interactive "P")
!   (if (string-equal diary-mail-addr "")
!       (error "You must set `diary-mail-addr' to use this command")
!     (let ((diary-display-hook 'fancy-diary-display))
!       (list-diary-entries (calendar-current-date) (or ndays diary-mail-days)))
      (compose-mail diary-mail-addr
!                   (concat "Diary entries generated "
!                           (calendar-date-string (calendar-current-date))))
!     (insert
!      (if (get-buffer fancy-diary-buffer)
!          (save-excursion
!            (set-buffer fancy-diary-buffer)
!            (buffer-substring (point-min) (point-max)))
!        "No entries found"))
!     (call-interactively (get mail-user-agent 'sendfunc))))
! 
! (defun diary-name-pattern (string-array &optional abbrev-array paren)
!   "Return a regexp matching the strings in the array STRING-ARRAY.
! If the optional argument ABBREV-ARRAY is present, then the function
! `calendar-abbrev-construct' is used to construct abbreviations from the
! two supplied arrays. The returned regexp will then also match these
! abbreviations, with or without final `.' characters.  If the optional
! argument PAREN is non-nil, the regexp is surrounded by parentheses."
!   (regexp-opt (append string-array
!                       (if abbrev-array
!                           (calendar-abbrev-construct abbrev-array
!                                                      string-array))
!                       (if abbrev-array
!                           (calendar-abbrev-construct abbrev-array
!                                                      string-array
!                                                      'period))
!                       nil)
!               paren))
  
  (defvar marking-diary-entries nil
    "True during the marking of diary entries, nil otherwise.")
***************
*** 791,917 ****
  `mark-diary-entries-hook' are run."
    (interactive)
    (setq mark-diary-entries-in-calendar t)
!   (let (file-glob-attrs
!       marks
!       (d-file (substitute-in-file-name diary-file))
!         (marking-diary-entries t))
!     (if (and d-file (file-exists-p d-file))
!         (if (file-readable-p d-file)
!             (save-excursion
!               (message "Marking diary entries...")
!               (set-buffer (find-file-noselect d-file t))
!             (setq file-glob-attrs (nth 1 (diary-pull-attrs nil '())))
!               (let ((d diary-date-forms)
!                     (old-diary-syntax-table))
!                 (setq old-diary-syntax-table (syntax-table))
!                 (set-syntax-table diary-syntax-table)
!                 (while d
!                   (let*
!                       ((date-form (if (equal (car (car d)) 'backup)
!                                       (cdr (car d))
!                                     (car d)));; ignore 'backup directive
!                        (dayname (diary-name-pattern calendar-day-name-array))
!                        (monthname
!                         (concat
!                          (diary-name-pattern calendar-month-name-array)
!                          "\\|\\*"))
!                        (month "[0-9]+\\|\\*")
!                        (day "[0-9]+\\|\\*")
!                        (year "[0-9]+\\|\\*")
!                        (l (length date-form))
!                        (d-name-pos (- l (length (memq 'dayname date-form))))
!                        (d-name-pos (if (/= l d-name-pos) (+ 2 d-name-pos)))
!                        (m-name-pos (- l (length (memq 'monthname date-form))))
!                        (m-name-pos (if (/= l m-name-pos) (+ 2 m-name-pos)))
!                        (d-pos (- l (length (memq 'day date-form))))
!                        (d-pos (if (/= l d-pos) (+ 2 d-pos)))
!                        (m-pos (- l (length (memq 'month date-form))))
!                        (m-pos (if (/= l m-pos) (+ 2 m-pos)))
!                        (y-pos (- l (length (memq 'year date-form))))
!                        (y-pos (if (/= l y-pos) (+ 2 y-pos)))
!                        (regexp
!                         (concat
!                          "\\(\\`\\|\^M\\|\n\\)\\("
!                          (mapconcat 'eval date-form "\\)\\(")
!                          "\\)"))
!                        (case-fold-search t))
!                     (goto-char (point-min))
!                     (while (re-search-forward regexp nil t)
!                       (let* ((dd-name
!                               (if d-name-pos
!                                   (buffer-substring-no-properties
!                                    (match-beginning d-name-pos)
!                                    (match-end d-name-pos))))
!                              (mm-name
!                               (if m-name-pos
!                                   (buffer-substring-no-properties
!                                    (match-beginning m-name-pos)
!                                    (match-end m-name-pos))))
!                              (mm (string-to-int
!                                   (if m-pos
!                                       (buffer-substring-no-properties
!                                        (match-beginning m-pos)
!                                        (match-end m-pos))
!                                     "")))
!                              (dd (string-to-int
!                                   (if d-pos
!                                       (buffer-substring-no-properties
!                                        (match-beginning d-pos)
!                                        (match-end d-pos))
!                                     "")))
!                              (y-str (if y-pos
!                                         (buffer-substring-no-properties
!                                          (match-beginning y-pos)
!                                          (match-end y-pos))))
!                              (yy (if (not y-str)
!                                      0
!                                    (if (and (= (length y-str) 2)
!                                             abbreviated-calendar-year)
!                                        (let* ((current-y
!                                                (extract-calendar-year
!                                                 (calendar-current-date)))
!                                               (y (+ (string-to-int y-str)
!                                                     (* 100
!                                                        (/ current-y 100)))))
!                                          (if (> (- y current-y) 50)
!                                              (- y 100)
!                                            (if (> (- current-y y) 50)
!                                                (+ y 100)
!                                              y)))
!                                      (string-to-int y-str))))
!                            (save-excursion
!                              (setq entry (buffer-substring-no-properties 
(point) (line-end-position))
!                                    temp (diary-pull-attrs entry 
file-glob-attrs)
!                                    entry (nth 0 temp)
!                                    marks (nth 1 temp))))
!                       (if dd-name
!                           (mark-calendar-days-named
!                            (cdr (assoc-ignore-case
!                                  (substring dd-name 0 3)
!                                  (calendar-make-alist
!                                   calendar-day-name-array
!                                   0
!                                   (lambda (x) (substring x 0 3))))) marks)
!                         (if mm-name
!                             (if (string-equal mm-name "*")
!                                 (setq mm 0)
!                               (setq mm
!                                     (cdr (assoc-ignore-case
!                                           (substring mm-name 0 3)
!                                           (calendar-make-alist
!                                            calendar-month-name-array
!                                            1
!                                            (lambda (x) (substring x 0 3)))
!                                           )))))
!                         (mark-calendar-date-pattern mm dd yy marks))))
!                     (setq d (cdr d))))
!                 (mark-sexp-diary-entries)
!                 (run-hooks 'nongregorian-diary-marking-hook
!                            'mark-diary-entries-hook)
!                 (set-syntax-table old-diary-syntax-table)
!                 (message "Marking diary entries...done")))
!           (error "Your diary file is not readable!"))
!       (error "You don't have a diary file!"))))
  
  (defun mark-sexp-diary-entries ()
    "Mark days in the calendar window that have sexp diary entries.
--- 812,930 ----
  `mark-diary-entries-hook' are run."
    (interactive)
    (setq mark-diary-entries-in-calendar t)
!   (let ((marking-diary-entries t)
!         file-glob-attrs marks)
!     (save-excursion
!       (set-buffer (find-file-noselect (diary-check-diary-file) t))
!       (message "Marking diary entries...")
!       (setq file-glob-attrs (nth 1 (diary-pull-attrs nil '())))
!       (let ((d diary-date-forms)
!             (old-diary-syntax-table (syntax-table))
!             temp)
!         (set-syntax-table diary-syntax-table)
!         (while d
!           (let* ((date-form (if (equal (car (car d)) 'backup)
!                                 (cdr (car d))
!                               (car d)));; ignore 'backup directive
!                  (dayname
!                   (diary-name-pattern calendar-day-name-array
!                                       calendar-day-abbrev-array))
!                  (monthname
!                   (format "%s\\|\\*"
!                    (diary-name-pattern calendar-month-name-array
!                                        calendar-month-abbrev-array)))
!                  (month "[0-9]+\\|\\*")
!                  (day "[0-9]+\\|\\*")
!                  (year "[0-9]+\\|\\*")
!                  (l (length date-form))
!                  (d-name-pos (- l (length (memq 'dayname date-form))))
!                  (d-name-pos (if (/= l d-name-pos) (+ 2 d-name-pos)))
!                  (m-name-pos (- l (length (memq 'monthname date-form))))
!                  (m-name-pos (if (/= l m-name-pos) (+ 2 m-name-pos)))
!                  (d-pos (- l (length (memq 'day date-form))))
!                  (d-pos (if (/= l d-pos) (+ 2 d-pos)))
!                  (m-pos (- l (length (memq 'month date-form))))
!                  (m-pos (if (/= l m-pos) (+ 2 m-pos)))
!                  (y-pos (- l (length (memq 'year date-form))))
!                  (y-pos (if (/= l y-pos) (+ 2 y-pos)))
!                  (regexp
!                   (concat
!                    "\\(\\`\\|\^M\\|\n\\)\\("
!                    (mapconcat 'eval date-form "\\)\\(")
!                    "\\)"))
!                  (case-fold-search t))
!             (goto-char (point-min))
!             (while (re-search-forward regexp nil t)
!               (let* ((dd-name
!                       (if d-name-pos
!                           (buffer-substring-no-properties
!                            (match-beginning d-name-pos)
!                            (match-end d-name-pos))))
!                      (mm-name
!                       (if m-name-pos
!                           (buffer-substring-no-properties
!                            (match-beginning m-name-pos)
!                            (match-end m-name-pos))))
!                      (mm (string-to-int
!                           (if m-pos
!                               (buffer-substring-no-properties
!                                (match-beginning m-pos)
!                                (match-end m-pos))
!                             "")))
!                      (dd (string-to-int
!                           (if d-pos
!                               (buffer-substring-no-properties
!                                (match-beginning d-pos)
!                                (match-end d-pos))
!                             "")))
!                      (y-str (if y-pos
!                                 (buffer-substring-no-properties
!                                  (match-beginning y-pos)
!                                  (match-end y-pos))))
!                      (yy (if (not y-str)
!                              0
!                            (if (and (= (length y-str) 2)
!                                     abbreviated-calendar-year)
!                                (let* ((current-y
!                                        (extract-calendar-year
!                                         (calendar-current-date)))
!                                       (y (+ (string-to-int y-str)
!                                             (* 100
!                                                (/ current-y 100)))))
!                                  (if (> (- y current-y) 50)
!                                      (- y 100)
!                                    (if (> (- current-y y) 50)
!                                        (+ y 100)
!                                      y)))
!                              (string-to-int y-str))))
!                      (save-excursion
!                        (setq entry (buffer-substring-no-properties
!                                     (point) (line-end-position))
!                              temp (diary-pull-attrs entry file-glob-attrs)
!                              entry (nth 0 temp)
!                              marks (nth 1 temp))))
!                 (if dd-name
!                     (mark-calendar-days-named
!                      (cdr (assoc-ignore-case
!                            dd-name
!                            (calendar-make-alist
!                             calendar-day-name-array
!                             0 nil calendar-day-abbrev-array))) marks)
!                   (if mm-name
!                       (setq mm
!                             (if (string-equal mm-name "*") 0
!                               (cdr (assoc-ignore-case
!                                     mm-name
!                                     (calendar-make-alist
!                                      calendar-month-name-array
!                                      1 nil calendar-month-abbrev-array))))))
!                   (mark-calendar-date-pattern mm dd yy marks))))
!             (setq d (cdr d))))
!         (mark-sexp-diary-entries)
!         (run-hooks 'nongregorian-diary-marking-hook
!                    'mark-diary-entries-hook)
!         (set-syntax-table old-diary-syntax-table)
!         (message "Marking diary entries...done")))))
  
  (defun mark-sexp-diary-entries ()
    "Mark days in the calendar window that have sexp diary entries.
***************
*** 919,934 ****
  is marked.  See the documentation for the function `list-sexp-diary-entries'."
    (let* ((sexp-mark (regexp-quote sexp-diary-entry-symbol))
           (s-entry (concat "\\(\\`\\|\^M\\|\n\\)\\("
!                           (regexp-quote sexp-mark) "(\\)\\|\\("
                            (regexp-quote diary-nonmarking-symbol)
!                           (regexp-quote sexp-mark) "(diary-remind\\)"))
!          (m)
!          (y)
!          (first-date)
!          (last-date)
!          (mark)
!        file-glob-attrs)
!     (setq file-glob-attrs (nth 1 (diary-pull-attrs nil '())))
      (save-excursion
        (set-buffer calendar-buffer)
        (setq m displayed-month)
--- 932,942 ----
  is marked.  See the documentation for the function `list-sexp-diary-entries'."
    (let* ((sexp-mark (regexp-quote sexp-diary-entry-symbol))
           (s-entry (concat "\\(\\`\\|\^M\\|\n\\)\\("
!                           sexp-mark "(\\)\\|\\("
                            (regexp-quote diary-nonmarking-symbol)
!                           sexp-mark "(diary-remind\\)"))
!          (file-glob-attrs (nth 1 (diary-pull-attrs nil '())))
!          m y first-date last-date mark file-glob-attrs)
      (save-excursion
        (set-buffer calendar-buffer)
        (setq m displayed-month)
***************
*** 942,956 ****
             (list m (calendar-last-day-of-month m y) y)))
      (goto-char (point-min))
      (while (re-search-forward s-entry nil t)
!       (if (char-equal (preceding-char) ?\()
!           (setq marking-diary-entry t)
!         (setq marking-diary-entry nil))
        (re-search-backward "(")
        (let ((sexp-start (point))
!             (sexp)
!             (entry)
!             (entry-start)
!             (line-start))
          (forward-sexp)
          (setq sexp (buffer-substring-no-properties sexp-start (point)))
          (save-excursion
--- 950,959 ----
             (list m (calendar-last-day-of-month m y) y)))
      (goto-char (point-min))
      (while (re-search-forward s-entry nil t)
!       (setq marking-diary-entry (char-equal (preceding-char) ?\())
        (re-search-backward "(")
        (let ((sexp-start (point))
!             sexp entry entry-start line-start marks)
          (forward-sexp)
          (setq sexp (buffer-substring-no-properties sexp-start (point)))
          (save-excursion
***************
*** 980,989 ****
                                  (calendar-gregorian-from-absolute date)))
              (progn
                (setq marks (diary-pull-attrs entry file-glob-attrs)
!                     temp (diary-pull-attrs entry file-glob-attrs)
!                     marks (nth 1 temp))
                (mark-visible-calendar-date
!                (calendar-gregorian-from-absolute date) 
                 (if (< 0 (length marks))
                     marks
                   (if (consp mark)
--- 983,991 ----
                                  (calendar-gregorian-from-absolute date)))
              (progn
                (setq marks (diary-pull-attrs entry file-glob-attrs)
!                     marks (nth 1 (diary-pull-attrs entry file-glob-attrs)))
                (mark-visible-calendar-date
!                (calendar-gregorian-from-absolute date)
                 (if (< 0 (length marks))
                     marks
                   (if (consp mark)
***************
*** 1284,1306 ****
  
  Marking these entries is *extremely* time consuming, so these entries are
  best if they are nonmarking."
!   (let* ((mark (regexp-quote diary-nonmarking-symbol))
!          (sexp-mark (regexp-quote sexp-diary-entry-symbol))
!          (s-entry (concat "\\(\\`\\|\^M\\|\n\\)" mark "?" sexp-mark "("))
!          (entry-found)
!        (file-glob-attrs)
!        (marks))
      (goto-char (point-min))
      (save-excursion
        (setq file-glob-attrs (nth 1 (diary-pull-attrs nil '()))))
      (while (re-search-forward s-entry nil t)
        (backward-char 1)
        (let ((sexp-start (point))
!             (sexp)
!             (entry)
!             (specifier)
!             (entry-start)
!             (line-start))
          (forward-sexp)
          (setq sexp (buffer-substring-no-properties sexp-start (point)))
          (save-excursion
--- 1286,1304 ----
  
  Marking these entries is *extremely* time consuming, so these entries are
  best if they are nonmarking."
!   (let ((s-entry (concat "\\(\\`\\|\^M\\|\n\\)" 
!                          (regexp-quote diary-nonmarking-symbol)
!                          "?"
!                          (regexp-quote sexp-diary-entry-symbol)
!                          "("))
!         entry-found file-glob-attrs marks)
      (goto-char (point-min))
      (save-excursion
        (setq file-glob-attrs (nth 1 (diary-pull-attrs nil '()))))
      (while (re-search-forward s-entry nil t)
        (backward-char 1)
        (let ((sexp-start (point))
!             sexp entry specifier entry-start line-start)
          (forward-sexp)
          (setq sexp (buffer-substring-no-properties sexp-start (point)))
          (save-excursion
***************
*** 1324,1330 ****
            (setq entry (buffer-substring-no-properties entry-start (point)))
            (while (string-match "[\^M]" entry)
              (aset entry (match-beginning 0) ?\n )))
!         (let ((diary-entry (diary-sexp-entry sexp entry date)))
          (setq entry (if (consp diary-entry)
                          (cdr diary-entry)
                        diary-entry))
--- 1322,1329 ----
            (setq entry (buffer-substring-no-properties entry-start (point)))
            (while (string-match "[\^M]" entry)
              (aset entry (match-beginning 0) ?\n )))
!         (let ((diary-entry (diary-sexp-entry sexp entry date))
!               temp)
          (setq entry (if (consp diary-entry)
                          (cdr diary-entry)
                        diary-entry))
***************
*** 1339,1345 ****
                             entry
                             specifier
                             (if entry-start (copy-marker entry-start)
!                              nil) 
                             marks)
          (setq entry-found (or entry-found diary-entry)))))
      entry-found))
--- 1338,1344 ----
                             entry
                             specifier
                             (if entry-start (copy-marker entry-start)
!                              nil)
                             marks)
          (setq entry-found (or entry-found diary-entry)))))
      entry-found))
***************
*** 1379,1393 ****
  
  An optional parameter MARK specifies a face or single-character string to
  use when highlighting the day in the calendar."
!   (let* ((dd (if european-calendar-style
                  month
                day))
!          (mm (if european-calendar-style
                  day
                month))
!          (m (extract-calendar-month date))
!          (y (extract-calendar-year date))
!          (d (extract-calendar-day date)))
      (if (and
           (or (and (listp dd) (memq d dd))
               (equal d dd)
--- 1378,1392 ----
  
  An optional parameter MARK specifies a face or single-character string to
  use when highlighting the day in the calendar."
!   (let ((dd (if european-calendar-style
                  month
                day))
!         (mm (if european-calendar-style
                  day
                month))
!         (m (extract-calendar-month date))
!         (y (extract-calendar-year date))
!         (d (extract-calendar-day date)))
      (if (and
           (or (and (listp dd) (memq d dd))
               (equal d dd)
***************
*** 1601,1621 ****
  (defun add-to-diary-list (date string specifier marker &optional globcolor)
    "Add the entry (DATE STRING SPECIFIER MARKER GLOBCOLOR) to 
`diary-entries-list'.
  Do nothing if DATE or STRING is nil."
!   (and date string
!        (if (and diary-file-name-prefix
!               (setq prefix (concat "[" (funcall 
diary-file-name-prefix-function (buffer-file-name)) "] "))
!               (not (string= prefix "[] ")))
!          (setq string (concat prefix string))
!        t)
!        (setq diary-entries-list
!              (append diary-entries-list
!                    (list (list date string specifier marker globcolor))))))
  
  (defun make-diary-entry (string &optional nonmarking file)
    "Insert a diary entry STRING which may be NONMARKING in FILE.
! If omitted, NONMARKING defaults to nil and FILE defaults to diary-file."
!   (find-file-other-window
!    (substitute-in-file-name (if file file diary-file)))
    (widen)
    (goto-char (point-max))
    (when (let ((case-fold-search t))
--- 1600,1620 ----
  (defun add-to-diary-list (date string specifier marker &optional globcolor)
    "Add the entry (DATE STRING SPECIFIER MARKER GLOBCOLOR) to 
`diary-entries-list'.
  Do nothing if DATE or STRING is nil."
!   (when (and date string)
!     (if diary-file-name-prefix
!         (let ((prefix (funcall diary-file-name-prefix-function
!                                (buffer-file-name))))
!           (or (string= prefix "")
!               (setq string (format "[%s] %s" prefix string)))))
!     (setq diary-entries-list
!           (append diary-entries-list
!                   (list (list date string specifier marker globcolor))))))
  
  (defun make-diary-entry (string &optional nonmarking file)
    "Insert a diary entry STRING which may be NONMARKING in FILE.
! If omitted, NONMARKING defaults to nil and FILE defaults to `diary-file'."
!   (let ((pop-up-frames (window-dedicated-p (selected-window))))
!     (find-file-other-window (substitute-in-file-name (or file diary-file))))
    (widen)
    (goto-char (point-max))
    (when (let ((case-fold-search t))
***************
*** 1648,1657 ****
    "Insert a monthly diary entry for the day of the month indicated by point.
  Prefix arg will make the entry nonmarking."
    (interactive "P")
!   (let* ((calendar-date-display-form
!           (if european-calendar-style
!               '(day " * ")
!             '("* " day))))
      (make-diary-entry (calendar-date-string (calendar-cursor-to-date t) t)
                        arg)))
  
--- 1647,1656 ----
    "Insert a monthly diary entry for the day of the month indicated by point.
  Prefix arg will make the entry nonmarking."
    (interactive "P")
!   (let ((calendar-date-display-form
!          (if european-calendar-style
!              '(day " * ")
!            '("* " day))))
      (make-diary-entry (calendar-date-string (calendar-cursor-to-date t) t)
                        arg)))
  
***************
*** 1659,1668 ****
    "Insert an annual diary entry for the day of the year indicated by point.
  Prefix arg will make the entry nonmarking."
    (interactive "P")
!   (let* ((calendar-date-display-form
!           (if european-calendar-style
!               '(day " " monthname)
!             '(monthname " " day))))
      (make-diary-entry (calendar-date-string (calendar-cursor-to-date t) t)
                        arg)))
  
--- 1658,1667 ----
    "Insert an annual diary entry for the day of the year indicated by point.
  Prefix arg will make the entry nonmarking."
    (interactive "P")
!   (let ((calendar-date-display-form
!          (if european-calendar-style
!              '(day " " monthname)
!            '(monthname " " day))))
      (make-diary-entry (calendar-date-string (calendar-cursor-to-date t) t)
                        arg)))
  
***************
*** 1670,1679 ****
    "Insert an anniversary diary entry for the date given by point.
  Prefix arg will make the entry nonmarking."
    (interactive "P")
!   (let* ((calendar-date-display-form
!           (if european-calendar-style
!               '(day " " month " " year)
!             '(month " " day " " year))))
      (make-diary-entry
       (format "%s(diary-anniversary %s)"
               sexp-diary-entry-symbol
--- 1669,1678 ----
    "Insert an anniversary diary entry for the date given by point.
  Prefix arg will make the entry nonmarking."
    (interactive "P")
!   (let ((calendar-date-display-form
!          (if european-calendar-style
!              '(day " " month " " year)
!            '(month " " day " " year))))
      (make-diary-entry
       (format "%s(diary-anniversary %s)"
               sexp-diary-entry-symbol
***************
*** 1684,1698 ****
    "Insert a block diary entry for the days between the point and marked date.
  Prefix arg will make the entry nonmarking."
    (interactive "P")
!   (let* ((calendar-date-display-form
!           (if european-calendar-style
!               '(day " " month " " year)
!             '(month " " day " " year)))
           (cursor (calendar-cursor-to-date t))
           (mark (or (car calendar-mark-ring)
                     (error "No mark set in this buffer")))
!          (start)
!          (end))
      (if (< (calendar-absolute-from-gregorian mark)
             (calendar-absolute-from-gregorian cursor))
          (setq start mark
--- 1683,1696 ----
    "Insert a block diary entry for the days between the point and marked date.
  Prefix arg will make the entry nonmarking."
    (interactive "P")
!   (let ((calendar-date-display-form
!          (if european-calendar-style
!              '(day " " month " " year)
!            '(month " " day " " year)))
           (cursor (calendar-cursor-to-date t))
           (mark (or (car calendar-mark-ring)
                     (error "No mark set in this buffer")))
!          start end)
      (if (< (calendar-absolute-from-gregorian mark)
             (calendar-absolute-from-gregorian cursor))
          (setq start mark
***************
*** 1710,1719 ****
    "Insert a cyclic diary entry starting at the date given by point.
  Prefix arg will make the entry nonmarking."
    (interactive "P")
!   (let* ((calendar-date-display-form
!           (if european-calendar-style
!               '(day " " month " " year)
!             '(month " " day " " year))))
      (make-diary-entry
       (format "%s(diary-cyclic %d %s)"
               sexp-diary-entry-symbol
--- 1708,1717 ----
    "Insert a cyclic diary entry starting at the date given by point.
  Prefix arg will make the entry nonmarking."
    (interactive "P")
!   (let ((calendar-date-display-form
!          (if european-calendar-style
!              '(day " " month " " year)
!            '(month " " day " " year))))
      (make-diary-entry
       (format "%s(diary-cyclic %d %s)"
               sexp-diary-entry-symbol
***************
*** 1733,1753 ****
    "Diary"
    "Major mode used while displaying diary entries using Fancy Display."
    (set (make-local-variable 'font-lock-defaults)
!        '(fancy-diary-font-lock-keywords t)))
  
  
  (defvar fancy-diary-font-lock-keywords
    (list
     (cons
      (concat
!      (let ((dayname
!           (concat "\\("
!                   (diary-name-pattern calendar-day-name-array t)
!                   "\\)"))
!          (monthname
!           (concat "\\("
!                   (diary-name-pattern calendar-month-name-array t)
!                   "\\)"))
           (day "[0-9]+")
             (month "[0-9]+")
           (year "-?[0-9]+"))
--- 1731,1746 ----
    "Diary"
    "Major mode used while displaying diary entries using Fancy Display."
    (set (make-local-variable 'font-lock-defaults)
!        '(fancy-diary-font-lock-keywords t))
!   (define-key (current-local-map) "q" 'quit-window))
  
  
  (defvar fancy-diary-font-lock-keywords
    (list
     (cons
      (concat
!      (let ((dayname (diary-name-pattern calendar-day-name-array nil t))
!            (monthname (diary-name-pattern calendar-month-name-array nil t))
           (day "[0-9]+")
             (month "[0-9]+")
           (year "-?[0-9]+"))
***************
*** 1780,1797 ****
              t))
        (error t))))
  
! (defun font-lock-diary-date-forms (month-list &optional symbol noabbrev)
!   "Create a list of font-lock patterns for `diary-date-forms' with MONTH-LIST.
  If given, optional SYMBOL must be a prefix to entries.
! If optional NOABBREV is t, do not allow abbreviations in names."
!   (let* ((dayname
!           (concat "\\(" (diary-name-pattern calendar-day-name-array) "\\)"))
!          (monthname (concat "\\("
!                             (diary-name-pattern month-list noabbrev)
!                             "\\|\\*\\)"))
!          (month "\\([0-9]+\\|\\*\\)")
!          (day "\\([0-9]+\\|\\*\\)")
!          (year "-?\\([0-9]+\\|\\*\\)"))
      (mapcar '(lambda (x)
                 (cons
                  (concat "^" (regexp-quote diary-nonmarking-symbol) "?"
--- 1773,1792 ----
              t))
        (error t))))
  
! (defun font-lock-diary-date-forms (month-array &optional symbol abbrev-array)
!   "Create font-lock patterns for `diary-date-forms' using MONTH-ARRAY.
  If given, optional SYMBOL must be a prefix to entries.
! If optional ABBREV-ARRAY is present, the abbreviations constructed
! from this array by the function `calendar-abbrev-construct' are
! matched (with or without a final `.'), in addition to the full month
! names."
!   (let ((dayname (diary-name-pattern calendar-day-name-array
!                                      calendar-day-abbrev-array t))
!         (monthname (format "\\(%s\\|\\*\\)"
!                            (diary-name-pattern month-array abbrev-array)))
!         (month "\\([0-9]+\\|\\*\\)")
!         (day "\\([0-9]+\\|\\*\\)")
!         (year "-?\\([0-9]+\\|\\*\\)"))
      (mapcar '(lambda (x)
                 (cons
                  (concat "^" (regexp-quote diary-nonmarking-symbol) "?"
***************
*** 1810,1836 ****
                  '(1 diary-face)))
              diary-date-forms)))
  
  (defvar diary-font-lock-keywords
        (append
!        (font-lock-diary-date-forms calendar-month-name-array)
!        (if (or (memq 'mark-hebrew-diary-entries
!                      nongregorian-diary-marking-hook)
!                (memq 'list-hebrew-diary-entries
!                      nongregorian-diary-listing-hook))
!            (progn
!              (require 'cal-hebrew)
!              (font-lock-diary-date-forms
!               calendar-hebrew-month-name-array-leap-year
!               hebrew-diary-entry-symbol t)))
!        (if (or (memq 'mark-islamic-diary-entries
!                      nongregorian-diary-marking-hook)
!                (memq 'list-islamic-diary-entries
!                      nongregorian-diary-listing-hook))
!            (progn
!              (require 'cal-islamic)
!              (font-lock-diary-date-forms
!               calendar-islamic-month-name-array-leap-year
!               islamic-diary-entry-symbol t)))
         (list
          (cons
           (concat "^" (regexp-quote diary-include-string) ".*$")
--- 1805,1833 ----
                  '(1 diary-face)))
              diary-date-forms)))
  
+ (eval-when-compile (require 'cal-hebrew)
+                    (require 'cal-islam))
+ 
  (defvar diary-font-lock-keywords
        (append
!        (font-lock-diary-date-forms calendar-month-name-array
!                                    nil calendar-month-abbrev-array)
!        (when (or (memq 'mark-hebrew-diary-entries
!                        nongregorian-diary-marking-hook)
!                  (memq 'list-hebrew-diary-entries
!                        nongregorian-diary-listing-hook))
!          (require 'cal-hebrew)
!          (font-lock-diary-date-forms
!           calendar-hebrew-month-name-array-leap-year
!           hebrew-diary-entry-symbol))
!        (when (or (memq 'mark-islamic-diary-entries
!                        nongregorian-diary-marking-hook)
!                  (memq 'list-islamic-diary-entries
!                        nongregorian-diary-listing-hook))
!          (require 'cal-islam)
!          (font-lock-diary-date-forms
!           calendar-islamic-month-name-array
!           islamic-diary-entry-symbol))
         (list
          (cons
           (concat "^" (regexp-quote diary-include-string) ".*$")
***************
*** 1858,1861 ****
--- 1855,1859 ----
  
  (provide 'diary-lib)
  
+ ;;; arch-tag: 22dd506e-2e33-410d-9ae1-095a0c1b2010
  ;;; diary-lib.el ends here




reply via email to

[Prev in Thread] Current Thread [Next in Thread]