changeset 93328:15b0834c93df

(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'.
author Glenn Morris <rgm@gnu.org>
date Fri, 28 Mar 2008 02:45:39 +0000
parents f6aa1bf031f5
children 6139daabcf5f
files lisp/calendar/cal-menu.el
diffstat 1 files changed, 8 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- 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)