summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1997-05-05 17:54:28 +0000
committerRichard M. Stallman <rms@gnu.org>1997-05-05 17:54:28 +0000
commit5437d732b4bdf92e128ce532800d76abce547ef1 (patch)
tree8a95f91cb6dd7fcd0693e70e29ff1c69666a1fff
parent0980e17cb9a3dfe76a7b4fbd6961b8f31d4bfaf9 (diff)
downloademacs-5437d732b4bdf92e128ce532800d76abce547ef1.tar.gz
(cal-menu-list-holidays-following-year)
(cal-menu-list-holidays-previous-year) (cal-menu-list-holidays-year): New commands. (calendar-mode-map): Put them in the holidays menu.
-rw-r--r--lisp/calendar/cal-menu.el24
1 files changed, 24 insertions, 0 deletions
diff --git a/lisp/calendar/cal-menu.el b/lisp/calendar/cal-menu.el
index c5db298e075..037c00adbbe 100644
--- a/lisp/calendar/cal-menu.el
+++ b/lisp/calendar/cal-menu.el
@@ -90,6 +90,12 @@
'("Unmark" . calendar-unmark))
(define-key calendar-mode-map [menu-bar holidays mark]
'("Mark" . mark-calendar-holidays))
+(define-key calendar-mode-map [menu-bar holidays previous-year]
+ '("Previous year" . cal-menu-list-holidays-previous-year))
+(define-key calendar-mode-map [menu-bar holidays following-year]
+ '("Following year" . cal-menu-list-holidays-following-year))
+(define-key calendar-mode-map [menu-bar holidays year]
+ '("Year" . cal-menu-list-holidays-year))
(define-key calendar-mode-map [menu-bar holidays 3-mon]
'("3 Months" . list-calendar-holidays))
(define-key calendar-mode-map [menu-bar holidays 1-day]
@@ -167,6 +173,24 @@
(define-key calendar-mode-map [menu-bar scroll fwd-1]
'("Forward 1 Month" . scroll-calendar-left))
+(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))))
+ (list-holidays year year)))
+
+(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)))))
+ (list-holidays year year)))
+
+(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)))))
+ (list-holidays year year)))
+
(defun calendar-event-to-date (&optional error)
"Date of last event.
If event is not on a specific date, signals an error if optional parameter