annotate lisp/calendar/cal-xemacs.el @ 124:9b50b4588a93 r20-1b15

Import from CVS: tag r20-1b15
author cvs
date Mon, 13 Aug 2007 09:26:39 +0200
parents 131b0175ea99
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; cal-xemacs.el --- calendar functions for menu bar and popup menu support
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 ;;; Original file is cal-menu.el.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 ;; Copyright (C) 1994 Free Software Foundation, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;; Lara Rios <lrios@coewl.cen.uiuc.edu>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;; Ported to XEmacs by Chuck Thompson <cthomp@cs.uiuc.edu>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;; Keywords: calendar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;; Human-Keywords: calendar, popup menus, menu bar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;; This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;; XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;; under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;; XEmacs is distributed in the hope that it will be useful, but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;; General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 ;; You should have received a copy of the GNU General Public License
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 16
diff changeset
25 ;; along with XEmacs; see the file COPYING. If not, write to the Free
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 16
diff changeset
26 ;; Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ;;; Commentary:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 ;; This collection of functions implements menu bar and popup menu support for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 ;; calendar.el.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 ;; Comments, corrections, and improvements should be sent to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 ;; Edward M. Reingold Department of Computer Science
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 ;; (217) 333-6733 University of Illinois at Urbana-Champaign
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 ;; reingold@cs.uiuc.edu 1304 West Springfield Avenue
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 ;; Urbana, Illinois 61801
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 ;;; Code:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 ;;(define-key calendar-mode-map 'button2 'calendar-mouse-2-date-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 ;;(define-key calendar-mode-map 'button2up 'ignore)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 (defconst calendar-popup-menu-3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 '("Calendar"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 ["Scroll forward" scroll-calendar-left-three-months t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 ["Scroll backward" scroll-calendar-right-three-months t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 ["Mark diary entries" mark-diary-entries t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 ["List holidays" list-calendar-holidays t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 ["Mark holidays" mark-calendar-holidays t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 ["Unmark" calendar-unmark t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 ["Lunar phases" calendar-phases-of-moon t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 ["Show diary" show-all-diary-entries t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 ["Exit calendar" exit-calendar t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 (defun calendar-popup-menu-3 (e)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 (interactive "@e")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 (popup-menu calendar-popup-menu-3))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 (define-key calendar-mode-map 'button3 'calendar-popup-menu-3)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 (defvar calendar-foobar nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 (defun calendar-popup-menu-2 (e)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 (interactive "@e")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 (setq calendar-foobar (calendar-event-to-date e t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 (let ((menu (list (format "Menu - %s" (calendar-date-string calendar-foobar) t t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 ["Holidays" calendar-mouse-holidays t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 ["Mark date" calendar-mouse-set-mark t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 ["Sunrise/sunset" calendar-mouse-sunrise/sunset t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 ["Other calendars" calendar-mouse-print-dates (calendar-event-to-date e)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 ["Diary entries" calendar-mouse-view-diary-entries t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 ["Insert diary entry" calendar-mouse-insert-diary-entry t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 ["Other Diary file entries"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 calendar-mouse-view-other-diary-entries
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 (calendar-cursor-to-date)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 (popup-menu menu)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 (define-key calendar-mode-map 'button2 'calendar-popup-menu-2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 (defconst calendar-scroll-menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 '("Scroll"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 ["Forward 1 Month" scroll-calendar-left t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 ["Forward 3 Months" scroll-calendar-left-three-months t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 ["Forward 1 Year" (scroll-calendar-left-three-months 4) t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 ["Backward 1 Month" scroll-calendar-right t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 ["Backward 3 Months" scroll-calendar-right-three-months t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 ["Backward 1 Year" (scroll-calendar-right-three-months 4) t]))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 (defconst calendar-goto-menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 '("Goto"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 ["Today" calendar-current-month t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 ["Beginning of week" calendar-beginning-of-week (calendar-cursor-to-date)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 ["End of week" calendar-end-of-week (calendar-cursor-to-date)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 ["Beginning of month" calendar-beginning-of-month (calendar-cursor-to-date)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 ["End of month" calendar-end-of-month (calendar-cursor-to-date)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 ["Beginning of year" calendar-beginning-of-year (calendar-cursor-to-date)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 ["End of year" calendar-end-of-year (calendar-cursor-to-date)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 ["Other date" calendar-goto-date t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 ["ISO date" calendar-goto-iso-date t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 ["Astronomical date" calendar-goto-astro-day-number t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 ["Hebrew date" calendar-goto-hebrew-date t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 ["Islamic date" calendar-goto-islamic-date t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 ["Julian date" calendar-goto-julian-date t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 ("Mayan date"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 ["Next Tzolkin" calendar-next-tzolkin-date t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 ["Previous Tzolkin" calendar-previous-tzolkin-date t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 ["Next Haab" calendar-next-haab-date t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 ["Previous Haab" calendar-previous-haab-date t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 ["Next Round" calendar-next-calendar-round-date t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 ["Previous Round" calendar-previous-calendar-round-date t])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 ["French date" calendar-goto-french-date t]))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 (defconst calendar-holidays-menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 '("Holidays"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 ["One day" calendar-cursor-holidays (calendar-cursor-to-date)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 ["3 months" list-calendar-holidays t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 ["Mark" mark-calendar-holidays t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 ["Unmark" calendar-unmark t]))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 (defconst calendar-diary-menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 '("Diary"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 ["Other file" view-other-diary-entries (calendar-cursor-to-date)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 ["Cursor date" view-diary-entries (calendar-cursor-to-date)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 ["Mark all" mark-diary-entries t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 ["Show all" show-all-diary-entries t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 ["Insert daily"insert-diary-entry t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 ["Insert weekly" insert-weekly-diary-entry (calendar-cursor-to-date)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 ["Insert monthly" insert-monthly-diary-entry (calendar-cursor-to-date)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 ["Insert yearly" insert-yearly-diary-entry (calendar-cursor-to-date)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 ["Insert anniversary" insert-anniversary-diary-entry (calendar-cursor-to-date)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 ["Insert block" insert-block-diary-entry (calendar-cursor-to-date)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 ["Insert cyclic" insert-cyclic-diary-entry (calendar-cursor-to-date)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 ["Insert Islamic" calendar-mouse-insert-islamic-diary-entry (calendar-cursor-to-date)]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 ["Insert Hebrew" calendar-mouse-insert-hebrew-diary-entry (calendar-cursor-to-date)]))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 (defun calendar-add-menus ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 (set-buffer-menubar (copy-sequence current-menubar))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 (if (assoc "Calendar" current-menubar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 (add-submenu nil '("Calendar"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 (if (not (assoc "Scroll" current-menubar))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 (add-submenu '("Calendar") calendar-scroll-menu))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 (if (not (assoc "Goto" current-menubar))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 (add-submenu '("Calendar") calendar-goto-menu))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 (if (not (assoc "Holidays" current-menubar))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 (add-submenu '("Calendar") calendar-holidays-menu))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 (if (not (assoc "Diary" current-menubar))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 (add-submenu '("Calendar") calendar-diary-menu))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 (if (not (assoc "Moon" current-menubar))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 (add-menu-button '("Calendar") ["Moon" calendar-phases-of-moon t]))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 (defun calendar-event-to-date (event &optional error)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 "Date of last event.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 If event is not on a specific date, signals an error if optional parameter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 ERROR is t, otherwise just returns nil."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 (goto-char (event-point event))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 (calendar-cursor-to-date error)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 (defun calendar-mouse-insert-hebrew-diary-entry (event)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 "Pop up menu to insert a Hebrew-date diary entry."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 (interactive "e")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 (let ((menu (list (format "Hebrew insert menu - %s"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 (calendar-hebrew-date-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 (calendar-cursor-to-date)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 ["One time" insert-hebrew-diary-entry t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 ["Monthly" insert-monthly-hebrew-diary-entry t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 ["Yearly" insert-yearly-hebrew-diary-entry t])))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 (popup-menu menu)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 (defun calendar-mouse-insert-islamic-diary-entry (event)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 "Pop up menu to insert an Islamic-date diary entry."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 (interactive "e")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 (let ((menu (list (format "Islamic insert menu - %s"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 (calendar-islamic-date-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 (calendar-cursor-to-date)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 ["One time" insert-islamic-diary-entry t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 ["Monthly" insert-monthly-islamic-diary-entry t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 ["Yearly" insert-yearly-islamic-diary-entry t])))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 (popup-menu menu)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 (defun calendar-mouse-sunrise/sunset ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 "Show sunrise/sunset times for mouse-selected date."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 (calendar-goto-date calendar-foobar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 (setq calendar-foobar nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 (calendar-sunrise-sunset)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 (defun calendar-mouse-holidays ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 "Show holidays for mouse-selected date."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 (calendar-goto-date calendar-foobar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 (setq calendar-foobar nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 (calendar-cursor-holidays)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 (defun calendar-mouse-view-diary-entries ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 "View diary entries on mouse-selected date."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 (calendar-goto-date calendar-foobar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 (setq calendar-foobar nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 (view-diary-entries 1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 (defun calendar-mouse-view-other-diary-entries (event)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 "View diary entries from alternative file on mouse-selected date."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 (interactive "e")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 (calendar-goto-date calendar-foobar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 (call-interactively 'view-other-diary-entries)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 (defun calendar-mouse-insert-diary-entry (event)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 "Insert diary entry for mouse-selected date."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 (interactive "e")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 (calendar-goto-date calendar-foobar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 (insert-diary-entry nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 (defun calendar-mouse-set-mark ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 "Mark the date under the cursor."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 (calendar-goto-date calendar-foobar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 (setq calendar-foobar nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 (calendar-set-mark nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 (defun calendar-mouse-print-dates ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 "Pop up menu of equivalent dates to mouse selected date."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 (let* ((menu (list (format "Date Menu - %s (Gregorian)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 (calendar-date-string calendar-foobar))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 "-----"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 (calendar-day-of-year-string calendar-foobar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 (format "ISO date: %s" (calendar-iso-date-string calendar-foobar))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 (format "Julian date: %s"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 (calendar-julian-date-string calendar-foobar))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 (format "Astronomical (Julian) date (before noon): %s"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 (calendar-astro-date-string calendar-foobar))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 (format "Hebrew date (before sunset): %s"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 (calendar-hebrew-date-string calendar-foobar))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 (let ((i (calendar-islamic-date-string calendar-foobar)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 (if (not (string-equal i ""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 (format "Islamic date (before sunset): %s" i)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 (let ((f (calendar-french-date-string calendar-foobar)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 (if (not (string-equal f ""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 (format "French Revolutionary date: %s" f)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 (format "Mayan date: %s" (calendar-mayan-date-string calendar-foobar)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 (popup-menu menu))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 (setq calendar-foobar nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 (run-hooks 'cal-xemacs-load-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 (provide 'cal-xemacs)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 ;;; cal-menu.el ends here