]> code.delx.au - gnu-emacs/blobdiff - lisp/calendar/calendar.el
Do not assume DST starts/ends on the same date in every year.
[gnu-emacs] / lisp / calendar / calendar.el
index c0bfde951b6a22407a38bce15fcfcac272c21a86..c5e7f85f51b73bb67b94a6508bd19e9000d67819 100644 (file)
@@ -213,12 +213,6 @@ If nil, make an icon of the frame.  If non-nil, delete the frame."
 ;; backward-compatibility alias
 (put 'holiday-face 'face-alias 'holiday)
 
-(eval-after-load "facemenu"
-  '(progn
-     (add-to-list 'facemenu-unlisted-faces 'diary)
-     (add-to-list 'facemenu-unlisted-faces 'calendar-today)
-     (add-to-list 'facemenu-unlisted-faces 'holiday)))
-
 (defcustom diary-entry-marker
   (if (not (display-color-p))
       "+"
@@ -574,11 +568,20 @@ are
 
 Names can be capitalized or not, written in full (as specified by the
 variable `calendar-day-name-array'), or abbreviated (as specified by
-`calendar-day-abbrev-array') with or without a period.  To take effect,
-this variable should be set before the calendar package and its associates
-are loaded.  Otherwise, use one of the functions `european-calendar' or
-`american-calendar' to force the appropriate update."
+`calendar-day-abbrev-array') with or without a period.
+
+Setting this variable directly does not take effect (if the
+calendar package is already loaded).  Rather, use either
+\\[customize] or the functions `european-calendar' and
+`american-calendar'."
   :type 'boolean
+  ;; Without :initialize (require 'calendar) throws an error because
+  ;; american-calendar is undefined at this point.
+  :initialize 'custom-initialize-default
+  :set (lambda (symbol value)
+         (if value
+             (european-calendar)
+           (american-calendar)))
   :group 'diary)
 
 ;;;###autoload
@@ -1588,6 +1591,19 @@ See the documentation of that function for more information."
          (calendar-only-one-frame-setup arg))
         (t (calendar-basic-setup arg))))
 
+(autoload 'diary-view-entries "diary-lib"
+  "Prepare and display a buffer with diary entries.
+Searches your diary file for entries that match ARG days starting with
+the date indicated by the cursor position in the displayed three-month
+calendar."
+  t)
+
+(autoload 'list-calendar-holidays "holidays"
+  "Create a buffer containing the holidays for the current calendar window.
+The holidays are those in the list `calendar-notable-days'.  Returns t if any
+holidays are found, nil if not."
+  t)
+
 (defun calendar-basic-setup (&optional arg)
   "Display a three-month calendar in another window.
 The three months appear side by side, with the current month in the middle
@@ -1655,13 +1671,6 @@ to be replaced by asterisks to highlight it whenever it is in the window."
         (list-calendar-holidays)))
   (run-hooks 'initial-calendar-window-hook))
 
-(autoload 'diary-view-entries "diary-lib"
-  "Prepare and display a buffer with diary entries.
-Searches your diary file for entries that match ARG days starting with
-the date indicated by the cursor position in the displayed three-month
-calendar."
-  t)
-
 (autoload 'view-other-diary-entries "diary-lib"
   "Prepare and display buffer of diary entries from an alternative diary file.
 Searches for entries that match ARG days, starting with the date indicated
@@ -1847,7 +1856,7 @@ Driven by the variable `calendar-date-display-form'.")
 (autoload 'calendar-persian-date-string "cal-persia"
   "String of Persian date of Gregorian date.")
 
-(autoload 'show-all-diary-entries "diary-lib"
+(autoload 'diary-show-all-entries "diary-lib"
   "Show all of the diary entries in the diary file.
 This function gets rid of the selective display of the diary file so that
 all entries, not just some, are visible.  If there is no diary buffer, one
@@ -1860,8 +1869,7 @@ Each entry in diary file visible in the calendar window is marked."
   t)
 
 (autoload 'make-diary-entry "diary-lib"
-  "Insert a diary entry STRING which may be NONMARKING in FILE."
-  t)
+  "Insert a diary entry STRING which may be NONMARKING in FILE.")
 
 (autoload 'insert-diary-entry "diary-lib"
   "Insert a diary entry for the date indicated by point."
@@ -1937,78 +1945,84 @@ to the date indicated by point."
 to the date indicated by point."
   t)
 
-(autoload 'list-calendar-holidays "holidays"
-  "Create a buffer containing the holidays for the current calendar window.
-The holidays are those in the list `calendar-notable-days'.  Returns t if any
-holidays are found, nil if not."
-  t)
-
 (autoload 'cal-tex-cursor-month "cal-tex"
   "Make a buffer with LaTeX commands for the month cursor is on.
 Optional prefix argument specifies number of months to be produced.
-Calendar is condensed onto one page.")
+Calendar is condensed onto one page." t)
 
 (autoload 'cal-tex-cursor-month-landscape "cal-tex"
   "Make a buffer with LaTeX commands for the month cursor is on.
-Optional prefix argument specifies number of months to be produced.")
+Optional prefix argument specifies number of months to be produced." t)
 
 (autoload 'cal-tex-cursor-day "cal-tex"
-  "Make a buffer with LaTeX commands for the day cursor is on.")
+  "Make a buffer with LaTeX commands for the day cursor is on." t)
 
 (autoload 'cal-tex-cursor-week "cal-tex"
   "Make a buffer with LaTeX commands for a two-page one-week calendar.
 It applies to the week that point is in.
 Optional prefix argument specifies number of weeks.
-Holidays are included if `cal-tex-holidays' is t.")
+Holidays are included if `cal-tex-holidays' is t." t)
 
 (autoload 'cal-tex-cursor-week2 "cal-tex"
   "Make a buffer with LaTeX commands for a two-page one-week calendar.
 It applies to the week that point is in.
 Optional prefix argument specifies number of weeks.
-Holidays are included if `cal-tex-holidays' is t.")
+Holidays are included if `cal-tex-holidays' is t." t)
 
 (autoload 'cal-tex-cursor-week-iso "cal-tex"
   "Make a buffer with LaTeX commands for a one page ISO-style weekly calendar.
 Optional prefix argument specifies number of weeks.
 Diary entries are included if `cal-tex-diary' is t.
-Holidays are included if `cal-tex-holidays' is t.")
+Holidays are included if `cal-tex-holidays' is t." t)
 
 (autoload 'cal-tex-cursor-week-monday "cal-tex"
   "Make a buffer with LaTeX commands for a two-page one-week calendar.
 It applies to the week that point is in, and starts on Monday.
 Optional prefix argument specifies number of weeks.
-Holidays are included if `cal-tex-holidays' is t.")
+Holidays are included if `cal-tex-holidays' is t." t)
 
 (autoload 'cal-tex-cursor-filofax-2week "cal-tex"
   "Two-weeks-at-a-glance Filofax style calendar for week indicated by cursor.
 Optional prefix argument specifies number of weeks.
 Diary entries are included if cal-tex-diary is t.
-Holidays are included if `cal-tex-holidays' is t.")
+Holidays are included if `cal-tex-holidays' is t." t)
 
 (autoload 'cal-tex-cursor-filofax-week "cal-tex"
   "One-week-at-a-glance Filofax style calendar for week indicated by cursor.
 Optional prefix argument specifies number of weeks.
 Weeks start on Monday.
 Diary entries are included if cal-tex-diary is t.
-Holidays are included if `cal-tex-holidays' is t.")
+Holidays are included if `cal-tex-holidays' is t." t)
 
 (autoload 'cal-tex-cursor-filofax-daily "cal-tex"
   "Day-per-page Filofax style calendar for week indicated by cursor.
 Optional prefix argument specifies number of weeks.  Weeks start on Monday.
 Diary entries are included if `cal-tex-diary' is t.
-Holidays are included if `cal-tex-holidays' is t.")
+Holidays are included if `cal-tex-holidays' is t." t)
 
 (autoload 'cal-tex-cursor-year "cal-tex"
   "Make a buffer with LaTeX commands for a year's calendar.
-Optional prefix argument specifies number of years.")
+Optional prefix argument specifies number of years." t)
 
 (autoload 'cal-tex-cursor-year-landscape "cal-tex"
   "Make a buffer with LaTeX commands for a year's calendar (landscape).
-Optional prefix argument specifies number of years.")
+Optional prefix argument specifies number of years." t)
 
 (autoload 'cal-tex-cursor-filofax-year "cal-tex"
   "Make a buffer with LaTeX commands for a year's calendar (Filofax).
-Optional prefix argument specifies number of years.")
+Optional prefix argument specifies number of years." t)
+
+(autoload 'cal-html-cursor-month "cal-html"
+  "Write an HTML calendar file for numeric MONTH of four-digit YEAR.
+The output directory DIR is created if necessary.  Interactively,
+MONTH and YEAR are taken from the calendar cursor position.  Note
+that any existing output files are overwritten." t)
+
+(autoload 'cal-html-cursor-year "cal-html"
+  "Write HTML calendar files (index and monthly pages) for four-digit YEAR.
+The output directory DIR is created if necessary.  Interactively,
+YEAR is taken from the calendar cursor position.  Note that any
+existing output files are overwritten." t)
 
 (autoload 'mark-calendar-holidays "holidays"
   "Mark notable days in the calendar window."
@@ -2254,7 +2268,7 @@ movement commands will not work correctly."
     (define-key map "m"   'mark-diary-entries)
     (define-key map "d"   'diary-view-entries)
     (define-key map "D"   'view-other-diary-entries)
-    (define-key map "s"   'show-all-diary-entries)
+    (define-key map "s"   'diary-show-all-entries)
     (define-key map "pd"  'calendar-print-day-of-year)
     (define-key map "pC"  'calendar-print-chinese-date)
     (define-key map "pk"  'calendar-print-coptic-date)
@@ -2286,6 +2300,8 @@ movement commands will not work correctly."
     (define-key map "iBm" 'insert-monthly-bahai-diary-entry)
     (define-key map "iBy" 'insert-yearly-bahai-diary-entry)
     (define-key map "?"   'calendar-goto-info-node)
+    (define-key map "Hm" 'cal-html-cursor-month)
+    (define-key map "Hy" 'cal-html-cursor-year)
     (define-key map "tm" 'cal-tex-cursor-month)
     (define-key map "tM" 'cal-tex-cursor-month-landscape)
     (define-key map "td" 'cal-tex-cursor-day)