1 ;;; cal-menu.el --- calendar functions for menu bar and popup menu support
3 ;; Copyright (C) 1994, 1995, 2001, 2002, 2003, 2004, 2005, 2006
4 ;; Free Software Foundation, Inc.
6 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
7 ;; Lara Rios <lrios@coewl.cen.uiuc.edu>
8 ;; Maintainer: Glenn Morris <rgm@gnu.org>
10 ;; Human-Keywords: calendar, popup menus, menu bar
12 ;; This file is part of GNU Emacs.
14 ;; GNU Emacs is free software; you can redistribute it and/or modify
15 ;; it under the terms of the GNU General Public License as published by
16 ;; the Free Software Foundation; either version 2, or (at your option)
19 ;; GNU Emacs is distributed in the hope that it will be useful,
20 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ;; GNU General Public License for more details.
24 ;; You should have received a copy of the GNU General Public License
25 ;; along with GNU Emacs; see the file COPYING. If not, write to the
26 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
27 ;; Boston, MA 02110-1301, USA.
31 ;; This collection of functions implements menu bar and popup menu support for
34 ;; Comments, corrections, and improvements should be sent to
35 ;; Edward M. Reingold Department of Computer Science
36 ;; (217) 333-6733 University of Illinois at Urbana-Champaign
37 ;; reingold@cs.uiuc.edu 1304 West Springfield Avenue
38 ;; Urbana, Illinois 61801
42 (defvar displayed-month
)
43 (defvar displayed-year
)
45 ;; Don't require calendar because calendar requires us.
46 ;; (eval-when-compile (require 'calendar))
47 (defvar calendar-mode-map
)
49 (define-key calendar-mode-map
[menu-bar edit
] 'undefined
)
50 (define-key calendar-mode-map
[menu-bar search
] 'undefined
)
52 (define-key calendar-mode-map
[down-mouse-2
] 'calendar-mouse-2-date-menu
)
53 (define-key calendar-mode-map
[mouse-2
] 'ignore
)
55 (defvar calendar-mouse-3-map
(make-sparse-keymap "Calendar"))
56 (define-key calendar-mode-map
[down-mouse-3
] calendar-mouse-3-map
)
58 (define-key calendar-mode-map
[menu-bar moon
]
59 (cons "Moon" (make-sparse-keymap "Moon")))
61 (define-key calendar-mode-map
[menu-bar moon moon
]
62 '("Lunar Phases" . calendar-phases-of-moon
))
64 (define-key calendar-mode-map
[menu-bar diary
]
65 (cons "Diary" (make-sparse-keymap "Diary")))
67 (define-key calendar-mode-map
[menu-bar diary heb
]
68 '("Insert Hebrew" . calendar-mouse-insert-hebrew-diary-entry
))
69 (define-key calendar-mode-map
[menu-bar diary isl
]
70 '("Insert Islamic" . calendar-mouse-insert-islamic-diary-entry
))
71 (define-key calendar-mode-map
[menu-bar diary baha
]
72 '("Insert Baha'i" . calendar-mouse-insert-bahai-diary-entry
))
73 (define-key calendar-mode-map
[menu-bar diary cyc
]
74 '("Insert Cyclic" . insert-cyclic-diary-entry
))
75 (define-key calendar-mode-map
[menu-bar diary blk
]
76 '("Insert Block" . insert-block-diary-entry
))
77 (define-key calendar-mode-map
[menu-bar diary ann
]
78 '("Insert Anniversary" . insert-anniversary-diary-entry
))
79 (define-key calendar-mode-map
[menu-bar diary yr
]
80 '("Insert Yearly" . insert-yearly-diary-entry
))
81 (define-key calendar-mode-map
[menu-bar diary mon
]
82 '("Insert Monthly" . insert-monthly-diary-entry
))
83 (define-key calendar-mode-map
[menu-bar diary wk
]
84 '("Insert Weekly" . insert-weekly-diary-entry
))
85 (define-key calendar-mode-map
[menu-bar diary ent
]
86 '("Insert Diary Entry" . insert-diary-entry
))
87 (define-key calendar-mode-map
[menu-bar diary all
]
88 '("Show All" . show-all-diary-entries
))
89 (define-key calendar-mode-map
[menu-bar diary mark
]
90 '("Mark All" . mark-diary-entries
))
91 (define-key calendar-mode-map
[menu-bar diary view
]
92 '("Cursor Date" . view-diary-entries
))
93 (define-key calendar-mode-map
[menu-bar diary view
]
94 '("Other File" . view-other-diary-entries
))
96 (define-key calendar-mode-map
[menu-bar Holidays
]
97 (cons "Holidays" (make-sparse-keymap "Holidays")))
99 (define-key calendar-mode-map
[menu-bar goto
]
100 (cons "Goto" (make-sparse-keymap "Goto")))
102 (define-key calendar-mode-map
[menu-bar goto french
]
103 '("French Date" . calendar-goto-french-date
))
104 (define-key calendar-mode-map
[menu-bar goto mayan
]
105 (cons "Mayan Date" (make-sparse-keymap "Mayan")))
106 (define-key calendar-mode-map
[menu-bar goto ethiopic
]
107 '("Ethiopic Date" . calendar-goto-ethiopic-date
))
108 (define-key calendar-mode-map
[menu-bar goto coptic
]
109 '("Coptic Date" . calendar-goto-coptic-date
))
110 (define-key calendar-mode-map
[menu-bar goto chinese
]
111 '("Chinese Date" . calendar-goto-chinese-date
))
112 (define-key calendar-mode-map
[menu-bar goto julian
]
113 '("Julian Date" . calendar-goto-julian-date
))
114 (define-key calendar-mode-map
[menu-bar goto islamic
]
115 '("Islamic Date" . calendar-goto-islamic-date
))
116 (define-key calendar-mode-map
[menu-bar goto persian
]
117 '("Baha'i Date" . calendar-goto-bahai-date
))
118 (define-key calendar-mode-map
[menu-bar goto persian
]
119 '("Persian Date" . calendar-goto-persian-date
))
120 (define-key calendar-mode-map
[menu-bar goto hebrew
]
121 '("Hebrew Date" . calendar-goto-hebrew-date
))
122 (define-key calendar-mode-map
[menu-bar goto astro
]
123 '("Astronomical Date" . calendar-goto-astro-day-number
))
124 (define-key calendar-mode-map
[menu-bar goto iso
]
125 '("ISO Date" . calendar-goto-iso-date
))
126 (define-key calendar-mode-map
[menu-bar goto iso-week
]
127 '("ISO Week" . calendar-goto-iso-week
))
128 (define-key calendar-mode-map
[menu-bar goto day-of-year
]
129 '("Day of Year" . calendar-goto-day-of-year
))
130 (define-key calendar-mode-map
[menu-bar goto gregorian
]
131 '("Other Date" . calendar-goto-date
))
132 (define-key calendar-mode-map
[menu-bar goto end-of-year
]
133 '("End of Year" . calendar-end-of-year
))
134 (define-key calendar-mode-map
[menu-bar goto beginning-of-year
]
135 '("Beginning of Year" . calendar-beginning-of-year
))
136 (define-key calendar-mode-map
[menu-bar goto end-of-month
]
137 '("End of Month" . calendar-end-of-month
))
138 (define-key calendar-mode-map
[menu-bar goto beginning-of-month
]
139 '("Beginning of Month" . calendar-beginning-of-month
))
140 (define-key calendar-mode-map
[menu-bar goto end-of-week
]
141 '("End of Week" . calendar-end-of-week
))
142 (define-key calendar-mode-map
[menu-bar goto beginning-of-week
]
143 '("Beginning of Week" . calendar-beginning-of-week
))
144 (define-key calendar-mode-map
[menu-bar goto today
]
145 '("Today" . calendar-goto-today
))
148 (define-key calendar-mode-map
[menu-bar goto mayan prev-rnd
]
149 '("Previous Round" . calendar-previous-calendar-round-date
))
150 (define-key calendar-mode-map
[menu-bar goto mayan nxt-rnd
]
151 '("Next Round" . calendar-next-calendar-round-date
))
152 (define-key calendar-mode-map
[menu-bar goto mayan prev-haab
]
153 '("Previous Haab" . calendar-previous-haab-date
))
154 (define-key calendar-mode-map
[menu-bar goto mayan next-haab
]
155 '("Next Haab" . calendar-next-haab-date
))
156 (define-key calendar-mode-map
[menu-bar goto mayan prev-tzol
]
157 '("Previous Tzolkin" . calendar-previous-tzolkin-date
))
158 (define-key calendar-mode-map
[menu-bar goto mayan next-tzol
]
159 '("Next Tzolkin" . calendar-next-tzolkin-date
))
161 (define-key calendar-mode-map
[menu-bar scroll
]
162 (cons "Scroll" (make-sparse-keymap "Scroll")))
164 (define-key calendar-mode-map
[menu-bar scroll bk-12
]
165 '("Backward 1 Year" .
"4\ev"))
166 (define-key calendar-mode-map
[menu-bar scroll bk-3
]
167 '("Backward 3 Months" . scroll-calendar-right-three-months
))
168 (define-key calendar-mode-map
[menu-bar scroll bk-1
]
169 '("Backward 1 Month" . scroll-calendar-right
))
170 (define-key calendar-mode-map
[menu-bar scroll fwd-12
]
171 '("Forward 1 Year" .
"4\C-v"))
172 (define-key calendar-mode-map
[menu-bar scroll fwd-3
]
173 '("Forward 3 Months" . scroll-calendar-left-three-months
))
174 (define-key calendar-mode-map
[menu-bar scroll fwd-1
]
175 '("Forward 1 Month" . scroll-calendar-left
))
177 (defun calendar-flatten (list)
178 "Flatten LIST eliminating sublists structure; result is a list of atoms.
179 This is the same as the preorder list of leaves in a rooted forest."
183 (append (calendar-flatten (car list
)) (calendar-flatten (cdr list
)))
184 (calendar-flatten (car list
)))))
186 (defun cal-menu-x-popup-menu (position menu
)
187 "Like `x-popup-menu', but prints an error message if popup menus are
189 (if (display-popup-menus-p)
190 (x-popup-menu position menu
)
191 (error "Popup menus are not available on this system")))
193 (defun cal-menu-list-holidays-year ()
194 "Display a list of the holidays of the selected date's year."
196 (let ((year (extract-calendar-year (calendar-cursor-to-date))))
197 (list-holidays year year
)))
199 (defun cal-menu-list-holidays-following-year ()
200 "Display a list of the holidays of the following year."
202 (let ((year (1+ (extract-calendar-year (calendar-cursor-to-date)))))
203 (list-holidays year year
)))
205 (defun cal-menu-list-holidays-previous-year ()
206 "Display a list of the holidays of the previous year."
208 (let ((year (1- (extract-calendar-year (calendar-cursor-to-date)))))
209 (list-holidays year year
)))
211 (defun cal-menu-update ()
212 ;; Update the holiday part of calendar menu bar for the current display.
214 (if (eq major-mode
'calendar-mode
)
216 ;; Show 11 years--5 before, 5 after year of middle month
218 (let ((y (+ displayed-year -
5 i
)))
219 (push (vector (format "For Year %s" y
)
220 (list (list 'lambda
'nil
'(interactive)
221 (list 'list-holidays y y
)))
224 (setq l
(cons ["Mark Holidays" mark-calendar-holidays t
]
225 (cons ["Unmark Calendar" calendar-unmark t
]
227 (define-key calendar-mode-map
[menu-bar Holidays
]
228 (cons "Holidays" (easy-menu-create-menu "Holidays" (nreverse l
))))
229 (define-key calendar-mode-map
[menu-bar Holidays separator
]
231 (define-key calendar-mode-map
[menu-bar Holidays today
]
232 `(,(format "For Today (%s)"
233 (calendar-date-string (calendar-current-date) t t
))
234 . cal-menu-today-holidays
))
236 (let ((my1 (calendar-increment-month -
1))
237 (my2 (calendar-increment-month 1)))
238 (if (= (cdr my1
) (cdr my2
))
240 (calendar-month-name (car my1
) 'abbrev
)
241 (calendar-month-name (car my2
) 'abbrev
)
243 (format "%s, %d-%s, %d"
244 (calendar-month-name (car my1
) 'abbrev
)
246 (calendar-month-name (car my2
) 'abbrev
)
248 (define-key calendar-mode-map
[menu-bar Holidays
3-month
]
249 `(,(format "For Window (%s)" title
)
250 . list-calendar-holidays
)))
251 (let ((date (calendar-cursor-to-date)))
253 (define-key calendar-mode-map
[menu-bar Holidays
1-day
]
254 `(,(format "For Cursor Date (%s)"
255 (calendar-date-string date t t
))
256 . calendar-cursor-holidays
))))))
257 ;; Try to avoid entering infinite beep mode in case of errors.
260 (defun calendar-event-to-date (&optional error
)
262 If event is not on a specific date, signals an error if optional parameter
263 ERROR is t, otherwise just returns nil."
265 (set-buffer (window-buffer (posn-window (event-start last-input-event
))))
266 (goto-char (posn-point (event-start last-input-event
)))
267 (calendar-cursor-to-date error
)))
269 (defun calendar-mouse-insert-hebrew-diary-entry (event)
270 "Pop up menu to insert a Hebrew-date diary entry."
272 (let ((hebrew-selection
273 (cal-menu-x-popup-menu
275 (list "Hebrew insert menu"
276 (list (calendar-hebrew-date-string (calendar-cursor-to-date))
277 '("One time" . insert-hebrew-diary-entry
)
278 '("Monthly" . insert-monthly-hebrew-diary-entry
)
279 '("Yearly" . insert-yearly-hebrew-diary-entry
))))))
280 (and hebrew-selection
(call-interactively hebrew-selection
))))
282 (defun calendar-mouse-insert-islamic-diary-entry (event)
283 "Pop up menu to insert an Islamic-date diary entry."
285 (let ((islamic-selection
286 (cal-menu-x-popup-menu
288 (list "Islamic insert menu"
289 (list (calendar-islamic-date-string (calendar-cursor-to-date))
290 '("One time" . insert-islamic-diary-entry
)
291 '("Monthly" . insert-monthly-islamic-diary-entry
)
292 '("Yearly" . insert-yearly-islamic-diary-entry
))))))
293 (and islamic-selection
(call-interactively islamic-selection
))))
295 (defun calendar-mouse-insert-bahai-diary-entry (event)
296 "Pop up menu to insert an Baha'i-date diary entry."
298 (let ((bahai-selection
301 (list "Baha'i insert menu"
302 (list (calendar-bahai-date-string (calendar-cursor-to-date))
303 '("One time" . insert-bahai-diary-entry
)
304 '("Monthly" . insert-monthly-bahai-diary-entry
)
305 '("Yearly" . insert-yearly-bahai-diary-entry
))))))
306 (and bahai-selection
(call-interactively bahai-selection
))))
308 (defun calendar-mouse-sunrise/sunset
()
309 "Show sunrise/sunset times for mouse-selected date."
312 (calendar-mouse-goto-date (calendar-event-to-date))
313 (calendar-sunrise-sunset)))
315 (defun cal-menu-today-holidays ()
316 "Show holidays for today's date."
319 (calendar-cursor-to-date (calendar-current-date))
320 (calendar-cursor-holidays)))
322 (autoload 'check-calendar-holidays
"holidays")
323 (autoload 'diary-list-entries
"diary-lib")
325 (defun calendar-mouse-holidays (&optional event
)
326 "Pop up menu of holidays for mouse selected date."
328 (let* ((date (calendar-event-to-date))
329 (l (mapcar 'list
(check-calendar-holidays date
)))
331 (cal-menu-x-popup-menu
334 (format "Holidays for %s" (calendar-date-string date
))
336 (list (format "Holidays for %s" (calendar-date-string date
)))
337 (if l l
'("None")))))))
338 (and selection
(call-interactively selection
))))
340 (defun calendar-mouse-view-diary-entries (&optional date diary event
)
341 "Pop up menu of diary entries for mouse-selected date.
342 Use optional DATE and alternative file DIARY.
344 Any holidays are shown if `holidays-in-diary-buffer' is t."
345 (interactive "i\ni\ne")
346 (let* ((date (if date date
(calendar-event-to-date)))
347 (diary-file (if diary diary diary-file
))
348 (diary-list-include-blanks nil
)
349 (diary-display-hook 'ignore
)
351 (mapcar (lambda (x) (split-string (car (cdr x
)) "\^M\\|\n"))
352 (diary-list-entries date
1 'list-only
)))
353 (holidays (if holidays-in-diary-buffer
354 (check-calendar-holidays date
)))
355 (title (concat "Diary entries "
356 (if diary
(format "from %s " diary
) "")
358 (calendar-date-string date
)))
360 (cal-menu-x-popup-menu
365 (mapcar (lambda (x) (list (concat " " x
))) holidays
)
367 (list "--shadow-etched-in" "--shadow-etched-in"))
369 (mapcar 'list
(calendar-flatten diary-entries
))
371 (and selection
(call-interactively selection
))))
373 (defun calendar-mouse-view-other-diary-entries ()
374 "Pop up menu of diary entries from alternative file on mouse-selected date."
376 (calendar-mouse-view-diary-entries
377 (calendar-event-to-date)
378 (read-file-name "Enter diary file name: " default-directory nil t
)))
380 (defun calendar-mouse-insert-diary-entry ()
381 "Insert diary entry for mouse-selected date."
384 (calendar-mouse-goto-date (calendar-event-to-date))
385 (insert-diary-entry nil
)))
387 (defun calendar-mouse-set-mark ()
388 "Mark the date under the cursor."
391 (calendar-mouse-goto-date (calendar-event-to-date))
392 (calendar-set-mark nil
)))
394 (defun cal-tex-mouse-day ()
395 "Make a buffer with LaTeX commands for the day mouse is on."
398 (calendar-mouse-goto-date (calendar-event-to-date))
399 (cal-tex-cursor-day nil
)))
401 (defun cal-tex-mouse-week ()
402 "One page calendar for week indicated by cursor.
403 Holidays are included if `cal-tex-holidays' is t."
406 (calendar-mouse-goto-date (calendar-event-to-date))
407 (cal-tex-cursor-week nil
)))
409 (defun cal-tex-mouse-week2 ()
410 "Make a buffer with LaTeX commands for the week cursor is on.
411 The printed output will be on two pages."
414 (calendar-mouse-goto-date (calendar-event-to-date))
415 (cal-tex-cursor-week2 nil
)))
417 (defun cal-tex-mouse-week-iso ()
418 "One page calendar for week indicated by cursor.
419 Holidays are included if `cal-tex-holidays' is t."
422 (calendar-mouse-goto-date (calendar-event-to-date))
423 (cal-tex-cursor-week-iso nil
)))
425 (defun cal-tex-mouse-week-monday ()
426 "One page calendar for week indicated by cursor."
429 (calendar-mouse-goto-date (calendar-event-to-date))
430 (cal-tex-cursor-week-monday nil
)))
432 (defun cal-tex-mouse-filofax-daily ()
433 "Day-per-page Filofax calendar for week indicated by cursor."
436 (calendar-mouse-goto-date (calendar-event-to-date))
437 (cal-tex-cursor-filofax-daily nil
)))
439 (defun cal-tex-mouse-filofax-2week ()
440 "One page Filofax calendar for week indicated by cursor."
443 (calendar-mouse-goto-date (calendar-event-to-date))
444 (cal-tex-cursor-filofax-2week nil
)))
446 (defun cal-tex-mouse-filofax-week ()
447 "Two page Filofax calendar for week indicated by cursor."
450 (calendar-mouse-goto-date (calendar-event-to-date))
451 (cal-tex-cursor-filofax-week nil
)))
453 (defun cal-tex-mouse-month ()
454 "Make a buffer with LaTeX commands for the month cursor is on.
455 Calendar is condensed onto one page."
458 (calendar-mouse-goto-date (calendar-event-to-date))
459 (cal-tex-cursor-month nil
)))
461 (defun cal-tex-mouse-month-landscape ()
462 "Make a buffer with LaTeX commands for the month cursor is on.
463 The output is in landscape format, one month to a page."
466 (calendar-mouse-goto-date (calendar-event-to-date))
467 (cal-tex-cursor-month-landscape nil
)))
469 (defun cal-tex-mouse-year ()
470 "Make a buffer with LaTeX commands for the year cursor is on."
473 (calendar-mouse-goto-date (calendar-event-to-date))
474 (cal-tex-cursor-year nil
)))
476 (defun cal-tex-mouse-filofax-year ()
477 "Make a buffer with LaTeX commands for Filofax calendar of year cursor is on."
480 (calendar-mouse-goto-date (calendar-event-to-date))
481 (cal-tex-cursor-filofax-year nil
)))
483 (defun cal-tex-mouse-year-landscape ()
484 "Make a buffer with LaTeX commands for the year cursor is on."
487 (calendar-mouse-goto-date (calendar-event-to-date))
488 (cal-tex-cursor-year-landscape nil
)))
490 (defun calendar-mouse-print-dates (&optional event
)
491 "Pop up menu of equivalent dates to mouse selected date."
493 (let* ((date (calendar-event-to-date))
495 (cal-menu-x-popup-menu
498 (concat (calendar-date-string date
) " (Gregorian)")
501 (concat (calendar-date-string date
) " (Gregorian)")
502 (list (calendar-day-of-year-string date
))
503 (list (format "ISO date: %s" (calendar-iso-date-string date
)))
504 (list (format "Julian date: %s"
505 (calendar-julian-date-string date
)))
507 (format "Astronomical (Julian) day number (at noon UTC): %s.0"
508 (calendar-astro-date-string date
)))
510 (format "Fixed (RD) date: %s"
511 (calendar-absolute-from-gregorian date
)))
512 (list (format "Hebrew date (before sunset): %s"
513 (calendar-hebrew-date-string date
)))
514 (list (format "Persian date: %s"
515 (calendar-persian-date-string date
)))
516 (list (format "Baha'i date (before sunset): %s"
517 (calendar-bahai-date-string date
))))
518 (let ((i (calendar-islamic-date-string date
)))
519 (if (not (string-equal i
""))
520 (list (list (format "Islamic date (before sunset): %s" i
)))))
522 (list (format "Chinese date: %s"
523 (calendar-chinese-date-string date
))))
524 ;; (list '("Chinese date (select to echo Chinese date)"
525 ;; . calendar-mouse-chinese-date))
526 (let ((c (calendar-coptic-date-string date
)))
527 (if (not (string-equal c
""))
528 (list (list (format "Coptic date: %s" c
)))))
529 (let ((e (calendar-ethiopic-date-string date
)))
530 (if (not (string-equal e
""))
531 (list (list (format "Ethiopic date: %s" e
)))))
532 (let ((f (calendar-french-date-string date
)))
533 (if (not (string-equal f
""))
534 (list (list (format "French Revolutionary date: %s" f
)))))
537 (format "Mayan date: %s"
538 (calendar-mayan-date-string date
)))))))))
539 (and selection
(call-interactively selection
))))
541 (defun calendar-mouse-chinese-date ()
542 "Show Chinese equivalent for mouse-selected date."
545 (calendar-mouse-goto-date (calendar-event-to-date))
546 (calendar-print-chinese-date)))
548 (defun calendar-mouse-goto-date (date)
549 (set-buffer (window-buffer (posn-window (event-start last-input-event
))))
550 (calendar-goto-date date
))
552 (defun calendar-mouse-2-date-menu (event)
553 "Pop up menu for Mouse-2 for selected date in the calendar window."
555 (let* ((date (calendar-event-to-date t
))
557 (cal-menu-x-popup-menu
559 (list (calendar-date-string date t nil
)
562 '("Holidays" . calendar-mouse-holidays
)
563 '("Mark date" . calendar-mouse-set-mark
)
564 '("Sunrise/sunset" . calendar-mouse-sunrise
/sunset
)
565 '("Other calendars" . calendar-mouse-print-dates
)
566 '("Prepare LaTeX buffer" . calendar-mouse-cal-tex-menu
)
567 '("Diary entries" . calendar-mouse-view-diary-entries
)
568 '("Insert diary entry" . calendar-mouse-insert-diary-entry
)
569 '("Other diary file entries"
570 . calendar-mouse-view-other-diary-entries
)
572 (and selection
(call-interactively selection
))))
574 (defun calendar-mouse-cal-tex-menu (event)
575 "Pop up submenu for Mouse-2 for cal-tex commands for selected date in the calendar window."
578 (cal-menu-x-popup-menu
580 (list (calendar-date-string (calendar-event-to-date t
) t nil
)
583 '("Daily (1 page)" . cal-tex-mouse-day
)
584 '("Weekly (1 page)" . cal-tex-mouse-week
)
585 '("Weekly (2 pages)" . cal-tex-mouse-week2
)
586 '("Weekly (other style; 1 page)" . cal-tex-mouse-week-iso
)
587 '("Weekly (yet another style; 1 page)" .
588 cal-tex-mouse-week-monday
)
589 '("Monthly" . cal-tex-mouse-month
)
590 '("Monthly (landscape)" . cal-tex-mouse-month-landscape
)
591 '("Yearly" . cal-tex-mouse-year
)
592 '("Yearly (landscape)" . cal-tex-mouse-year-landscape
)
593 '("Filofax styles" . cal-tex-mouse-filofax
)
595 (and selection
(call-interactively selection
))))
597 (defun cal-tex-mouse-filofax (event)
598 "Pop up sub-submenu for Mouse-2 for Filofax cal-tex commands for selected date."
601 (cal-menu-x-popup-menu
603 (list (calendar-date-string (calendar-event-to-date t
) t nil
)
606 '("Filofax Daily (one-day-per-page)" .
607 cal-tex-mouse-filofax-daily
)
608 '("Filofax Weekly (2-weeks-at-a-glance)" .
609 cal-tex-mouse-filofax-2week
)
610 '("Filofax Weekly (week-at-a-glance)" .
611 cal-tex-mouse-filofax-week
)
612 '("Filofax Yearly" . cal-tex-mouse-filofax-year
)
614 (and selection
(call-interactively selection
))))
616 (define-key calendar-mouse-3-map
[exit-calendar
]
617 '("Exit calendar" . exit-calendar
))
618 (define-key calendar-mouse-3-map
[show-diary
]
619 '("Show diary" . show-all-diary-entries
))
620 (define-key calendar-mouse-3-map
[lunar-phases
]
621 '("Lunar phases" . calendar-phases-of-moon
))
622 (define-key calendar-mouse-3-map
[unmark]
623 '("Unmark" . calendar-unmark))
624 (define-key calendar-mouse-3-map [mark-holidays]
625 '("Mark holidays" . mark-calendar-holidays))
626 (define-key calendar-mouse-3-map [list-holidays]
627 '("List holidays" . list-calendar-holidays))
628 (define-key calendar-mouse-3-map [mark-diary-entries]
629 '("Mark diary entries" . mark-diary-entries))
630 (define-key calendar-mouse-3-map [scroll-backward]
631 '("Scroll backward" . scroll-calendar-right-three-months))
632 (define-key calendar-mouse-3-map [scroll-forward]
633 '("Scroll forward" . scroll-calendar-left-three-months))
635 (run-hooks 'cal-menu-load-hook)
639 ;; arch-tag: aa81cf73-ce89-48a4-97ec-9ef861e87fe9
640 ;;; cal-menu.el ends here