aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2008-06-26 03:42:12 +0000
committerGlenn Morris2008-06-26 03:42:12 +0000
commit0fa9d7e26ceaebb72dca7bffba49a7f5113a5f2c (patch)
tree8388755318414fbe86cb72ba306a6b387b47799f
parentfb6be44abc47de6f8a62a2d5586cddcf0f15fe06 (diff)
downloademacs-0fa9d7e26ceaebb72dca7bffba49a7f5113a5f2c.tar.gz
emacs-0fa9d7e26ceaebb72dca7bffba49a7f5113a5f2c.zip
(cal-menu-moon-menu, cal-menu-diary-menu, cal-menu-holidays-menu)
(cal-menu-goto-menu, cal-menu-scroll-menu): Add doc strings. (calendar-mouse-print-dates): Remove function. (cal-menu-context-mouse-menu): Use calendar-print-other-dates.
-rw-r--r--lisp/calendar/cal-menu.el28
1 files changed, 12 insertions, 16 deletions
diff --git a/lisp/calendar/cal-menu.el b/lisp/calendar/cal-menu.el
index 9473ee7fd84..8e4dfdf2e4a 100644
--- a/lisp/calendar/cal-menu.el
+++ b/lisp/calendar/cal-menu.el
@@ -34,7 +34,9 @@
34 34
35(defconst cal-menu-moon-menu 35(defconst cal-menu-moon-menu
36 '("Moon" 36 '("Moon"
37 ["Lunar Phases" calendar-phases-of-moon])) 37 ;; FIXME add solar?
38 ["Lunar Phases" calendar-phases-of-moon])
39 "Key map for \"Moon\" menu in the calendar.")
38 40
39(defconst cal-menu-diary-menu 41(defconst cal-menu-diary-menu
40 '("Diary" 42 '("Diary"
@@ -60,7 +62,8 @@
60 ("Insert Hebrew" 62 ("Insert Hebrew"
61 ["One time" diary-hebrew-insert-entry] 63 ["One time" diary-hebrew-insert-entry]
62 ["Monthly" diary-hebrew-insert-monthly-entry] 64 ["Monthly" diary-hebrew-insert-monthly-entry]
63 ["Yearly" diary-hebrew-insert-yearly-entry]))) 65 ["Yearly" diary-hebrew-insert-yearly-entry]))
66 "Key map for \"Diary\" menu in the calendar.")
64 67
65(defun cal-menu-holiday-window-suffix () 68(defun cal-menu-holiday-window-suffix ()
66 "Return a string suffix for the \"Window\" entry in `cal-menu-holidays-menu'." 69 "Return a string suffix for the \"Window\" entry in `cal-menu-holidays-menu'."
@@ -104,7 +107,8 @@
104 (nreverse l)) 107 (nreverse l))
105 "--" 108 "--"
106 ["Unmark Calendar" calendar-unmark] 109 ["Unmark Calendar" calendar-unmark]
107 ["Mark Holidays" calendar-mark-holidays])) 110 ["Mark Holidays" calendar-mark-holidays])
111 "Key map for \"Holidays\" menu in the calendar.")
108 112
109(defconst cal-menu-goto-menu 113(defconst cal-menu-goto-menu
110 '("Go To" 114 '("Go To"
@@ -135,7 +139,8 @@
135 ["Previous Haab" calendar-mayan-previous-haab-date] 139 ["Previous Haab" calendar-mayan-previous-haab-date]
136 ["Next Round" calendar-mayan-next-round-date] 140 ["Next Round" calendar-mayan-next-round-date]
137 ["Previous Round" calendar-mayan-previous-round-date]) 141 ["Previous Round" calendar-mayan-previous-round-date])
138 ["French Date" calendar-french-goto-date])) 142 ["French Date" calendar-french-goto-date])
143 "Key map for \"Go To\" menu in the calendar.")
139 144
140(defconst cal-menu-scroll-menu 145(defconst cal-menu-scroll-menu
141 '("Scroll" 146 '("Scroll"
@@ -144,7 +149,8 @@
144 ["Forward 1 Year" (calendar-scroll-left 12) :keys "4 C-v"] 149 ["Forward 1 Year" (calendar-scroll-left 12) :keys "4 C-v"]
145 ["Backward 1 Month" calendar-scroll-right] 150 ["Backward 1 Month" calendar-scroll-right]
146 ["Backward 3 Months" calendar-scroll-right-three-months] 151 ["Backward 3 Months" calendar-scroll-right-three-months]
147 ["Backward 1 Year" (calendar-scroll-right 12) :keys "4 M-v"])) 152 ["Backward 1 Year" (calendar-scroll-right 12) :keys "4 M-v"])
153 "Key map for \"Scroll\" menu in the calendar.")
148 154
149(defmacro cal-menu-x-popup-menu (event title &rest body) 155(defmacro cal-menu-x-popup-menu (event title &rest body)
150 "Call `x-popup-menu' at position EVENT, with TITLE and contents BODY. 156 "Call `x-popup-menu' at position EVENT, with TITLE and contents BODY.
@@ -203,16 +209,6 @@ is non-nil."
203 (read-file-name "Enter diary file name: " default-directory nil t) 209 (read-file-name "Enter diary file name: " default-directory nil t)
204 event)) 210 event))
205 211
206(defun calendar-mouse-print-dates (&optional event)
207 "Pop up menu of equivalent dates to mouse selected date.
208EVENT is the event that invoked this command."
209 (interactive "e")
210 (let* ((date (calendar-cursor-to-date nil event))
211 (title (format "%s (Gregorian)" (calendar-date-string date)))
212 (selection (cal-menu-x-popup-menu event title
213 (mapcar 'list (calendar-other-dates date)))))
214 (and selection (call-interactively selection))))
215
216(defun cal-menu-set-date-title (menu) 212(defun cal-menu-set-date-title (menu)
217 "Convert date of last event to title suitable for MENU." 213 "Convert date of last event to title suitable for MENU."
218 (easy-menu-filter-return 214 (easy-menu-filter-return
@@ -226,7 +222,7 @@ EVENT is the event that invoked this command."
226 ["Holidays" calendar-mouse-holidays] 222 ["Holidays" calendar-mouse-holidays]
227 ["Mark date" calendar-set-mark] 223 ["Mark date" calendar-set-mark]
228 ["Sunrise/sunset" calendar-sunrise-sunset] 224 ["Sunrise/sunset" calendar-sunrise-sunset]
229 ["Other calendars" calendar-mouse-print-dates] 225 ["Other calendars" calendar-print-other-dates]
230 ;; FIXME there is a bug with last-nonmenu-event and submenus. 226 ;; FIXME there is a bug with last-nonmenu-event and submenus.
231 ;; These currently don't work if called without calendar window selected. 227 ;; These currently don't work if called without calendar window selected.
232 ("Prepare LaTeX buffer" 228 ("Prepare LaTeX buffer"