;;; cal-html.el --- functions for printing HTML calendars
-;; Copyright (C) 2002-2012 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2016 Free Software Foundation, Inc.
;; Author: Anna M. Bigatti <bigatti@dima.unige.it>
;; Keywords: calendar
;;; Code:
(require 'calendar)
+(require 'diary-lib)
\f
(defgroup calendar-html nil
(defcustom cal-html-holidays t
"If non-nil, include holidays as well as diary entries."
- :version "24.2"
+ :version "24.3"
:type 'boolean
:group 'calendar-html)
"</STYLE>\n\n")
"Default cal-html css style. You can override this with a \"cal.css\" file."
:type 'string
- :version "24.2" ; added SPAN.HOLIDAY
+ :version "24.3" ; added SPAN.HOLIDAY
:group 'calendar-html)
;;; End customizable variables.
;; Monthly calendar
;;------------------------------------------------------------
-(autoload 'diary-list-entries "diary-lib")
-
(defun cal-html-list-diary-entries (d1 d2)
"Generate a list of all diary-entries from absolute date D1 to D2."
- (diary-list-entries (calendar-gregorian-from-absolute d1)
- (1+ (- d2 d1)) t))
+ (if (with-demoted-errors "Not adding diary entries: %S"
+ (diary-check-diary-file))
+ (diary-list-entries (calendar-gregorian-from-absolute d1)
+ (1+ (- d2 d1)) t)))
(defun cal-html-insert-agenda-days (month year diary-list holiday-list)
"Insert HTML commands for a range of days in monthly calendars.
;; Diary entries.
cal-html-b-tabledata-string
(cal-html-htmlify-list holiday-list date t)
- (and holiday-list diary-list "<BR>\n")
+ (if (and holiday-list diary-list) "<BR>\n" "")
(cal-html-htmlify-list diary-list date)
cal-html-e-tabledata-string
cal-html-e-tablerow-string)