aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris <[email protected]>2008-06-18 02:55:32 +0000
committerGlenn Morris <[email protected]>2008-06-18 02:55:32 +0000
commitf1eb28f2ab4cb04e140708c7b0c604cecf68309a (patch)
treed1810224fcf2584bf832f1eaf242ed2d05097c3e
parented6c5737840b6fd4ff7b87706e7f3b37b00e9e5d (diff)
(calendar-cursor-holidays): Accept optional date.
-rw-r--r--lisp/calendar/holidays.el10
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/calendar/holidays.el b/lisp/calendar/holidays.el
index fad1475aaa..5ddc587dcc 100644
--- a/lisp/calendar/holidays.el
+++ b/lisp/calendar/holidays.el
@@ -625,12 +625,14 @@ The holidays are those in the list `calendar-holidays'."
'check-calendar-holidays 'calendar-check-holidays "23.1")
;;;###cal-autoload
-(defun calendar-cursor-holidays ()
- "Find holidays for the date specified by the cursor in the calendar window."
+(defun calendar-cursor-holidays (&optional date)
+ "Find holidays for the date specified by the cursor in the calendar window.
+Optional DATE is a list (month day year) to use instead of the
+cursor position."
(interactive)
(message "Checking holidays...")
- (let* ((date (calendar-cursor-to-date t))
- (date-string (calendar-date-string date))
+ (or date (setq date (calendar-cursor-to-date t)))
+ (let* ((date-string (calendar-date-string date))
(holiday-list (calendar-check-holidays date))
(holiday-string (mapconcat 'identity holiday-list "; "))
(msg (format "%s: %s" date-string holiday-string)))