aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman1994-05-12 19:21:38 +0000
committerRichard M. Stallman1994-05-12 19:21:38 +0000
commit89e143860cc9ca10e7ac3b0369eb1a52ec39caed (patch)
tree7edced46396b15ddc0c885032bab1465735c76a6 /lisp
parent1eb0a345cee16ea78c2e20ce70955a529b3e7ef6 (diff)
downloademacs-89e143860cc9ca10e7ac3b0369eb1a52ec39caed.tar.gz
emacs-89e143860cc9ca10e7ac3b0369eb1a52ec39caed.zip
Rewrite mouse-3 menu as a keymap.
Move calendar-mouse-2-date-menu to down-mouse-2.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/calendar/cal-menu.el55
1 files changed, 22 insertions, 33 deletions
diff --git a/lisp/calendar/cal-menu.el b/lisp/calendar/cal-menu.el
index 9fa128d6846..88880772460 100644
--- a/lisp/calendar/cal-menu.el
+++ b/lisp/calendar/cal-menu.el
@@ -36,8 +36,10 @@
36 36
37;;; Code: 37;;; Code:
38 38
39(define-key calendar-mode-map [mouse-2] 'calendar-mouse-2-date-menu) 39(define-key calendar-mode-map [down-mouse-2] 'calendar-mouse-2-date-menu)
40(define-key calendar-mode-map [mouse-3] 'calendar-mouse-3-date-menu) 40
41(defvar calendar-mouse-3-map (make-sparse-keymap "Calendar"))
42(define-key calendar-mode-map [down-mouse-3] calendar-mouse-3-map)
41 43
42(define-key calendar-mode-map [menu-bar moon] 44(define-key calendar-mode-map [menu-bar moon]
43 '("Moon" . calendar-phases-of-moon)) 45 '("Moon" . calendar-phases-of-moon))
@@ -284,37 +286,24 @@ ERROR is t, otherwise just returns nil."
284 '("Other calendars" . calendar-mouse-print-dates)))))) 286 '("Other calendars" . calendar-mouse-print-dates))))))
285 (and selection (call-interactively selection)))) 287 (and selection (call-interactively selection))))
286 288
287(defun calendar-mouse-3-date-menu (event) 289(define-key calendar-mouse-3-map [exit-calendar]
288 "Pop up menu for Mouse-3 in the calendar window." 290 '("Exit calendar" . exit-calendar))
289 (interactive "e") 291(define-key calendar-mouse-3-map [show-diary]
290 (let* ((m1 displayed-month) 292 '("Show diary" . show-all-diary-entries))
291 (y1 displayed-year) 293(define-key calendar-mouse-3-map [lunar-phases]
292 (m2 displayed-month) 294 '("Lunar phases" . calendar-phases-of-moon))
293 (y2 displayed-year) 295(define-key calendar-mouse-3-map [unmark]
294 (junk (increment-calendar-month m1 y1 -1)) 296 '("Unmark" . calendar-unmark))
295 (junk (increment-calendar-month m2 y2 1)) 297(define-key calendar-mouse-3-map [mark-holidays]
296 (selection 298 '("Mark holidays" . mark-calendar-holidays))
297 (x-popup-menu 299(define-key calendar-mouse-3-map [list-holidays]
298 event 300 '("List holidays" . list-calendar-holidays))
299 (list "Menu" 301(define-key calendar-mouse-3-map [mark-diary-entries]
300 (list 302 '("Mark diary entries" . mark-diary-entries))
301 (if (= y1 y2) 303(define-key calendar-mouse-3-map [scroll-backward]
302 (format "%s--%s, %d" 304 '("Scroll backward" . scroll-calendar-right-three-months))
303 (substring (calendar-month-name m1) 0 3) 305(define-key calendar-mouse-3-map [scroll-forward]
304 (substring (calendar-month-name m2) 0 3) y2) 306 '("Scroll forward" . scroll-calendar-left-three-months))
305 (format "%s, %d--%s, %d"
306 (substring (calendar-month-name m1) 0 3) y1
307 (substring (calendar-month-name m2) 0 3) y2))
308 '("Scroll forward" . scroll-calendar-left-three-months)
309 '("Scroll backward" . scroll-calendar-right-three-months)
310 '("Show diary" . show-all-diary-entries)
311 '("Mark diary entries" . mark-diary-entries)
312 '("List holidays" . list-calendar-holidays)
313 '("Mark holidays" . mark-calendar-holidays)
314 '("Unmark" . calendar-unmark)
315 '("Lunar phases" . calendar-phases-of-moon)
316 '("Exit calendar" . exit-calendar))))))
317 (and selection (call-interactively selection))))
318 307
319(run-hooks 'cal-menu-load-hook) 308(run-hooks 'cal-menu-load-hook)
320 309