diff options
| author | Glenn Morris | 2008-03-28 02:45:39 +0000 |
|---|---|---|
| committer | Glenn Morris | 2008-03-28 02:45:39 +0000 |
| commit | fdbe82c9aff1f60d75598b7698bfa2c9a37861d4 (patch) | |
| tree | 18ea3a11e33d7833c45ff616fabffb577bbc77bb | |
| parent | 4255034848ac788a718930a023c928ac7a522c5a (diff) | |
| download | emacs-fdbe82c9aff1f60d75598b7698bfa2c9a37861d4.tar.gz emacs-fdbe82c9aff1f60d75598b7698bfa2c9a37861d4.zip | |
(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'.
| -rw-r--r-- | lisp/calendar/cal-menu.el | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/lisp/calendar/cal-menu.el b/lisp/calendar/cal-menu.el index c7c953ab403..2e2fcd76607 100644 --- a/lisp/calendar/cal-menu.el +++ b/lisp/calendar/cal-menu.el | |||
| @@ -102,8 +102,7 @@ | |||
| 102 | (push (vector (format "hol-year-%d" i) | 102 | (push (vector (format "hol-year-%d" i) |
| 103 | `(lambda () | 103 | `(lambda () |
| 104 | (interactive) | 104 | (interactive) |
| 105 | (holiday-list (+ displayed-year ,(- i 5)) | 105 | (holiday-list (+ displayed-year ,(- i 5)))) |
| 106 | (+ displayed-year ,(- i 5)))) | ||
| 107 | :label `(format "For Year %d" | 106 | :label `(format "For Year %d" |
| 108 | (+ displayed-year ,(- i 5)))) | 107 | (+ displayed-year ,(- i 5)))) |
| 109 | l)) | 108 | l)) |
| @@ -162,20 +161,17 @@ POSITION and MENU are passed to `x-popup-menu'." | |||
| 162 | (defun cal-menu-list-holidays-year () | 161 | (defun cal-menu-list-holidays-year () |
| 163 | "Display a list of the holidays of the selected date's year." | 162 | "Display a list of the holidays of the selected date's year." |
| 164 | (interactive) | 163 | (interactive) |
| 165 | (let ((year (extract-calendar-year (calendar-cursor-to-date)))) | 164 | (holiday-list (extract-calendar-year (calendar-cursor-to-date)))) |
| 166 | (holiday-list year year))) | ||
| 167 | 165 | ||
| 168 | (defun cal-menu-list-holidays-following-year () | 166 | (defun cal-menu-list-holidays-following-year () |
| 169 | "Display a list of the holidays of the following year." | 167 | "Display a list of the holidays of the following year." |
| 170 | (interactive) | 168 | (interactive) |
| 171 | (let ((year (1+ (extract-calendar-year (calendar-cursor-to-date))))) | 169 | (holiday-list (1+ (extract-calendar-year (calendar-cursor-to-date))))) |
| 172 | (holiday-list year year))) | ||
| 173 | 170 | ||
| 174 | (defun cal-menu-list-holidays-previous-year () | 171 | (defun cal-menu-list-holidays-previous-year () |
| 175 | "Display a list of the holidays of the previous year." | 172 | "Display a list of the holidays of the previous year." |
| 176 | (interactive) | 173 | (interactive) |
| 177 | (let ((year (1- (extract-calendar-year (calendar-cursor-to-date))))) | 174 | (holiday-list (1- (extract-calendar-year (calendar-cursor-to-date))))) |
| 178 | (holiday-list year year))) | ||
| 179 | 175 | ||
| 180 | (defun calendar-event-to-date (&optional error) | 176 | (defun calendar-event-to-date (&optional error) |
| 181 | "Date of last event. | 177 | "Date of last event. |
| @@ -206,22 +202,23 @@ ERROR is non-nil, otherwise just returns nil." | |||
| 206 | (calendar-cursor-holidays))) | 202 | (calendar-cursor-holidays))) |
| 207 | 203 | ||
| 208 | (autoload 'calendar-check-holidays "holidays") | 204 | (autoload 'calendar-check-holidays "holidays") |
| 209 | (autoload 'diary-list-entries "diary-lib") | ||
| 210 | 205 | ||
| 211 | (defun calendar-mouse-holidays (&optional event) | 206 | (defun calendar-mouse-holidays (&optional event) |
| 212 | "Pop up menu of holidays for mouse selected date. | 207 | "Pop up menu of holidays for mouse selected date. |
| 213 | EVENT is the event that invoked this command." | 208 | EVENT is the event that invoked this command." |
| 214 | (interactive "e") | 209 | (interactive "e") |
| 215 | (let* ((date (calendar-event-to-date)) | 210 | (let* ((date (calendar-event-to-date)) |
| 216 | (l (mapcar 'list (calendar-check-holidays date))) | ||
| 217 | (title (format "Holidays for %s" (calendar-date-string date))) | 211 | (title (format "Holidays for %s" (calendar-date-string date))) |
| 218 | (selection | 212 | (selection |
| 219 | (cal-menu-x-popup-menu | 213 | (cal-menu-x-popup-menu |
| 220 | event | 214 | event |
| 221 | (list title | 215 | (list title |
| 222 | (append (list title) (or l '("None"))))))) | 216 | (append (list title) |
| 217 | (or (mapcar 'list (calendar-check-holidays date)) | ||
| 218 | '("None"))))))) | ||
| 223 | (and selection (call-interactively selection)))) | 219 | (and selection (call-interactively selection)))) |
| 224 | 220 | ||
| 221 | (autoload 'diary-list-entries "diary-lib") | ||
| 225 | (defvar holidays-in-diary-buffer) ; only called from calendar.el | 222 | (defvar holidays-in-diary-buffer) ; only called from calendar.el |
| 226 | 223 | ||
| 227 | (defun calendar-mouse-view-diary-entries (&optional date diary event) | 224 | (defun calendar-mouse-view-diary-entries (&optional date diary event) |