1 ;;; cal-menu.el --- calendar functions for menu bar and popup menu support
3 ;; Copyright (C) 1994, 1995, 2001, 2003, 2004, 2005 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 <rgm@gnu.org>
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., 51 Franklin Street, Fifth Floor,
26 ;; Boston, MA 02110-1301, 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
))
46 (define-key calendar-mode-map
[menu-bar edit
] 'undefined
)
47 (define-key calendar-mode-map
[menu-bar search
] 'undefined
)
49 (define-key calendar-mode-map
[down-mouse-2
] 'calendar-mouse-2-date-menu
)
50 (define-key calendar-mode-map
[mouse-2
] 'ignore
)
52 (defvar calendar-mouse-3-map
(make-sparse-keymap "Calendar"))
53 (define-key calendar-mode-map
[down-mouse-3
] calendar-mouse-3-map
)
55 (define-key calendar-mode-map
[menu-bar moon
]
56 (cons "Moon" (make-sparse-keymap "Moon")))
58 (define-key calendar-mode-map
[menu-bar moon moon
]
59 '("Lunar Phases" . calendar-phases-of-moon
))
61 (define-key calendar-mode-map
[menu-bar diary
]
62 (cons "Diary" (make-sparse-keymap "Diary")))
64 (define-key calendar-mode-map
[menu-bar diary heb
]
65 '("Insert Hebrew" . calendar-mouse-insert-hebrew-diary-entry
))
66 (define-key calendar-mode-map
[menu-bar diary isl
]
67 '("Insert Islamic" . calendar-mouse-insert-islamic-diary-entry
))
68 (define-key calendar-mode-map
[menu-bar diary baha
]
69 '("Insert Baha'i" . calendar-mouse-insert-bahai-diary-entry
))
70 (define-key calendar-mode-map
[menu-bar diary cyc
]
71 '("Insert Cyclic" . insert-cyclic-diary-entry
))
72 (define-key calendar-mode-map
[menu-bar diary blk
]
73 '("Insert Block" . insert-block-diary-entry
))
74 (define-key calendar-mode-map
[menu-bar diary ann
]
75 '("Insert Anniversary" . insert-anniversary-diary-entry
))
76 (define-key calendar-mode-map
[menu-bar diary yr
]
77 '("Insert Yearly" . insert-yearly-diary-entry
))
78 (define-key calendar-mode-map
[menu-bar diary mon
]
79 '("Insert Monthly" . insert-monthly-diary-entry
))
80 (define-key calendar-mode-map
[menu-bar diary wk
]
81 '("Insert Weekly" . insert-weekly-diary-entry
))
82 (define-key calendar-mode-map
[menu-bar diary ent
]
83 '("Insert Diary Entry" . insert-diary-entry
))
84 (define-key calendar-mode-map
[menu-bar diary all
]
85 '("Show All" . show-all-diary-entries
))
86 (define-key calendar-mode-map
[menu-bar diary mark
]
87 '("Mark All" . mark-diary-entries
))
88 (define-key calendar-mode-map
[menu-bar diary view
]
89 '("Cursor Date" . view-diary-entries
))
90 (define-key calendar-mode-map
[menu-bar diary view
]
91 '("Other File" . view-other-diary-entries
))
93 (define-key calendar-mode-map
[menu-bar Holidays
]
94 (cons "Holidays" (make-sparse-keymap "Holidays")))
96 (define-key calendar-mode-map
[menu-bar goto
]
97 (cons "Goto" (make-sparse-keymap "Goto")))
99 (define-key calendar-mode-map
[menu-bar goto french
]
100 '("French Date" . calendar-goto-french-date
))
101 (define-key calendar-mode-map
[menu-bar goto mayan
]
102 (cons "Mayan Date" (make-sparse-keymap "Mayan")))
103 (define-key calendar-mode-map
[menu-bar goto ethiopic
]
104 '("Ethiopic Date" . calendar-goto-ethiopic-date
))
105 (define-key calendar-mode-map
[menu-bar goto coptic
]
106 '("Coptic Date" . calendar-goto-coptic-date
))
107 (define-key calendar-mode-map
[menu-bar goto chinese
]
108 '("Chinese Date" . calendar-goto-chinese-date
))
109 (define-key calendar-mode-map
[menu-bar goto julian
]
110 '("Julian Date" . calendar-goto-julian-date
))
111 (define-key calendar-mode-map
[menu-bar goto islamic
]
112 '("Islamic Date" . calendar-goto-islamic-date
))
113 (define-key calendar-mode-map
[menu-bar goto persian
]
114 '("Baha'i Date" . calendar-goto-bahai-date
))
115 (define-key calendar-mode-map
[menu-bar goto persian
]
116 '("Persian Date" . calendar-goto-persian-date
))
117 (define-key calendar-mode-map
[menu-bar goto hebrew
]
118 '("Hebrew Date" . calendar-goto-hebrew-date
))
119 (define-key calendar-mode-map
[menu-bar goto astro
]
120 '("Astronomical Date" . calendar-goto-astro-day-number
))
121 (define-key calendar-mode-map
[menu-bar goto iso
]
122 '("ISO Date" . calendar-goto-iso-date
))
123 (define-key calendar-mode-map
[menu-bar goto iso-week
]
124 '("ISO Week" . calendar-goto-iso-week
))
125 (define-key calendar-mode-map
[menu-bar goto day-of-year
]
126 '("Day of Year" . calendar-goto-day-of-year
))
127 (define-key calendar-mode-map
[menu-bar goto gregorian
]
128 '("Other Date" . calendar-goto-date
))
129 (define-key calendar-mode-map
[menu-bar goto end-of-year
]
130 '("End of Year" . calendar-end-of-year
))
131 (define-key calendar-mode-map
[menu-bar goto beginning-of-year
]
132 '("Beginning of Year" . calendar-beginning-of-year
))
133 (define-key calendar-mode-map
[menu-bar goto end-of-month
]
134 '("End of Month" . calendar-end-of-month
))
135 (define-key calendar-mode-map
[menu-bar goto beginning-of-month
]
136 '("Beginning of Month" . calendar-beginning-of-month
))
137 (define-key calendar-mode-map
[menu-bar goto end-of-week
]
138 '("End of Week" . calendar-end-of-week
))
139 (define-key calendar-mode-map
[menu-bar goto beginning-of-week
]
140 '("Beginning of Week" . calendar-beginning-of-week
))
141 (define-key calendar-mode-map
[menu-bar goto today
]
142 '("Today" . calendar-goto-today
))
145 (define-key calendar-mode-map
[menu-bar goto mayan prev-rnd
]
146 '("Previous Round" . calendar-previous-calendar-round-date
))
147 (define-key calendar-mode-map
[menu-bar goto mayan nxt-rnd
]
148 '("Next Round" . calendar-next-calendar-round-date
))
149 (define-key calendar-mode-map
[menu-bar goto mayan prev-haab
]
150 '("Previous Haab" . calendar-previous-haab-date
))
151 (define-key calendar-mode-map
[menu-bar goto mayan next-haab
]
152 '("Next Haab" . calendar-next-haab-date
))
153 (define-key calendar-mode-map
[menu-bar goto mayan prev-tzol
]
154 '("Previous Tzolkin" . calendar-previous-tzolkin-date
))
155 (define-key calendar-mode-map
[menu-bar goto mayan next-tzol
]
156 '("Next Tzolkin" . calendar-next-tzolkin-date
))
158 (define-key calendar-mode-map
[menu-bar scroll
]
159 (cons "Scroll" (make-sparse-keymap "Scroll")))
161 (define-key calendar-mode-map
[menu-bar scroll bk-12
]
162 '("Backward 1 Year" .
"4\ev"))
163 (define-key calendar-mode-map
[menu-bar scroll bk-3
]
164 '("Backward 3 Months" . scroll-calendar-right-three-months
))
165 (define-key calendar-mode-map
[menu-bar scroll bk-1
]
166 '("Backward 1 Month" . scroll-calendar-right
))
167 (define-key calendar-mode-map
[menu-bar scroll fwd-12
]
168 '("Forward 1 Year" .
"4\C-v"))
169 (define-key calendar-mode-map
[menu-bar scroll fwd-3
]
170 '("Forward 3 Months" . scroll-calendar-left-three-months
))
171 (define-key calendar-mode-map
[menu-bar scroll fwd-1
]
172 '("Forward 1 Month" . scroll-calendar-left
))
174 (defun calendar-flatten (list)
175 "Flatten LIST eliminating sublists structure; result is a list of atoms.
176 This is the same as the preorder list of leaves in a rooted forest."
180 (append (calendar-flatten (car list
)) (calendar-flatten (cdr list
)))
181 (calendar-flatten (car list
)))))
183 (defun cal-menu-x-popup-menu (position menu
)
184 "Like `x-popup-menu', but prints an error message if popup menus are
186 (if (display-popup-menus-p)
187 (x-popup-menu position menu
)
188 (error "Popup menus are not available on this system")))
190 (defun cal-menu-list-holidays-year ()
191 "Display a list of the holidays of the selected date's year."
193 (let ((year (extract-calendar-year (calendar-cursor-to-date))))
194 (list-holidays year year
)))
196 (defun cal-menu-list-holidays-following-year ()
197 "Display a list of the holidays of the following year."
199 (let ((year (1+ (extract-calendar-year (calendar-cursor-to-date)))))
200 (list-holidays year year
)))
202 (defun cal-menu-list-holidays-previous-year ()
203 "Display a list of the holidays of the previous year."
205 (let ((year (1- (extract-calendar-year (calendar-cursor-to-date)))))
206 (list-holidays year year
)))
208 (defun cal-menu-update ()
209 ;; Update the holiday part of calendar menu bar for the current display.
211 (if (eq major-mode
'calendar-mode
)
213 (calendar-for-loop;; Show 11 years--5 before, 5 after year of
215 i from
(- displayed-year
5) to
(+ displayed-year
5) do
216 (setq l
(cons (vector (format "For Year %s" i
)
217 (list (list 'lambda
'nil
'(interactive)
218 (list 'list-holidays i i
)))
221 (setq l
(cons ["Mark Holidays" mark-calendar-holidays t
]
222 (cons ["Unmark Calendar" calendar-unmark t
]
224 (define-key calendar-mode-map
[menu-bar Holidays
]
225 (cons "Holidays" (easy-menu-create-menu "Holidays" (nreverse l
))))
226 (define-key calendar-mode-map
[menu-bar Holidays separator
]
228 (define-key calendar-mode-map
[menu-bar Holidays today
]
229 `(,(format "For Today (%s)"
230 (calendar-date-string (calendar-current-date) t t
))
231 . cal-menu-today-holidays
))
233 (let ((m1 displayed-month
)
237 (increment-calendar-month m1 y1 -
1)
238 (increment-calendar-month m2 y2
1)
241 (calendar-month-name m1
'abbrev
)
242 (calendar-month-name m2
'abbrev
)
244 (format "%s, %d-%s, %d"
245 (calendar-month-name m1
'abbrev
)
247 (calendar-month-name m2
'abbrev
)
249 (define-key calendar-mode-map
[menu-bar Holidays
3-month
]
250 `(,(format "For Window (%s)" title
)
251 . list-calendar-holidays
)))
252 (let ((date (calendar-cursor-to-date)))
254 (define-key calendar-mode-map
[menu-bar Holidays
1-day
]
255 `(,(format "For Cursor Date (%s)"
256 (calendar-date-string date t t
))
257 . calendar-cursor-holidays
))))))
258 ;; Try to avoid entering infinite beep mode in case of errors.
261 (defun calendar-event-to-date (&optional error
)
263 If event is not on a specific date, signals an error if optional parameter
264 ERROR is t, otherwise just returns nil."
266 (set-buffer (window-buffer (posn-window (event-start last-input-event
))))
267 (goto-char (posn-point (event-start last-input-event
)))
268 (calendar-cursor-to-date error
)))
270 (defun calendar-mouse-insert-hebrew-diary-entry (event)
271 "Pop up menu to insert a Hebrew-date diary entry."
273 (let ((hebrew-selection
274 (cal-menu-x-popup-menu
276 (list "Hebrew insert menu"
277 (list (calendar-hebrew-date-string (calendar-cursor-to-date))
278 '("One time" . insert-hebrew-diary-entry
)
279 '("Monthly" . insert-monthly-hebrew-diary-entry
)
280 '("Yearly" . insert-yearly-hebrew-diary-entry
))))))
281 (and hebrew-selection
(call-interactively hebrew-selection
))))
283 (defun calendar-mouse-insert-islamic-diary-entry (event)
284 "Pop up menu to insert an Islamic-date diary entry."
286 (let ((islamic-selection
287 (cal-menu-x-popup-menu
289 (list "Islamic insert menu"
290 (list (calendar-islamic-date-string (calendar-cursor-to-date))
291 '("One time" . insert-islamic-diary-entry
)
292 '("Monthly" . insert-monthly-islamic-diary-entry
)
293 '("Yearly" . insert-yearly-islamic-diary-entry
))))))
294 (and islamic-selection
(call-interactively islamic-selection
))))
296 (defun calendar-mouse-insert-bahai-diary-entry (event)
297 "Pop up menu to insert an Baha'i-date diary entry."
299 (let ((bahai-selection
302 (list "Baha'i insert menu"
303 (list (calendar-bahai-date-string (calendar-cursor-to-date))
304 '("One time" . insert-bahai-diary-entry
)
305 '("Monthly" . insert-monthly-bahai-diary-entry
)
306 '("Yearly" . insert-yearly-bahai-diary-entry
))))))
307 (and bahai-selection
(call-interactively bahai-selection
))))
309 (defun calendar-mouse-sunrise/sunset
()
310 "Show sunrise/sunset times for mouse-selected date."
313 (calendar-mouse-goto-date (calendar-event-to-date))
314 (calendar-sunrise-sunset)))
316 (defun cal-menu-today-holidays ()
317 "Show holidays for today's date."
320 (calendar-cursor-to-date (calendar-current-date))
321 (calendar-cursor-holidays)))
323 (autoload 'check-calendar-holidays
"holidays")
324 (autoload 'diary-list-entries
"diary-lib")
326 (defun calendar-mouse-holidays (&optional event
)
327 "Pop up menu of holidays for mouse selected date."
329 (let* ((date (calendar-event-to-date))
330 (l (mapcar 'list
(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 event
)
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."
346 (interactive "i\ni\ne")
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 (diary-list-entries date
1 'list-only
)))
354 (holidays (if holidays-in-diary-buffer
355 (check-calendar-holidays date
)))
356 (title (concat "Diary entries "
357 (if diary
(format "from %s " diary
) "")
359 (calendar-date-string date
)))
361 (cal-menu-x-popup-menu
366 (mapcar (lambda (x) (list (concat " " x
))) holidays
)
368 (list "--shadow-etched-in" "--shadow-etched-in"))
370 (mapcar 'list
(calendar-flatten diary-entries
))
372 (and selection
(call-interactively selection
))))
374 (defun calendar-mouse-view-other-diary-entries ()
375 "Pop up menu of diary entries from alternative file on mouse-selected date."
377 (calendar-mouse-view-diary-entries
378 (calendar-event-to-date)
379 (read-file-name "Enter diary file name: " default-directory nil t
)))
381 (defun calendar-mouse-insert-diary-entry ()
382 "Insert diary entry for mouse-selected date."
385 (calendar-mouse-goto-date (calendar-event-to-date))
386 (insert-diary-entry nil
)))
388 (defun calendar-mouse-set-mark ()
389 "Mark the date under the cursor."
392 (calendar-mouse-goto-date (calendar-event-to-date))
393 (calendar-set-mark nil
)))
395 (defun cal-tex-mouse-day ()
396 "Make a buffer with LaTeX commands for the day mouse is on."
399 (calendar-mouse-goto-date (calendar-event-to-date))
400 (cal-tex-cursor-day nil
)))
402 (defun cal-tex-mouse-week ()
403 "One page calendar for week indicated by cursor.
404 Holidays are included if `cal-tex-holidays' is t."
407 (calendar-mouse-goto-date (calendar-event-to-date))
408 (cal-tex-cursor-week nil
)))
410 (defun cal-tex-mouse-week2 ()
411 "Make a buffer with LaTeX commands for the week cursor is on.
412 The printed output will be on two pages."
415 (calendar-mouse-goto-date (calendar-event-to-date))
416 (cal-tex-cursor-week2 nil
)))
418 (defun cal-tex-mouse-week-iso ()
419 "One page calendar for week indicated by cursor.
420 Holidays are included if `cal-tex-holidays' is t."
423 (calendar-mouse-goto-date (calendar-event-to-date))
424 (cal-tex-cursor-week-iso nil
)))
426 (defun cal-tex-mouse-week-monday ()
427 "One page calendar for week indicated by cursor."
430 (calendar-mouse-goto-date (calendar-event-to-date))
431 (cal-tex-cursor-week-monday nil
)))
433 (defun cal-tex-mouse-filofax-daily ()
434 "Day-per-page Filofax calendar for week indicated by cursor."
437 (calendar-mouse-goto-date (calendar-event-to-date))
438 (cal-tex-cursor-filofax-daily nil
)))
440 (defun cal-tex-mouse-filofax-2week ()
441 "One page Filofax calendar for week indicated by cursor."
444 (calendar-mouse-goto-date (calendar-event-to-date))
445 (cal-tex-cursor-filofax-2week nil
)))
447 (defun cal-tex-mouse-filofax-week ()
448 "Two page Filofax calendar for week indicated by cursor."
451 (calendar-mouse-goto-date (calendar-event-to-date))
452 (cal-tex-cursor-filofax-week nil
)))
454 (defun cal-tex-mouse-month ()
455 "Make a buffer with LaTeX commands for the month cursor is on.
456 Calendar is condensed onto one page."
459 (calendar-mouse-goto-date (calendar-event-to-date))
460 (cal-tex-cursor-month nil
)))
462 (defun cal-tex-mouse-month-landscape ()
463 "Make a buffer with LaTeX commands for the month cursor is on.
464 The output is in landscape format, one month to a page."
467 (calendar-mouse-goto-date (calendar-event-to-date))
468 (cal-tex-cursor-month-landscape nil
)))
470 (defun cal-tex-mouse-year ()
471 "Make a buffer with LaTeX commands for the year cursor is on."
474 (calendar-mouse-goto-date (calendar-event-to-date))
475 (cal-tex-cursor-year nil
)))
477 (defun cal-tex-mouse-filofax-year ()
478 "Make a buffer with LaTeX commands for Filofax calendar of year cursor is on."
481 (calendar-mouse-goto-date (calendar-event-to-date))
482 (cal-tex-cursor-filofax-year nil
)))
484 (defun cal-tex-mouse-year-landscape ()
485 "Make a buffer with LaTeX commands for the year cursor is on."
488 (calendar-mouse-goto-date (calendar-event-to-date))
489 (cal-tex-cursor-year-landscape nil
)))
491 (defun calendar-mouse-print-dates (&optional event
)
492 "Pop up menu of equivalent dates to mouse selected date."
494 (let* ((date (calendar-event-to-date))
496 (cal-menu-x-popup-menu
499 (concat (calendar-date-string date
) " (Gregorian)")
502 (concat (calendar-date-string date
) " (Gregorian)")
503 (list (calendar-day-of-year-string date
))
504 (list (format "ISO date: %s" (calendar-iso-date-string date
)))
505 (list (format "Julian date: %s"
506 (calendar-julian-date-string date
)))
508 (format "Astronomical (Julian) day number (at noon UTC): %s.0"
509 (calendar-astro-date-string date
)))
511 (format "Fixed (RD) date: %s"
512 (calendar-absolute-from-gregorian date
)))
513 (list (format "Hebrew date (before sunset): %s"
514 (calendar-hebrew-date-string date
)))
515 (list (format "Persian date: %s"
516 (calendar-persian-date-string date
)))
517 (list (format "Baha'i date (before sunset): %s"
518 (calendar-bahai-date-string date
))))
519 (let ((i (calendar-islamic-date-string date
)))
520 (if (not (string-equal i
""))
521 (list (list (format "Islamic date (before sunset): %s" i
)))))
523 (list (format "Chinese date: %s"
524 (calendar-chinese-date-string date
))))
525 ;; (list '("Chinese date (select to echo Chinese date)"
526 ;; . calendar-mouse-chinese-date))
527 (let ((c (calendar-coptic-date-string date
)))
528 (if (not (string-equal c
""))
529 (list (list (format "Coptic date: %s" c
)))))
530 (let ((e (calendar-ethiopic-date-string date
)))
531 (if (not (string-equal e
""))
532 (list (list (format "Ethiopic date: %s" e
)))))
533 (let ((f (calendar-french-date-string date
)))
534 (if (not (string-equal f
""))
535 (list (list (format "French Revolutionary date: %s" f
)))))
538 (format "Mayan date: %s"
539 (calendar-mayan-date-string date
)))))))))
540 (and selection
(call-interactively selection
))))
542 (defun calendar-mouse-chinese-date ()
543 "Show Chinese equivalent for mouse-selected date."
546 (calendar-mouse-goto-date (calendar-event-to-date))
547 (calendar-print-chinese-date)))
549 (defun calendar-mouse-goto-date (date)
550 (set-buffer (window-buffer (posn-window (event-start last-input-event
))))
551 (calendar-goto-date date
))
553 (defun calendar-mouse-2-date-menu (event)
554 "Pop up menu for Mouse-2 for selected date in the calendar window."
556 (let* ((date (calendar-event-to-date t
))
558 (cal-menu-x-popup-menu
560 (list (calendar-date-string date t nil
)
563 '("Holidays" . calendar-mouse-holidays
)
564 '("Mark date" . calendar-mouse-set-mark
)
565 '("Sunrise/sunset" . calendar-mouse-sunrise
/sunset
)
566 '("Other calendars" . calendar-mouse-print-dates
)
567 '("Prepare LaTeX buffer" . calendar-mouse-cal-tex-menu
)
568 '("Diary entries" . calendar-mouse-view-diary-entries
)
569 '("Insert diary entry" . calendar-mouse-insert-diary-entry
)
570 '("Other diary file entries"
571 . calendar-mouse-view-other-diary-entries
)
573 (and selection
(call-interactively selection
))))
575 (defun calendar-mouse-cal-tex-menu (event)
576 "Pop up submenu for Mouse-2 for cal-tex commands for selected date in the calendar window."
579 (cal-menu-x-popup-menu
581 (list (calendar-date-string (calendar-event-to-date t
) t nil
)
584 '("Daily (1 page)" . cal-tex-mouse-day
)
585 '("Weekly (1 page)" . cal-tex-mouse-week
)
586 '("Weekly (2 pages)" . cal-tex-mouse-week2
)
587 '("Weekly (other style; 1 page)" . cal-tex-mouse-week-iso
)
588 '("Weekly (yet another style; 1 page)" .
589 cal-tex-mouse-week-monday
)
590 '("Monthly" . cal-tex-mouse-month
)
591 '("Monthly (landscape)" . cal-tex-mouse-month-landscape
)
592 '("Yearly" . cal-tex-mouse-year
)
593 '("Yearly (landscape)" . cal-tex-mouse-year-landscape
)
594 '("Filofax styles" . cal-tex-mouse-filofax
)
596 (and selection
(call-interactively selection
))))
598 (defun cal-tex-mouse-filofax (event)
599 "Pop up sub-submenu for Mouse-2 for Filofax cal-tex commands for selected date."
602 (cal-menu-x-popup-menu
604 (list (calendar-date-string (calendar-event-to-date t
) t nil
)
607 '("Filofax Daily (one-day-per-page)" .
608 cal-tex-mouse-filofax-daily
)
609 '("Filofax Weekly (2-weeks-at-a-glance)" .
610 cal-tex-mouse-filofax-2week
)
611 '("Filofax Weekly (week-at-a-glance)" .
612 cal-tex-mouse-filofax-week
)
613 '("Filofax Yearly" . cal-tex-mouse-filofax-year
)
615 (and selection
(call-interactively selection
))))
617 (define-key calendar-mouse-3-map
[exit-calendar
]
618 '("Exit calendar" . exit-calendar
))
619 (define-key calendar-mouse-3-map
[show-diary
]
620 '("Show diary" . show-all-diary-entries
))
621 (define-key calendar-mouse-3-map
[lunar-phases
]
622 '("Lunar phases" . calendar-phases-of-moon
))
623 (define-key calendar-mouse-3-map
[unmark]
624 '("Unmark" . calendar-unmark))
625 (define-key calendar-mouse-3-map [mark-holidays]
626 '("Mark holidays" . mark-calendar-holidays))
627 (define-key calendar-mouse-3-map [list-holidays]
628 '("List holidays" . list-calendar-holidays))
629 (define-key calendar-mouse-3-map [mark-diary-entries]
630 '("Mark diary entries" . mark-diary-entries))
631 (define-key calendar-mouse-3-map [scroll-backward]
632 '("Scroll backward" . scroll-calendar-right-three-months))
633 (define-key calendar-mouse-3-map [scroll-forward]
634 '("Scroll forward" . scroll-calendar-left-three-months))
636 (run-hooks 'cal-menu-load-hook)
640 ;; arch-tag: aa81cf73-ce89-48a4-97ec-9ef861e87fe9
641 ;;; cal-menu.el ends here