Commit fdbe82c9 authored by Glenn Morris's avatar Glenn Morris
Browse files

(cal-menu-holidays-menu, cal-menu-list-holidays-year)

(cal-menu-list-holidays-following-year, cal-menu-list-holidays-previous-year):
Simplify now that 2nd arg of holiday-list is optional.
(calendar-mouse-holidays): Remove un-needed local `l'.
parent 42550348
......@@ -102,8 +102,7 @@
(push (vector (format "hol-year-%d" i)
`(lambda ()
(holiday-list (+ displayed-year ,(- i 5))
(+ displayed-year ,(- i 5))))
(holiday-list (+ displayed-year ,(- i 5))))
:label `(format "For Year %d"
(+ displayed-year ,(- i 5))))
......@@ -162,20 +161,17 @@ POSITION and MENU are passed to `x-popup-menu'."
(defun cal-menu-list-holidays-year ()
"Display a list of the holidays of the selected date's year."
(let ((year (extract-calendar-year (calendar-cursor-to-date))))
(holiday-list year year)))
(holiday-list (extract-calendar-year (calendar-cursor-to-date))))
(defun cal-menu-list-holidays-following-year ()
"Display a list of the holidays of the following year."
(let ((year (1+ (extract-calendar-year (calendar-cursor-to-date)))))
(holiday-list year year)))
(holiday-list (1+ (extract-calendar-year (calendar-cursor-to-date)))))
(defun cal-menu-list-holidays-previous-year ()
"Display a list of the holidays of the previous year."
(let ((year (1- (extract-calendar-year (calendar-cursor-to-date)))))
(holiday-list year year)))
(holiday-list (1- (extract-calendar-year (calendar-cursor-to-date)))))
(defun calendar-event-to-date (&optional error)
"Date of last event.
......@@ -206,22 +202,23 @@ ERROR is non-nil, otherwise just returns nil."
(autoload 'calendar-check-holidays "holidays")
(autoload 'diary-list-entries "diary-lib")
(defun calendar-mouse-holidays (&optional event)
"Pop up menu of holidays for mouse selected date.
EVENT is the event that invoked this command."
(interactive "e")
(let* ((date (calendar-event-to-date))
(l (mapcar 'list (calendar-check-holidays date)))
(title (format "Holidays for %s" (calendar-date-string date)))
(list title
(append (list title) (or l '("None")))))))
(append (list title)
(or (mapcar 'list (calendar-check-holidays date))
(and selection (call-interactively selection))))
(autoload 'diary-list-entries "diary-lib")
(defvar holidays-in-diary-buffer) ; only called from calendar.el
(defun calendar-mouse-view-diary-entries (&optional date diary event)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment