annotate lisp/calendar/cal-menu.el @ 11887:cccb62a4bac6

Remove version number.
author Karl Heuer <kwzh@gnu.org>
date Wed, 24 May 1995 00:30:41 +0000
parents 8187800943e7
children f7638ab47de7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1 ;;; cal-menu.el --- calendar functions for menu bar and popup menu support
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3 ;; Copyright (C) 1994 Free Software Foundation, Inc.
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
6 ;; Lara Rios <lrios@coewl.cen.uiuc.edu>
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
7 ;; Keywords: calendar
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
8 ;; Human-Keywords: calendar, popup menus, menu bar
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
9
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
10 ;; This file is part of GNU Emacs.
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
11
6736
3e1323443b1a Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents: 5701
diff changeset
12 ;; GNU Emacs is free software; you can redistribute it and/or modify
3e1323443b1a Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents: 5701
diff changeset
13 ;; it under the terms of the GNU General Public License as published by
3e1323443b1a Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents: 5701
diff changeset
14 ;; the Free Software Foundation; either version 2, or (at your option)
3e1323443b1a Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents: 5701
diff changeset
15 ;; any later version.
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
16
6736
3e1323443b1a Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents: 5701
diff changeset
17 ;; GNU Emacs is distributed in the hope that it will be useful,
3e1323443b1a Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents: 5701
diff changeset
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
3e1323443b1a Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents: 5701
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3e1323443b1a Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents: 5701
diff changeset
20 ;; GNU General Public License for more details.
3e1323443b1a Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents: 5701
diff changeset
21
3e1323443b1a Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents: 5701
diff changeset
22 ;; You should have received a copy of the GNU General Public License
3e1323443b1a Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents: 5701
diff changeset
23 ;; along with GNU Emacs; see the file COPYING. If not, write to
3e1323443b1a Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents: 5701
diff changeset
24 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
25
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
26 ;;; Commentary:
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
27
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
28 ;; This collection of functions implements menu bar and popup menu support for
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
29 ;; calendar.el.
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
30
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
31 ;; Comments, corrections, and improvements should be sent to
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
32 ;; Edward M. Reingold Department of Computer Science
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
33 ;; (217) 333-6733 University of Illinois at Urbana-Champaign
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
34 ;; reingold@cs.uiuc.edu 1304 West Springfield Avenue
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
35 ;; Urbana, Illinois 61801
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
36
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
37 ;;; Code:
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
38
9999
8187800943e7 Get rid of edit menu.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 9766
diff changeset
39 (define-key calendar-mode-map [menu-bar edit] 'undefined)
8187800943e7 Get rid of edit menu.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 9766
diff changeset
40
7478
57cfbcfdf92a Rewrite mouse-3 menu as a keymap.
Richard M. Stallman <rms@gnu.org>
parents: 7442
diff changeset
41 (define-key calendar-mode-map [down-mouse-2] 'calendar-mouse-2-date-menu)
7713
44a712d8ba03 (calendar-mode-map): Define mouse-2 as ignore.
Richard M. Stallman <rms@gnu.org>
parents: 7576
diff changeset
42 (define-key calendar-mode-map [mouse-2] 'ignore)
7478
57cfbcfdf92a Rewrite mouse-3 menu as a keymap.
Richard M. Stallman <rms@gnu.org>
parents: 7442
diff changeset
43
57cfbcfdf92a Rewrite mouse-3 menu as a keymap.
Richard M. Stallman <rms@gnu.org>
parents: 7442
diff changeset
44 (defvar calendar-mouse-3-map (make-sparse-keymap "Calendar"))
57cfbcfdf92a Rewrite mouse-3 menu as a keymap.
Richard M. Stallman <rms@gnu.org>
parents: 7442
diff changeset
45 (define-key calendar-mode-map [down-mouse-3] calendar-mouse-3-map)
9734
051c27bcbc22 (calendar-mode-map): Define c-down-mouse-3 like down-mouse-3.
Richard M. Stallman <rms@gnu.org>
parents: 9710
diff changeset
46 (define-key calendar-mode-map [C-down-mouse-3] calendar-mouse-3-map)
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
47
7887
a5e6f7045bc0 (calendar-mode-map): Change moon menu bar to pop up a menu.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 7886
diff changeset
48 (define-key calendar-mode-map [menu-bar moon]
a5e6f7045bc0 (calendar-mode-map): Change moon menu bar to pop up a menu.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 7886
diff changeset
49 (cons "Moon" (make-sparse-keymap "Moon")))
a5e6f7045bc0 (calendar-mode-map): Change moon menu bar to pop up a menu.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 7886
diff changeset
50
a5e6f7045bc0 (calendar-mode-map): Change moon menu bar to pop up a menu.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 7886
diff changeset
51 (define-key calendar-mode-map [menu-bar moon moon]
a5e6f7045bc0 (calendar-mode-map): Change moon menu bar to pop up a menu.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 7886
diff changeset
52 '("Lunar phases" . calendar-phases-of-moon))
a5e6f7045bc0 (calendar-mode-map): Change moon menu bar to pop up a menu.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 7886
diff changeset
53
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
54 (define-key calendar-mode-map [menu-bar diary]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
55 (cons "Diary" (make-sparse-keymap "Diary")))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
56
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
57 (define-key calendar-mode-map [menu-bar diary heb]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
58 '("Insert Hebrew" . calendar-mouse-insert-hebrew-diary-entry))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
59 (define-key calendar-mode-map [menu-bar diary isl]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
60 '("Insert Islamic" . calendar-mouse-insert-islamic-diary-entry))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
61 (define-key calendar-mode-map [menu-bar diary cyc]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
62 '("Insert cyclic" . insert-cyclic-diary-entry))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
63 (define-key calendar-mode-map [menu-bar diary blk]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
64 '("Insert block" . insert-block-diary-entry))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
65 (define-key calendar-mode-map [menu-bar diary ann]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
66 '("Insert anniversary" . insert-anniversary-diary-entry))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
67 (define-key calendar-mode-map [menu-bar diary yr]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
68 '("Insert yearly" . insert-yearly-diary-entry))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
69 (define-key calendar-mode-map [menu-bar diary mon]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
70 '("Insert monthly" . insert-monthly-diary-entry))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
71 (define-key calendar-mode-map [menu-bar diary wk]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
72 '("Insert weekly" . insert-weekly-diary-entry))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
73 (define-key calendar-mode-map [menu-bar diary ent]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
74 '("Insert daily". insert-diary-entry))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
75 (define-key calendar-mode-map [menu-bar diary all]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
76 '("Show all" . show-all-diary-entries))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
77 (define-key calendar-mode-map [menu-bar diary mark]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
78 '("Mark all" . mark-diary-entries))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
79 (define-key calendar-mode-map [menu-bar diary view]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
80 '("Cursor date" . view-diary-entries))
9766
71c37f31a02d Bind new function to mouse.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 9734
diff changeset
81 (define-key calendar-mode-map [menu-bar diary view]
71c37f31a02d Bind new function to mouse.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 9734
diff changeset
82 '("Other file" . view-other-diary-entries))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
83
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
84 (define-key calendar-mode-map [menu-bar holidays]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
85 (cons "Holidays" (make-sparse-keymap "Holidays")))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
86
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
87 (define-key calendar-mode-map [menu-bar holidays unmark]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
88 '("Unmark" . calendar-unmark))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
89 (define-key calendar-mode-map [menu-bar holidays mark]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
90 '("Mark" . mark-calendar-holidays))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
91 (define-key calendar-mode-map [menu-bar holidays 3-mon]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
92 '("3 months" . list-calendar-holidays))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
93 (define-key calendar-mode-map [menu-bar holidays 1-day]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
94 '("One day" . calendar-cursor-holidays))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
95
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
96 (define-key calendar-mode-map [menu-bar goto]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
97 (cons "Goto" (make-sparse-keymap "Goto")))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
98
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
99 (define-key calendar-mode-map [menu-bar goto french]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
100 '("French date" . calendar-goto-french-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
101 (define-key calendar-mode-map [menu-bar goto mayan]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
102 (cons "Mayan date" (make-sparse-keymap "Mayan")))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
103 (define-key calendar-mode-map [menu-bar goto julian]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
104 '("Julian date" . calendar-goto-julian-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
105 (define-key calendar-mode-map [menu-bar goto islamic]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
106 '("Islamic date" . calendar-goto-islamic-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
107 (define-key calendar-mode-map [menu-bar goto hebrew]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
108 '("Hebrew date" . calendar-goto-hebrew-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
109 (define-key calendar-mode-map [menu-bar goto astro]
7576
ca650a2739ba (calendar-mode-map): Use calendar-goto-astro-day-number.
Richard M. Stallman <rms@gnu.org>
parents: 7478
diff changeset
110 '("Astronomical date" . calendar-goto-astro-day-number))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
111 (define-key calendar-mode-map [menu-bar goto iso]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
112 '("ISO date" . calendar-goto-iso-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
113 (define-key calendar-mode-map [menu-bar goto gregorian]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
114 '("Other date" . calendar-goto-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
115 (define-key calendar-mode-map [menu-bar goto end-of-year]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
116 '("End of year" . calendar-end-of-year))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
117 (define-key calendar-mode-map [menu-bar goto beginning-of-year]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
118 '("Beginning of year" . calendar-beginning-of-year))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
119 (define-key calendar-mode-map [menu-bar goto end-of-month]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
120 '("End of month" . calendar-end-of-month))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
121 (define-key calendar-mode-map [menu-bar goto beginning-of-month]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
122 '("Beginning of month" . calendar-beginning-of-month))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
123 (define-key calendar-mode-map [menu-bar goto end-of-week]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
124 '("End of week" . calendar-end-of-week))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
125 (define-key calendar-mode-map [menu-bar goto beginning-of-week]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
126 '("Beginning of week" . calendar-beginning-of-week))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
127 (define-key calendar-mode-map [menu-bar goto today]
8308
9c9cbb121c37 Change reference from renamed calendar-current-month to calendar-goto-today.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 7887
diff changeset
128 '("Today" . calendar-goto-today))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
129
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
130
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
131 (define-key calendar-mode-map [menu-bar goto mayan prev-rnd]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
132 '("Previous Round" . calendar-previous-calendar-round-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
133 (define-key calendar-mode-map [menu-bar goto mayan nxt-rnd]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
134 '("Next Round" . calendar-next-calendar-round-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
135 (define-key calendar-mode-map [menu-bar goto mayan prev-haab]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
136 '("Previous Haab" . calendar-previous-haab-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
137 (define-key calendar-mode-map [menu-bar goto mayan next-haab]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
138 '("Next Haab" . calendar-next-haab-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
139 (define-key calendar-mode-map [menu-bar goto mayan prev-tzol]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
140 '("Previous Tzolkin" . calendar-previous-tzolkin-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
141 (define-key calendar-mode-map [menu-bar goto mayan next-tzol]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
142 '("Next Tzolkin" . calendar-next-tzolkin-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
143
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
144 (define-key calendar-mode-map [menu-bar scroll]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
145 (cons "Scroll" (make-sparse-keymap "Scroll")))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
146
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
147 (define-key calendar-mode-map [menu-bar scroll bk-12]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
148 '("Backward 1 Year" . "4\ev"))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
149 (define-key calendar-mode-map [menu-bar scroll bk-3]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
150 '("Backward 3 Months" . scroll-calendar-right-three-months))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
151 (define-key calendar-mode-map [menu-bar scroll bk-1]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
152 '("Backward 1 Month" . scroll-calendar-right))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
153 (define-key calendar-mode-map [menu-bar scroll fwd-12]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
154 '("Forward 1 Year" . "4\C-v"))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
155 (define-key calendar-mode-map [menu-bar scroll fwd-3]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
156 '("Forward 3 Months" . scroll-calendar-left-three-months))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
157 (define-key calendar-mode-map [menu-bar scroll fwd-1]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
158 '("Forward 1 Month" . scroll-calendar-left))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
159
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
160 (put 'calendar-forward-day 'menu-enable '(calendar-cursor-to-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
161 (put 'calendar-backward-day 'menu-enable '(calendar-cursor-to-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
162 (put 'calendar-forward-week 'menu-enable '(calendar-cursor-to-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
163 (put 'calendar-backward-week 'menu-enable '(calendar-cursor-to-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
164 (put 'calendar-forward-month 'menu-enable '(calendar-cursor-to-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
165 (put 'calendar-backward-month 'menu-enable '(calendar-cursor-to-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
166 (put 'calendar-forward-year 'menu-enable '(calendar-cursor-to-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
167 (put 'calendar-backward-year 'menu-enable '(calendar-cursor-to-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
168 (put 'calendar-beginning-of-year 'menu-enable '(calendar-cursor-to-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
169 (put 'calendar-end-of-year 'menu-enable '(calendar-cursor-to-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
170 (put 'calendar-beginning-of-month 'menu-enable '(calendar-cursor-to-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
171 (put 'calendar-end-of-month 'menu-enable '(calendar-cursor-to-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
172 (put 'calendar-end-of-week 'menu-enable '(calendar-cursor-to-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
173 (put 'calendar-beginning-of-week 'menu-enable '(calendar-cursor-to-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
174 (put 'calendar-mouse-print-dates 'menu-enable '(calendar-event-to-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
175 (put 'calendar-sunrise-sunset 'menu-enable '(calendar-event-to-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
176 (put 'calendar-cursor-holidays 'menu-enable '(calendar-cursor-to-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
177 (put 'view-diary-entries 'menu-enable '(calendar-cursor-to-date))
9766
71c37f31a02d Bind new function to mouse.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 9734
diff changeset
178 (put 'view-other-diary-entries 'menu-enable '(calendar-cursor-to-date))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
179 (put 'calendar-mouse-insert-hebrew-diary-entry
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
180 'menu-enable
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
181 '(calendar-cursor-to-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
182 (put 'calendar-mouse-insert-islamic-diary-entry
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
183 'menu-enable
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
184 '(calendar-cursor-to-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
185 (put 'insert-cyclic-diary-entry 'menu-enable '(calendar-cursor-to-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
186 (put 'insert-block-diary-entry 'menu-enable '(calendar-cursor-to-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
187 (put 'insert-anniversary-diary-entry 'menu-enable '(calendar-cursor-to-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
188 (put 'insert-yearly-diary-entry 'menu-enable '(calendar-cursor-to-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
189 (put 'insert-monthly-diary-entry 'menu-enable '(calendar-cursor-to-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
190 (put 'insert-weekly-diary-entry 'menu-enable '(calendar-cursor-to-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
191
7442
27fdaecd7cb1 (calendar-mode-map): Change binding of Mouse-2. Bind Mouse-3.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 7412
diff changeset
192 (defun calendar-event-to-date (&optional error)
27fdaecd7cb1 (calendar-mode-map): Change binding of Mouse-2. Bind Mouse-3.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 7412
diff changeset
193 "Date of last event.
27fdaecd7cb1 (calendar-mode-map): Change binding of Mouse-2. Bind Mouse-3.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 7412
diff changeset
194 If event is not on a specific date, signals an error if optional parameter
27fdaecd7cb1 (calendar-mode-map): Change binding of Mouse-2. Bind Mouse-3.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 7412
diff changeset
195 ERROR is t, otherwise just returns nil."
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
196 (save-excursion
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
197 (goto-char (posn-point (event-start last-input-event)))
7442
27fdaecd7cb1 (calendar-mode-map): Change binding of Mouse-2. Bind Mouse-3.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 7412
diff changeset
198 (calendar-cursor-to-date error)))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
199
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
200 (defun calendar-mouse-insert-hebrew-diary-entry (event)
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
201 "Pop up menu to insert a Hebrew-date diary entry."
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
202 (interactive "e")
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
203 (let ((hebrew-selection
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
204 (x-popup-menu
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
205 event
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
206 (list "Hebrew insert menu"
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
207 (list (calendar-hebrew-date-string (calendar-cursor-to-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
208 '("One time" . insert-hebrew-diary-entry)
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
209 '("Monthly" . insert-monthly-hebrew-diary-entry)
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
210 '("Yearly" . insert-yearly-hebrew-diary-entry))))))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
211 (and hebrew-selection (call-interactively hebrew-selection))))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
212
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
213 (defun calendar-mouse-insert-islamic-diary-entry (event)
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
214 "Pop up menu to insert an Islamic-date diary entry."
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
215 (interactive "e")
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
216 (let ((islamic-selection
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
217 (x-popup-menu
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
218 event
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
219 (list "Islamic insert menu"
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
220 (list (calendar-islamic-date-string (calendar-cursor-to-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
221 '("One time" . insert-islamic-diary-entry)
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
222 '("Monthly" . insert-monthly-islamic-diary-entry)
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
223 '("Yearly" . insert-yearly-islamic-diary-entry))))))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
224 (and islamic-selection (call-interactively islamic-selection))))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
225
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
226 (defun calendar-mouse-sunrise/sunset ()
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
227 "Show sunrise/sunset times for mouse-selected date."
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
228 (interactive)
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
229 (save-excursion
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
230 (calendar-goto-date (calendar-event-to-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
231 (calendar-sunrise-sunset)))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
232
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
233 (defun calendar-mouse-holidays ()
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
234 "Show holidays for mouse-selected date."
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
235 (interactive)
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
236 (save-excursion
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
237 (calendar-goto-date (calendar-event-to-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
238 (calendar-cursor-holidays)))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
239
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
240 (defun calendar-mouse-view-diary-entries ()
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
241 "View diary entries on mouse-selected date."
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
242 (interactive)
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
243 (save-excursion
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
244 (calendar-goto-date (calendar-event-to-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
245 (view-diary-entries 1)))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
246
9766
71c37f31a02d Bind new function to mouse.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 9734
diff changeset
247 (defun calendar-mouse-view-other-diary-entries ()
71c37f31a02d Bind new function to mouse.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 9734
diff changeset
248 "View diary entries from alternative file on mouse-selected date."
71c37f31a02d Bind new function to mouse.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 9734
diff changeset
249 (interactive)
71c37f31a02d Bind new function to mouse.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 9734
diff changeset
250 (save-excursion
71c37f31a02d Bind new function to mouse.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 9734
diff changeset
251 (calendar-goto-date (calendar-event-to-date))
71c37f31a02d Bind new function to mouse.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 9734
diff changeset
252 (call-interactively 'view-other-diary-entries)))
71c37f31a02d Bind new function to mouse.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 9734
diff changeset
253
9710
b5fb08fb2cb3 Put insertion of diary entry on daily menu.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 8308
diff changeset
254 (defun calendar-mouse-insert-diary-entry ()
b5fb08fb2cb3 Put insertion of diary entry on daily menu.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 8308
diff changeset
255 "Insert diary entry for mouse-selected date."
b5fb08fb2cb3 Put insertion of diary entry on daily menu.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 8308
diff changeset
256 (interactive)
b5fb08fb2cb3 Put insertion of diary entry on daily menu.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 8308
diff changeset
257 (save-excursion
b5fb08fb2cb3 Put insertion of diary entry on daily menu.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 8308
diff changeset
258 (calendar-goto-date (calendar-event-to-date))
b5fb08fb2cb3 Put insertion of diary entry on daily menu.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 8308
diff changeset
259 (insert-diary-entry nil)))
b5fb08fb2cb3 Put insertion of diary entry on daily menu.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 8308
diff changeset
260
7412
f067e1a5ceb4 (calendar-mouse-set-mark): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7403
diff changeset
261 (defun calendar-mouse-set-mark ()
f067e1a5ceb4 (calendar-mouse-set-mark): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7403
diff changeset
262 "Mark the date under the cursor."
f067e1a5ceb4 (calendar-mouse-set-mark): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7403
diff changeset
263 (interactive)
f067e1a5ceb4 (calendar-mouse-set-mark): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7403
diff changeset
264 (save-excursion
f067e1a5ceb4 (calendar-mouse-set-mark): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7403
diff changeset
265 (calendar-goto-date (calendar-event-to-date))
f067e1a5ceb4 (calendar-mouse-set-mark): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7403
diff changeset
266 (calendar-set-mark nil)))
f067e1a5ceb4 (calendar-mouse-set-mark): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7403
diff changeset
267
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
268 (defun calendar-mouse-print-dates ()
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
269 "Pop up menu of equivalent dates to mouse selected date."
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
270 (interactive)
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
271 (let ((date (calendar-event-to-date)))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
272 (x-popup-menu
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
273 event
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
274 (list
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
275 "Date Menu"
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
276 (append
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
277 (list
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
278 (concat (calendar-date-string date) " (Gregorian)")
7442
27fdaecd7cb1 (calendar-mode-map): Change binding of Mouse-2. Bind Mouse-3.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 7412
diff changeset
279 (list (calendar-day-of-year-string date))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
280 (list (format "ISO date: %s" (calendar-iso-date-string date)))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
281 (list (format "Julian date: %s" (calendar-julian-date-string date)))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
282 (list (format "Astronomical (Julian) date (before noon): %s"
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
283 (calendar-astro-date-string date)))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
284 (list (format "Hebrew date (before sunset): %s"
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
285 (calendar-hebrew-date-string date))))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
286 (let ((i (calendar-islamic-date-string date)))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
287 (if (not (string-equal i ""))
7402
494ca99e9517 (calendar-mouse-print-dates): Add missing level of list
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
288 (list (list (format "Islamic date (before sunset): %s" i)))))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
289 (let ((f (calendar-french-date-string date)))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
290 (if (not (string-equal f ""))
7402
494ca99e9517 (calendar-mouse-print-dates): Add missing level of list
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
291 (list (list (format "French Revolutionary date: %s" f)))))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
292 (list
7402
494ca99e9517 (calendar-mouse-print-dates): Add missing level of list
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
293 (list
494ca99e9517 (calendar-mouse-print-dates): Add missing level of list
Richard M. Stallman <rms@gnu.org>
parents: 6736
diff changeset
294 (format "Mayan date: %s" (calendar-mayan-date-string date)))))))))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
295
7442
27fdaecd7cb1 (calendar-mode-map): Change binding of Mouse-2. Bind Mouse-3.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 7412
diff changeset
296 (defun calendar-mouse-2-date-menu (event)
27fdaecd7cb1 (calendar-mode-map): Change binding of Mouse-2. Bind Mouse-3.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 7412
diff changeset
297 "Pop up menu for Mouse-2 for selected date in the calendar window."
27fdaecd7cb1 (calendar-mode-map): Change binding of Mouse-2. Bind Mouse-3.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 7412
diff changeset
298 (interactive "e")
27fdaecd7cb1 (calendar-mode-map): Change binding of Mouse-2. Bind Mouse-3.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 7412
diff changeset
299 (let* ((date (calendar-event-to-date t))
27fdaecd7cb1 (calendar-mode-map): Change binding of Mouse-2. Bind Mouse-3.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 7412
diff changeset
300 (selection
27fdaecd7cb1 (calendar-mode-map): Change binding of Mouse-2. Bind Mouse-3.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 7412
diff changeset
301 (x-popup-menu
27fdaecd7cb1 (calendar-mode-map): Change binding of Mouse-2. Bind Mouse-3.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 7412
diff changeset
302 event
27fdaecd7cb1 (calendar-mode-map): Change binding of Mouse-2. Bind Mouse-3.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 7412
diff changeset
303 (list "Menu"
27fdaecd7cb1 (calendar-mode-map): Change binding of Mouse-2. Bind Mouse-3.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 7412
diff changeset
304 (list
27fdaecd7cb1 (calendar-mode-map): Change binding of Mouse-2. Bind Mouse-3.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 7412
diff changeset
305 (calendar-date-string date t t)
27fdaecd7cb1 (calendar-mode-map): Change binding of Mouse-2. Bind Mouse-3.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 7412
diff changeset
306 '("Holidays" . calendar-mouse-holidays)
27fdaecd7cb1 (calendar-mode-map): Change binding of Mouse-2. Bind Mouse-3.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 7412
diff changeset
307 '("Mark date" . calendar-mouse-set-mark)
27fdaecd7cb1 (calendar-mode-map): Change binding of Mouse-2. Bind Mouse-3.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 7412
diff changeset
308 '("Sunrise/sunset" . calendar-mouse-sunrise/sunset)
9766
71c37f31a02d Bind new function to mouse.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 9734
diff changeset
309 '("Other calendars" . calendar-mouse-print-dates)
71c37f31a02d Bind new function to mouse.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 9734
diff changeset
310 '("Diary entries" . calendar-mouse-view-diary-entries)
71c37f31a02d Bind new function to mouse.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 9734
diff changeset
311 '("Insert diary entry" . calendar-mouse-insert-diary-entry)
71c37f31a02d Bind new function to mouse.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 9734
diff changeset
312 '("Other diary file entries"
71c37f31a02d Bind new function to mouse.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 9734
diff changeset
313 . calendar-mouse-view-other-diary-entries)
71c37f31a02d Bind new function to mouse.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 9734
diff changeset
314 )))))
7442
27fdaecd7cb1 (calendar-mode-map): Change binding of Mouse-2. Bind Mouse-3.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 7412
diff changeset
315 (and selection (call-interactively selection))))
27fdaecd7cb1 (calendar-mode-map): Change binding of Mouse-2. Bind Mouse-3.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 7412
diff changeset
316
7478
57cfbcfdf92a Rewrite mouse-3 menu as a keymap.
Richard M. Stallman <rms@gnu.org>
parents: 7442
diff changeset
317 (define-key calendar-mouse-3-map [exit-calendar]
57cfbcfdf92a Rewrite mouse-3 menu as a keymap.
Richard M. Stallman <rms@gnu.org>
parents: 7442
diff changeset
318 '("Exit calendar" . exit-calendar))
57cfbcfdf92a Rewrite mouse-3 menu as a keymap.
Richard M. Stallman <rms@gnu.org>
parents: 7442
diff changeset
319 (define-key calendar-mouse-3-map [show-diary]
57cfbcfdf92a Rewrite mouse-3 menu as a keymap.
Richard M. Stallman <rms@gnu.org>
parents: 7442
diff changeset
320 '("Show diary" . show-all-diary-entries))
57cfbcfdf92a Rewrite mouse-3 menu as a keymap.
Richard M. Stallman <rms@gnu.org>
parents: 7442
diff changeset
321 (define-key calendar-mouse-3-map [lunar-phases]
57cfbcfdf92a Rewrite mouse-3 menu as a keymap.
Richard M. Stallman <rms@gnu.org>
parents: 7442
diff changeset
322 '("Lunar phases" . calendar-phases-of-moon))
57cfbcfdf92a Rewrite mouse-3 menu as a keymap.
Richard M. Stallman <rms@gnu.org>
parents: 7442
diff changeset
323 (define-key calendar-mouse-3-map [unmark]
57cfbcfdf92a Rewrite mouse-3 menu as a keymap.
Richard M. Stallman <rms@gnu.org>
parents: 7442
diff changeset
324 '("Unmark" . calendar-unmark))
57cfbcfdf92a Rewrite mouse-3 menu as a keymap.
Richard M. Stallman <rms@gnu.org>
parents: 7442
diff changeset
325 (define-key calendar-mouse-3-map [mark-holidays]
57cfbcfdf92a Rewrite mouse-3 menu as a keymap.
Richard M. Stallman <rms@gnu.org>
parents: 7442
diff changeset
326 '("Mark holidays" . mark-calendar-holidays))
57cfbcfdf92a Rewrite mouse-3 menu as a keymap.
Richard M. Stallman <rms@gnu.org>
parents: 7442
diff changeset
327 (define-key calendar-mouse-3-map [list-holidays]
57cfbcfdf92a Rewrite mouse-3 menu as a keymap.
Richard M. Stallman <rms@gnu.org>
parents: 7442
diff changeset
328 '("List holidays" . list-calendar-holidays))
57cfbcfdf92a Rewrite mouse-3 menu as a keymap.
Richard M. Stallman <rms@gnu.org>
parents: 7442
diff changeset
329 (define-key calendar-mouse-3-map [mark-diary-entries]
57cfbcfdf92a Rewrite mouse-3 menu as a keymap.
Richard M. Stallman <rms@gnu.org>
parents: 7442
diff changeset
330 '("Mark diary entries" . mark-diary-entries))
57cfbcfdf92a Rewrite mouse-3 menu as a keymap.
Richard M. Stallman <rms@gnu.org>
parents: 7442
diff changeset
331 (define-key calendar-mouse-3-map [scroll-backward]
57cfbcfdf92a Rewrite mouse-3 menu as a keymap.
Richard M. Stallman <rms@gnu.org>
parents: 7442
diff changeset
332 '("Scroll backward" . scroll-calendar-right-three-months))
57cfbcfdf92a Rewrite mouse-3 menu as a keymap.
Richard M. Stallman <rms@gnu.org>
parents: 7442
diff changeset
333 (define-key calendar-mouse-3-map [scroll-forward]
57cfbcfdf92a Rewrite mouse-3 menu as a keymap.
Richard M. Stallman <rms@gnu.org>
parents: 7442
diff changeset
334 '("Scroll forward" . scroll-calendar-left-three-months))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
335
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
336 (run-hooks 'cal-menu-load-hook)
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
337
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
338 (provide 'cal-menu)
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
339
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
340 ;;; cal-menu.el ends here