Add 2012 to FSF copyright years for Emacs files
[bpt/emacs.git] / lisp / calendar / cal-html.el
index de5b68c..8073295 100644 (file)
@@ -1,12 +1,12 @@
 ;;; cal-html.el --- functions for printing HTML calendars
 
-;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008
-;;   Free Software Foundation, Inc.
+;; Copyright (C) 2002-2012  Free Software Foundation, Inc.
 
 ;; Author: Anna M. Bigatti <bigatti@dima.unige.it>
 ;; Keywords: calendar
 ;; Human-Keywords: calendar, diary, HTML
 ;; Created: 23 Aug 2002
+;; Package: calendar
 
 ;; This file is part of GNU Emacs.
 
   :type 'integer
   :group 'calendar-html)
 
-(defcustom cal-html-day-abbrev-array
-  (calendar-abbrev-construct calendar-day-abbrev-array
-                             calendar-day-name-array)
+(defcustom cal-html-day-abbrev-array calendar-day-abbrev-array
   "Array of seven strings for abbreviated day names (starting with Sunday)."
-  :type '(vector string string string string string string string)
+  :set-after '(calendar-day-abbrev-array)
+  :type '(vector (string :tag "Sun")
+                 (string :tag "Mon")
+                 (string :tag "Tue")
+                 (string :tag "Wed")
+                 (string :tag "Thu")
+                 (string :tag "Fri")
+                 (string :tag "Sat"))
   :group 'calendar-html)
 
 (defcustom cal-html-css-default
@@ -247,7 +252,7 @@ Contains links to previous and next month and year, and current minical."
     (insert cal-html-e-tablerow-string)
     ;; Initial empty slots.
     (insert cal-html-b-tablerow-string)
-    (dotimes (i blank-days)
+    (dotimes (_i blank-days)
       (insert
        cal-html-b-tabledata-string
        cal-html-e-tabledata-string))
@@ -343,10 +348,8 @@ DATE-LIST is a list of diary entries.  Return only those matching DATE."
 
 (defun cal-html-list-diary-entries (d1 d2)
   "Generate a list of all diary-entries from absolute date D1 to D2."
-  (let (diary-display-hook)
-    (diary-list-entries
-     (calendar-gregorian-from-absolute d1)
-     (1+ (- d2 d1)))))
+  (diary-list-entries (calendar-gregorian-from-absolute d1)
+                      (1+ (- d2 d1)) t))
 
 
 (defun cal-html-insert-agenda-days (month year diary-list)
@@ -410,27 +413,30 @@ four-digit YEAR.  Diary entries in DIARY-LIST are included."
 ;;; User commands.
 
 ;;;###cal-autoload
-(defun cal-html-cursor-month (month year dir)
+(defun cal-html-cursor-month (month year dir &optional event)
   "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."
-  (interactive (let* ((date (calendar-cursor-to-date t))
+MONTH and YEAR are taken from the calendar cursor position, or from
+the position specified by EVENT.  Note that any existing output files
+are overwritten."
+  (interactive (let* ((event last-nonmenu-event)
+                      (date (calendar-cursor-to-date t event))
                       (month (calendar-extract-month date))
                       (year (calendar-extract-year date)))
-                 (list month year (cal-html-year-dir-ask-user year))))
+                 (list month year (cal-html-year-dir-ask-user year) event)))
   (make-directory dir t)
   (cal-html-one-month month year dir))
 
 ;;;###cal-autoload
-(defun cal-html-cursor-year (year dir)
+(defun cal-html-cursor-year (year dir &optional event)
   "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."
-  (interactive (let ((year (calendar-extract-year
-                            (calendar-cursor-to-date t))))
-                 (list year (cal-html-year-dir-ask-user year))))
+YEAR is taken from the calendar cursor position, or from the position
+specified by EVENT.  Note that any existing output files are overwritten."
+  (interactive (let* ((event last-nonmenu-event)
+                      (year (calendar-extract-year
+                             (calendar-cursor-to-date t event))))
+                 (list year (cal-html-year-dir-ask-user year) event)))
   (make-directory dir t)
   (with-temp-buffer
     (cal-html-insert-year-minicals year cal-html-year-index-cols)
@@ -441,5 +447,4 @@ existing output files are overwritten."
 
 (provide 'cal-html)
 
-;; arch-tag: 4e73377d-d2c1-46ea-a103-02c111da5f57
 ;;; cal-html.el ends here