1 ;;; cal-menu.el --- calendar functions for menu bar and popup menu support
3 ;; Copyright (C) 1994, 1995, 2001, 2003, 2004 Free Software Foundation, Inc.
5 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
6 ;; Lara Rios <lrios@coewl.cen.uiuc.edu>
7 ;; Maintainer: Glenn Morris <gmorris@ast.cam.ac.uk>
9 ;; Human-Keywords: calendar, popup menus, menu bar
11 ;; This file is part of GNU Emacs.
13 ;; GNU Emacs is free software; you can redistribute it and/or modify
14 ;; it under the terms of the GNU General Public License as published by
15 ;; the Free Software Foundation; either version 2, or (at your option)
18 ;; GNU Emacs is distributed in the hope that it will be useful,
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;; GNU General Public License for more details.
23 ;; You should have received a copy of the GNU General Public License
24 ;; along with GNU Emacs; see the file COPYING. If not, write to the
25 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
26 ;; Boston, MA 02111-1307, USA.
30 ;; This collection of functions implements menu bar and popup menu support for
33 ;; Comments, corrections, and improvements should be sent to
34 ;; Edward M. Reingold Department of Computer Science
35 ;; (217) 333-6733 University of Illinois at Urbana-Champaign
36 ;; reingold@cs.uiuc.edu 1304 West Springfield Avenue
37 ;; Urbana, Illinois 61801
41 (defvar displayed-month
)
42 (defvar displayed-year
)
44 (eval-when-compile (require 'calendar
))
47 (define-key calendar-mode-map
[menu-bar edit
] 'undefined
)
48 (define-key calendar-mode-map
[menu-bar search
] 'undefined
)
50 (define-key calendar-mode-map
[down-mouse-2
] 'calendar-mouse-2-date-menu
)
51 (define-key calendar-mode-map
[mouse-2
] 'ignore
)
53 (defvar calendar-mouse-3-map
(make-sparse-keymap "Calendar"))
54 (define-key calendar-mode-map
[down-mouse-3
] calendar-mouse-3-map
)
55 (define-key calendar-mode-map
[C-down-mouse-3
] calendar-mouse-3-map
)
57 (define-key calendar-mode-map
[menu-bar moon
]
58 (cons "Moon" (make-sparse-keymap "Moon")))
60 (define-key calendar-mode-map
[menu-bar moon moon
]
61 '("Lunar Phases" . calendar-phases-of-moon
))
63 (define-key calendar-mode-map
[menu-bar diary
]
64 (cons "Diary" (make-sparse-keymap "Diary")))
66 (define-key calendar-mode-map
[menu-bar diary heb
]
67 '("Insert Hebrew" . calendar-mouse-insert-hebrew-diary-entry
))
68 (define-key calendar-mode-map
[menu-bar diary isl
]
69 '("Insert Islamic" . calendar-mouse-insert-islamic-diary-entry
))
70 (define-key calendar-mode-map
[menu-bar diary baha
]
71 '("Insert Baha'i" . calendar-mouse-insert-bahai-diary-entry
))
72 (define-key calendar-mode-map
[menu-bar diary cyc
]
73 '("Insert Cyclic" . insert-cyclic-diary-entry
))
74 (define-key calendar-mode-map
[menu-bar diary blk
]
75 '("Insert Block" . insert-block-diary-entry
))
76 (define-key calendar-mode-map
[menu-bar diary ann
]
77 '("Insert Anniversary" . insert-anniversary-diary-entry
))
78 (define-key calendar-mode-map
[menu-bar diary yr
]
79 '("Insert Yearly" . insert-yearly-diary-entry
))
80 (define-key calendar-mode-map
[menu-bar diary mon
]
81 '("Insert Monthly" . insert-monthly-diary-entry
))
82 (define-key calendar-mode-map
[menu-bar diary wk
]
83 '("Insert Weekly" . insert-weekly-diary-entry
))
84 (define-key calendar-mode-map
[menu-bar diary ent
]
85 '("Insert Diary Entry" . insert-diary-entry
))
86 (define-key calendar-mode-map
[menu-bar diary all
]
87 '("Show All" . show-all-diary-entries
))
88 (define-key calendar-mode-map
[menu-bar diary mark
]
89 '("Mark All" . mark-diary-entries
))
90 (define-key calendar-mode-map
[menu-bar diary view
]
91 '("Cursor Date" . view-diary-entries
))
92 (define-key calendar-mode-map
[menu-bar diary view
]
93 '("Other File" . view-other-diary-entries
))
95 (define-key calendar-mode-map
[menu-bar Holidays
]
96 (cons "Holidays" (make-sparse-keymap "Holidays")))
98 (define-key calendar-mode-map
[menu-bar goto
]
99 (cons "Goto" (make-sparse-keymap "Goto")))
101 (define-key calendar-mode-map
[menu-bar goto french
]
102 '("French Date" . calendar-goto-french-date
))
103 (define-key calendar-mode-map
[menu-bar goto mayan
]
104 (cons "Mayan Date" (make-sparse-keymap "Mayan")))
105 (define-key calendar-mode-map
[menu-bar goto ethiopic
]
106 '("Ethiopic Date" . calendar-goto-ethiopic-date
))
107 (define-key calendar-mode-map
[menu-bar goto coptic
]
108 '("Coptic Date" . calendar-goto-coptic-date
))
109 (define-key calendar-mode-map
[menu-bar goto chinese
]
110 '("Chinese Date" . calendar-goto-chinese-date
))
111 (define-key calendar-mode-map
[menu-bar goto julian
]
112 '("Julian Date" . calendar-goto-julian-date
))
113 (define-key calendar-mode-map
[menu-bar goto islamic
]
114 '("Islamic Date" . calendar-goto-islamic-date
))
115 (define-key calendar-mode-map
[menu-bar goto persian
]
116 '("Baha'i Date" . calendar-goto-bahai-date
))
117 (define-key calendar-mode-map
[menu-bar goto persian
]
118 '("Persian Date" . calendar-goto-persian-date
))
119 (define-key calendar-mode-map
[menu-bar goto hebrew
]
120 '("Hebrew Date" . calendar-goto-hebrew-date
))
121 (define-key calendar-mode-map
[menu-bar goto astro
]
122 '("Astronomical Date" . calendar-goto-astro-day-number
))
123 (define-key calendar-mode-map
[menu-bar goto iso
]
124 '("ISO Date" . calendar-goto-iso-date
))
125 (define-key calendar-mode-map
[menu-bar goto iso-week
]
126 '("ISO Week" . calendar-goto-iso-week
))
127 (define-key calendar-mode-map
[menu-bar goto day-of-year
]
128 '("Day of Year" . calendar-goto-day-of-year
))
129 (define-key calendar-mode-map
[menu-bar goto gregorian
]
130 '("Other Date" . calendar-goto-date
))
131 (define-key calendar-mode-map
[menu-bar goto end-of-year
]
132 '("End of Year" . calendar-end-of-year
))
133 (define-key calendar-mode-map
[menu-bar goto beginning-of-year
]
134 '("Beginning of Year" . calendar-beginning-of-year
))
135 (define-key calendar-mode-map
[menu-bar goto end-of-month
]
136 '("End of Month" . calendar-end-of-month
))
137 (define-key calendar-mode-map
[menu-bar goto beginning-of-month
]
138 '("Beginning of Month" . calendar-beginning-of-month
))
139 (define-key calendar-mode-map
[menu-bar goto end-of-week
]
140 '("End of Week" . calendar-end-of-week
))
141 (define-key calendar-mode-map
[menu-bar goto beginning-of-week
]
142 '("Beginning of Week" . calendar-beginning-of-week
))
143 (define-key calendar-mode-map
[menu-bar goto today
]
144 '("Today" . calendar-goto-today
))
147 (define-key calendar-mode-map
[menu-bar goto mayan prev-rnd
]
148 '("Previous Round" . calendar-previous-calendar-round-date
))
149 (define-key calendar-mode-map
[menu-bar goto mayan nxt-rnd
]
150 '("Next Round" . calendar-next-calendar-round-date
))
151 (define-key calendar-mode-map
[menu-bar goto mayan prev-haab
]
152 '("Previous Haab" . calendar-previous-haab-date
))
153 (define-key calendar-mode-map
[menu-bar goto mayan next-haab
]
154 '("Next Haab" . calendar-next-haab-date
))
155 (define-key calendar-mode-map
[menu-bar goto mayan prev-tzol
]
156 '("Previous Tzolkin" . calendar-previous-tzolkin-date
))
157 (define-key calendar-mode-map
[menu-bar goto mayan next-tzol
]
158 '("Next Tzolkin" . calendar-next-tzolkin-date
))
160 (define-key calendar-mode-map
[menu-bar scroll
]
161 (cons "Scroll" (make-sparse-keymap "Scroll")))
163 (define-key calendar-mode-map
[menu-bar scroll bk-12
]
164 '("Backward 1 Year" .
"4\ev"))
165 (define-key calendar-mode-map
[menu-bar scroll bk-3
]
166 '("Backward 3 Months" . scroll-calendar-right-three-months
))
167 (define-key calendar-mode-map
[menu-bar scroll bk-1
]
168 '("Backward 1 Month" . scroll-calendar-right
))
169 (define-key calendar-mode-map
[menu-bar scroll fwd-12
]
170 '("Forward 1 Year" .
"4\C-v"))
171 (define-key calendar-mode-map
[menu-bar scroll fwd-3
]
172 '("Forward 3 Months" . scroll-calendar-left-three-months
))
173 (define-key calendar-mode-map
[menu-bar scroll fwd-1
]
174 '("Forward 1 Month" . scroll-calendar-left
))
176 (defun calendar-flatten (list)
177 "Flatten LIST eliminating sublists structure; result is a list of atoms.
178 This is the same as the preorder list of leaves in a rooted forest."
182 (append (calendar-flatten (car list
)) (calendar-flatten (cdr list
)))
183 (calendar-flatten (car list
)))))
185 (defun cal-menu-x-popup-menu (position menu
)
186 "Like `x-popup-menu', but prints an error message if popup menus are
188 (if (display-popup-menus-p)
189 (x-popup-menu position menu
)
190 (error "Popup menus are not available on this system")))
192 (defun cal-menu-list-holidays-year ()
193 "Display a list of the holidays of the selected date's year."
195 (let ((year (extract-calendar-year (calendar-cursor-to-date))))
196 (list-holidays year year
)))
198 (defun cal-menu-list-holidays-following-year ()
199 "Display a list of the holidays of the following year."
201 (let ((year (1+ (extract-calendar-year (calendar-cursor-to-date)))))
202 (list-holidays year year
)))
204 (defun cal-menu-list-holidays-previous-year ()
205 "Display a list of the holidays of the previous year."
207 (let ((year (1- (extract-calendar-year (calendar-cursor-to-date)))))
208 (list-holidays year year
)))
210 (defun cal-menu-update ()
211 ;; Update the holiday part of calendar menu bar for the current display.
213 (if (eq major-mode
'calendar-mode
)
215 (calendar-for-loop;; Show 11 years--5 before, 5 after year of
217 i from
(- displayed-year
5) to
(+ displayed-year
5) do
218 (setq l
(cons (vector (format "For Year %s" i
)
219 (list (list 'lambda
'nil
'(interactive)
220 (list 'list-holidays i i
)))
223 (setq l
(cons ["Mark Holidays" mark-calendar-holidays t
]
224 (cons ["Unmark Calendar" calendar-unmark t
]
225 (cons ["--" '("--") t
] l
))))
226 (define-key calendar-mode-map
[menu-bar Holidays
]
227 (cons "Holidays" (easy-menu-create-menu "Holidays" (nreverse l
))))
228 (define-key calendar-mode-map
[menu-bar Holidays separator
]
230 (define-key calendar-mode-map
[menu-bar Holidays today
]
231 `(,(format "For Today (%s)"
232 (calendar-date-string (calendar-current-date) t t
))
233 . cal-menu-today-holidays
))
235 (let ((m1 displayed-month
)
239 (increment-calendar-month m1 y1 -
1)
240 (increment-calendar-month m2 y2
1)
243 (calendar-month-name m1
'abbrev
)
244 (calendar-month-name m2
'abbrev
)
246 (format "%s, %d-%s, %d"
247 (calendar-month-name m1
'abbrev
)
249 (calendar-month-name m2
'abbrev
)
251 (define-key calendar-mode-map
[menu-bar Holidays
3-month
]
252 `(,(format "For Window (%s)" title
)
253 . list-calendar-holidays
)))
254 (let ((date (calendar-cursor-to-date)))
256 (define-key calendar-mode-map
[menu-bar Holidays
1-day
]
257 `(,(format "For Cursor Date (%s)"
258 (calendar-date-string date t t
))
259 . calendar-cursor-holidays
))))))
260 ;; Try to avoid entering infinite beep mode in case of errors.
263 (defun calendar-event-to-date (&optional error
)
265 If event is not on a specific date, signals an error if optional parameter
266 ERROR is t, otherwise just returns nil."
268 (set-buffer (window-buffer (posn-window (event-start last-input-event
))))
269 (goto-char (posn-point (event-start last-input-event
)))
270 (calendar-cursor-to-date error
)))
272 (defun calendar-mouse-insert-hebrew-diary-entry (event)
273 "Pop up menu to insert a Hebrew-date diary entry."
275 (let ((hebrew-selection
276 (cal-menu-x-popup-menu
278 (list "Hebrew insert menu"
279 (list (calendar-hebrew-date-string (calendar-cursor-to-date))
280 '("One time" . insert-hebrew-diary-entry
)
281 '("Monthly" . insert-monthly-hebrew-diary-entry
)
282 '("Yearly" . insert-yearly-hebrew-diary-entry
))))))
283 (and hebrew-selection
(call-interactively hebrew-selection
))))
285 (defun calendar-mouse-insert-islamic-diary-entry (event)
286 "Pop up menu to insert an Islamic-date diary entry."
288 (let ((islamic-selection
289 (cal-menu-x-popup-menu
291 (list "Islamic insert menu"
292 (list (calendar-islamic-date-string (calendar-cursor-to-date))
293 '("One time" . insert-islamic-diary-entry
)
294 '("Monthly" . insert-monthly-islamic-diary-entry
)
295 '("Yearly" . insert-yearly-islamic-diary-entry
))))))
296 (and islamic-selection
(call-interactively islamic-selection
))))
298 (defun calendar-mouse-insert-bahai-diary-entry (event)
299 "Pop up menu to insert an Baha'i-date diary entry."
301 (let ((bahai-selection
304 (list "Baha'i insert menu"
305 (list (calendar-bahai-date-string (calendar-cursor-to-date))
306 '("One time" . insert-bahai-diary-entry
)
307 '("Monthly" . insert-monthly-bahai-diary-entry
)
308 '("Yearly" . insert-yearly-bahai-diary-entry
))))))
309 (and bahai-selection
(call-interactively bahai-selection
))))
311 (defun calendar-mouse-sunrise/sunset
()
312 "Show sunrise/sunset times for mouse-selected date."
315 (calendar-mouse-goto-date (calendar-event-to-date))
316 (calendar-sunrise-sunset)))
318 (defun cal-menu-today-holidays ()
319 "Show holidays for today's date."
322 (calendar-cursor-to-date (calendar-current-date))
323 (calendar-cursor-holidays)))
325 (defun calendar-mouse-holidays ()
326 "Pop up menu of holidays for mouse selected date."
328 (let* ((date (calendar-event-to-date))
329 (l (mapcar '(lambda (x) (list x
))
330 (check-calendar-holidays date
)))
332 (cal-menu-x-popup-menu
335 (format "Holidays for %s" (calendar-date-string date
))
337 (list (format "Holidays for %s" (calendar-date-string date
)))
338 (if l l
'("None")))))))
339 (and selection
(call-interactively selection
))))
341 (defun calendar-mouse-view-diary-entries (&optional date diary
)
342 "Pop up menu of diary entries for mouse-selected date.
343 Use optional DATE and alternative file DIARY.
345 Any holidays are shown if `holidays-in-diary-buffer' is t."
347 (let* ((date (if date date
(calendar-event-to-date)))
348 (diary-file (if diary diary diary-file
))
349 (diary-list-include-blanks nil
)
350 (diary-display-hook 'ignore
)
352 (mapcar '(lambda (x) (split-string (car (cdr x
)) "\^M\\|\n"))
353 (list-diary-entries date
1)))
354 (holidays (if holidays-in-diary-buffer
355 (mapcar '(lambda (x) (list x
))
356 (check-calendar-holidays date
))))
357 (title (concat "Diary entries "
358 (if diary
(format "from %s " diary
) "")
360 (calendar-date-string date
)))
362 (cal-menu-x-popup-menu
368 (mapcar '(lambda (x) (list (concat " " (car x
))))
371 (list "--shadow-etched-in" "--shadow-etched-in"))
373 (mapcar 'list
(calendar-flatten diary-entries
))
375 (and selection
(call-interactively selection
))))
377 (defun calendar-mouse-view-other-diary-entries ()
378 "Pop up menu of diary entries from alternative file on mouse-selected date."
380 (calendar-mouse-view-diary-entries
381 (calendar-event-to-date)
382 (read-file-name "Enter diary file name: " default-directory nil t
)))
384 (defun calendar-mouse-insert-diary-entry ()
385 "Insert diary entry for mouse-selected date."
388 (calendar-mouse-goto-date (calendar-event-to-date))
389 (insert-diary-entry nil
)))
391 (defun calendar-mouse-set-mark ()
392 "Mark the date under the cursor."
395 (calendar-mouse-goto-date (calendar-event-to-date))
396 (calendar-set-mark nil
)))
398 (defun cal-tex-mouse-day ()
399 "Make a buffer with LaTeX commands for the day mouse is on."
402 (calendar-mouse-goto-date (calendar-event-to-date))
403 (cal-tex-cursor-day nil
)))
405 (defun cal-tex-mouse-week ()
406 "One page calendar for week indicated by cursor.
407 Holidays are included if `cal-tex-holidays' is t."
410 (calendar-mouse-goto-date (calendar-event-to-date))
411 (cal-tex-cursor-week nil
)))
413 (defun cal-tex-mouse-week2 ()
414 "Make a buffer with LaTeX commands for the week cursor is on.
415 The printed output will be on two pages."
418 (calendar-mouse-goto-date (calendar-event-to-date))
419 (cal-tex-cursor-week2 nil
)))
421 (defun cal-tex-mouse-week-iso ()
422 "One page calendar for week indicated by cursor.
423 Holidays are included if `cal-tex-holidays' is t."
426 (calendar-mouse-goto-date (calendar-event-to-date))
427 (cal-tex-cursor-week-iso nil
)))
429 (defun cal-tex-mouse-week-monday ()
430 "One page calendar for week indicated by cursor."
433 (calendar-mouse-goto-date (calendar-event-to-date))
434 (cal-tex-cursor-week-monday nil
)))
436 (defun cal-tex-mouse-filofax-daily ()
437 "Day-per-page Filofax calendar for week indicated by cursor."
440 (calendar-mouse-goto-date (calendar-event-to-date))
441 (cal-tex-cursor-filofax-daily nil
)))
443 (defun cal-tex-mouse-filofax-2week ()
444 "One page Filofax calendar for week indicated by cursor."
447 (calendar-mouse-goto-date (calendar-event-to-date))
448 (cal-tex-cursor-filofax-2week nil
)))
450 (defun cal-tex-mouse-filofax-week ()
451 "Two page Filofax calendar for week indicated by cursor."
454 (calendar-mouse-goto-date (calendar-event-to-date))
455 (cal-tex-cursor-filofax-week nil
)))
457 (defun cal-tex-mouse-month ()
458 "Make a buffer with LaTeX commands for the month cursor is on.
459 Calendar is condensed onto one page."
462 (calendar-mouse-goto-date (calendar-event-to-date))
463 (cal-tex-cursor-month nil
)))
465 (defun cal-tex-mouse-month-landscape ()
466 "Make a buffer with LaTeX commands for the month cursor is on.
467 The output is in landscape format, one month to a page."
470 (calendar-mouse-goto-date (calendar-event-to-date))
471 (cal-tex-cursor-month-landscape nil
)))
473 (defun cal-tex-mouse-year ()
474 "Make a buffer with LaTeX commands for the year cursor is on."
477 (calendar-mouse-goto-date (calendar-event-to-date))
478 (cal-tex-cursor-year nil
)))
480 (defun cal-tex-mouse-filofax-year ()
481 "Make a buffer with LaTeX commands for Filofax calendar of year cursor is on."
484 (calendar-mouse-goto-date (calendar-event-to-date))
485 (cal-tex-cursor-filofax-year nil
)))
487 (defun cal-tex-mouse-year-landscape ()
488 "Make a buffer with LaTeX commands for the year cursor is on."
491 (calendar-mouse-goto-date (calendar-event-to-date))
492 (cal-tex-cursor-year-landscape nil
)))
494 (defun calendar-mouse-print-dates ()
495 "Pop up menu of equivalent dates to mouse selected date."
497 (let ((date (calendar-event-to-date))
499 (cal-menu-x-popup-menu
502 (concat (calendar-date-string date
) " (Gregorian)")
505 (concat (calendar-date-string date
) " (Gregorian)")
506 (list (calendar-day-of-year-string date
))
507 (list (format "ISO date: %s" (calendar-iso-date-string date
)))
508 (list (format "Julian date: %s"
509 (calendar-julian-date-string date
)))
511 (format "Astronomical (Julian) day number (at noon UTC): %s.0"
512 (calendar-astro-date-string date
)))
514 (format "Fixed (RD) date: %s"
515 (calendar-absolute-from-gregorian date
)))
516 (list (format "Hebrew date (before sunset): %s"
517 (calendar-hebrew-date-string date
)))
518 (list (format "Persian date: %s"
519 (calendar-persian-date-string date
)))
520 (list (format "Baha'i date (before sunset): %s"
521 (calendar-bahai-date-string date
))))
522 (let ((i (calendar-islamic-date-string date
)))
523 (if (not (string-equal i
""))
524 (list (list (format "Islamic date (before sunset): %s" i
)))))
526 (list (format "Chinese date: %s"
527 (calendar-chinese-date-string date
))))
528 ; (list '("Chinese date (select to echo Chinese date)"
529 ; . calendar-mouse-chinese-date))
530 (let ((c (calendar-coptic-date-string date
)))
531 (if (not (string-equal c
""))
532 (list (list (format "Coptic date: %s" c
)))))
533 (let ((e (calendar-ethiopic-date-string date
)))
534 (if (not (string-equal e
""))
535 (list (list (format "Ethiopic date: %s" e
)))))
536 (let ((f (calendar-french-date-string date
)))
537 (if (not (string-equal f
""))
538 (list (list (format "French Revolutionary date: %s" f
)))))
541 (format "Mayan date: %s"
542 (calendar-mayan-date-string date
)))))))))
543 (and selection
(call-interactively selection
))))
545 (defun calendar-mouse-chinese-date ()
546 "Show Chinese equivalent for mouse-selected date."
549 (calendar-mouse-goto-date (calendar-event-to-date))
550 (calendar-print-chinese-date)))
552 (defun calendar-mouse-goto-date (date)
553 (set-buffer (window-buffer (posn-window (event-start last-input-event
))))
554 (calendar-goto-date date
))
556 (defun calendar-mouse-2-date-menu (event)
557 "Pop up menu for Mouse-2 for selected date in the calendar window."
559 (let* ((date (calendar-event-to-date t
))
561 (cal-menu-x-popup-menu
563 (list (calendar-date-string date t nil
)
566 '("Holidays" . calendar-mouse-holidays
)
567 '("Mark date" . calendar-mouse-set-mark
)
568 '("Sunrise/sunset" . calendar-mouse-sunrise
/sunset
)
569 '("Other calendars" . calendar-mouse-print-dates
)
570 '("Prepare LaTeX buffer" . calendar-mouse-cal-tex-menu
)
571 '("Diary entries" . calendar-mouse-view-diary-entries
)
572 '("Insert diary entry" . calendar-mouse-insert-diary-entry
)
573 '("Other diary file entries"
574 . calendar-mouse-view-other-diary-entries
)
576 (and selection
(call-interactively selection
))))
578 (defun calendar-mouse-cal-tex-menu (event)
579 "Pop up submenu for Mouse-2 for cal-tex commands for selected date in the calendar window."
582 (cal-menu-x-popup-menu
584 (list (calendar-date-string date t nil
)
587 '("Daily (1 page)" . cal-tex-mouse-day
)
588 '("Weekly (1 page)" . cal-tex-mouse-week
)
589 '("Weekly (2 pages)" . cal-tex-mouse-week2
)
590 '("Weekly (other style; 1 page)" . cal-tex-mouse-week-iso
)
591 '("Weekly (yet another style; 1 page)" .
592 cal-tex-mouse-week-monday
)
593 '("Monthly" . cal-tex-mouse-month
)
594 '("Monthly (landscape)" . cal-tex-mouse-month-landscape
)
595 '("Yearly" . cal-tex-mouse-year
)
596 '("Yearly (landscape)" . cal-tex-mouse-year-landscape
)
597 '("Filofax styles" . cal-tex-mouse-filofax
)
599 (and selection
(call-interactively selection
))))
601 (defun cal-tex-mouse-filofax (event)
602 "Pop up sub-submenu for Mouse-2 for Filofax cal-tex commands for selected date."
605 (cal-menu-x-popup-menu
607 (list (calendar-date-string date t nil
)
610 '("Filofax Daily (one-day-per-page)" .
611 cal-tex-mouse-filofax-daily
)
612 '("Filofax Weekly (2-weeks-at-a-glance)" .
613 cal-tex-mouse-filofax-2week
)
614 '("Filofax Weekly (week-at-a-glance)" .
615 cal-tex-mouse-filofax-week
)
616 '("Filofax Yearly" . cal-tex-mouse-filofax-year
)
618 (and selection
(call-interactively selection
))))
620 (define-key calendar-mouse-3-map
[exit-calendar
]
621 '("Exit calendar" . exit-calendar
))
622 (define-key calendar-mouse-3-map
[show-diary
]
623 '("Show diary" . show-all-diary-entries
))
624 (define-key calendar-mouse-3-map
[lunar-phases
]
625 '("Lunar phases" . calendar-phases-of-moon
))
626 (define-key calendar-mouse-3-map
[unmark]
627 '("Unmark" . calendar-unmark))
628 (define-key calendar-mouse-3-map [mark-holidays]
629 '("Mark holidays" . mark-calendar-holidays))
630 (define-key calendar-mouse-3-map [list-holidays]
631 '("List holidays" . list-calendar-holidays))
632 (define-key calendar-mouse-3-map [mark-diary-entries]
633 '("Mark diary entries" . mark-diary-entries))
634 (define-key calendar-mouse-3-map [scroll-backward]
635 '("Scroll backward" . scroll-calendar-right-three-months))
636 (define-key calendar-mouse-3-map [scroll-forward]
637 '("Scroll forward" . scroll-calendar-left-three-months))
639 (run-hooks 'cal-menu-load-hook)
643 ;;; arch-tag: aa81cf73-ce89-48a4-97ec-9ef861e87fe9
644 ;;; cal-menu.el ends here