# HG changeset patch # User Glenn Morris # Date 1206672339 0 # Node ID 15b0834c93df7e679f57ad4abc7266b48e841120 # Parent f6aa1bf031f51f5dda9dd11f19373c2b8e90da4c (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'. diff -r f6aa1bf031f5 -r 15b0834c93df lisp/calendar/cal-menu.el --- a/lisp/calendar/cal-menu.el Thu Mar 27 22:18:10 2008 +0000 +++ b/lisp/calendar/cal-menu.el Fri Mar 28 02:45:39 2008 +0000 @@ -102,8 +102,7 @@ (push (vector (format "hol-year-%d" i) `(lambda () (interactive) - (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)))) l)) @@ -162,20 +161,17 @@ (defun cal-menu-list-holidays-year () "Display a list of the holidays of the selected date's year." (interactive) - (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." (interactive) - (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." (interactive) - (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 @@ (calendar-cursor-holidays))) (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))) (selection (cal-menu-x-popup-menu event (list title - (append (list title) (or l '("None"))))))) + (append (list title) + (or (mapcar 'list (calendar-check-holidays date)) + '("None"))))))) (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)