annotate lisp/calendar/cal-menu.el @ 25530:2b059707aa22

Change protorype of x_alloc_nearest_color.
author Gerd Moellmann <gerd@gnu.org>
date Fri, 03 Sep 1999 18:50:06 +0000
parents 594ed104120c
children 6098465deff0
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
13047
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
3 ;; Copyright (C) 1994, 1995 Free Software Foundation, Inc.
5701
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
14169
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13876
diff changeset
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13876
diff changeset
24 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13876
diff changeset
25 ;; Boston, MA 02111-1307, USA.
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
26
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
27 ;;; Commentary:
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
28
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
29 ;; This collection of functions implements menu bar and popup menu support for
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
30 ;; calendar.el.
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
31
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
32 ;; Comments, corrections, and improvements should be sent to
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
33 ;; Edward M. Reingold Department of Computer Science
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
34 ;; (217) 333-6733 University of Illinois at Urbana-Champaign
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
35 ;; reingold@cs.uiuc.edu 1304 West Springfield Avenue
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
36 ;; Urbana, Illinois 61801
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
37
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
38 ;;; Code:
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
39
19950
947c67a81ec6 Require calendar only when compiling.
Richard M. Stallman <rms@gnu.org>
parents: 19892
diff changeset
40 (eval-when-compile (require 'calendar))
22027
aca7f8a34a9e Made holiday button on menu bar related to current calendar display.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20424
diff changeset
41 (require 'easymenu)
19892
b3d4cde6e4c3 Require calendar.el.
Richard M. Stallman <rms@gnu.org>
parents: 17667
diff changeset
42
9999
8187800943e7 Get rid of edit menu.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 9766
diff changeset
43 (define-key calendar-mode-map [menu-bar edit] 'undefined)
13689
a04244ec8530 Repair function names from rms error in modifying!
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13285
diff changeset
44 (define-key calendar-mode-map [menu-bar search] 'undefined)
9999
8187800943e7 Get rid of edit menu.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 9766
diff changeset
45
7478
57cfbcfdf92a Rewrite mouse-3 menu as a keymap.
Richard M. Stallman <rms@gnu.org>
parents: 7442
diff changeset
46 (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
47 (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
48
57cfbcfdf92a Rewrite mouse-3 menu as a keymap.
Richard M. Stallman <rms@gnu.org>
parents: 7442
diff changeset
49 (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
50 (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
51 (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
52
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
53 (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
54 (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
55
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
56 (define-key calendar-mode-map [menu-bar moon moon]
12033
f7638ab47de7 Fix capitalization in menu bar.
Karl Heuer <kwzh@gnu.org>
parents: 9999
diff changeset
57 '("Lunar Phases" . calendar-phases-of-moon))
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
58
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
59 (define-key calendar-mode-map [menu-bar diary]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
60 (cons "Diary" (make-sparse-keymap "Diary")))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
61
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
62 (define-key calendar-mode-map [menu-bar diary heb]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
63 '("Insert Hebrew" . calendar-mouse-insert-hebrew-diary-entry))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
64 (define-key calendar-mode-map [menu-bar diary isl]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
65 '("Insert Islamic" . calendar-mouse-insert-islamic-diary-entry))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
66 (define-key calendar-mode-map [menu-bar diary cyc]
12033
f7638ab47de7 Fix capitalization in menu bar.
Karl Heuer <kwzh@gnu.org>
parents: 9999
diff changeset
67 '("Insert Cyclic" . insert-cyclic-diary-entry))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
68 (define-key calendar-mode-map [menu-bar diary blk]
12033
f7638ab47de7 Fix capitalization in menu bar.
Karl Heuer <kwzh@gnu.org>
parents: 9999
diff changeset
69 '("Insert Block" . insert-block-diary-entry))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
70 (define-key calendar-mode-map [menu-bar diary ann]
12033
f7638ab47de7 Fix capitalization in menu bar.
Karl Heuer <kwzh@gnu.org>
parents: 9999
diff changeset
71 '("Insert Anniversary" . insert-anniversary-diary-entry))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
72 (define-key calendar-mode-map [menu-bar diary yr]
12033
f7638ab47de7 Fix capitalization in menu bar.
Karl Heuer <kwzh@gnu.org>
parents: 9999
diff changeset
73 '("Insert Yearly" . insert-yearly-diary-entry))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
74 (define-key calendar-mode-map [menu-bar diary mon]
12033
f7638ab47de7 Fix capitalization in menu bar.
Karl Heuer <kwzh@gnu.org>
parents: 9999
diff changeset
75 '("Insert Monthly" . insert-monthly-diary-entry))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
76 (define-key calendar-mode-map [menu-bar diary wk]
12033
f7638ab47de7 Fix capitalization in menu bar.
Karl Heuer <kwzh@gnu.org>
parents: 9999
diff changeset
77 '("Insert Weekly" . insert-weekly-diary-entry))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
78 (define-key calendar-mode-map [menu-bar diary ent]
12033
f7638ab47de7 Fix capitalization in menu bar.
Karl Heuer <kwzh@gnu.org>
parents: 9999
diff changeset
79 '("Insert Daily". insert-diary-entry))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
80 (define-key calendar-mode-map [menu-bar diary all]
12033
f7638ab47de7 Fix capitalization in menu bar.
Karl Heuer <kwzh@gnu.org>
parents: 9999
diff changeset
81 '("Show All" . show-all-diary-entries))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
82 (define-key calendar-mode-map [menu-bar diary mark]
12033
f7638ab47de7 Fix capitalization in menu bar.
Karl Heuer <kwzh@gnu.org>
parents: 9999
diff changeset
83 '("Mark All" . mark-diary-entries))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
84 (define-key calendar-mode-map [menu-bar diary view]
12033
f7638ab47de7 Fix capitalization in menu bar.
Karl Heuer <kwzh@gnu.org>
parents: 9999
diff changeset
85 '("Cursor Date" . view-diary-entries))
9766
71c37f31a02d Bind new function to mouse.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 9734
diff changeset
86 (define-key calendar-mode-map [menu-bar diary view]
12033
f7638ab47de7 Fix capitalization in menu bar.
Karl Heuer <kwzh@gnu.org>
parents: 9999
diff changeset
87 '("Other File" . view-other-diary-entries))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
88
22035
887dbe664b45 (calendar-mode-map): Rename `holidays' menu to `Holidays'.
Richard M. Stallman <rms@gnu.org>
parents: 22031
diff changeset
89 (define-key calendar-mode-map [menu-bar Holidays]
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
90 (cons "Holidays" (make-sparse-keymap "Holidays")))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
91
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
92 (define-key calendar-mode-map [menu-bar goto]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
93 (cons "Goto" (make-sparse-keymap "Goto")))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
94
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
95 (define-key calendar-mode-map [menu-bar goto french]
12033
f7638ab47de7 Fix capitalization in menu bar.
Karl Heuer <kwzh@gnu.org>
parents: 9999
diff changeset
96 '("French Date" . calendar-goto-french-date))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
97 (define-key calendar-mode-map [menu-bar goto mayan]
12033
f7638ab47de7 Fix capitalization in menu bar.
Karl Heuer <kwzh@gnu.org>
parents: 9999
diff changeset
98 (cons "Mayan Date" (make-sparse-keymap "Mayan")))
13047
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
99 (define-key calendar-mode-map [menu-bar goto ethiopic]
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
100 '("Ethiopic Date" . calendar-goto-ethiopic-date))
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
101 (define-key calendar-mode-map [menu-bar goto coptic]
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
102 '("Coptic Date" . calendar-goto-coptic-date))
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
103 (define-key calendar-mode-map [menu-bar goto chinese]
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
104 '("Chinese Date" . calendar-goto-chinese-date))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
105 (define-key calendar-mode-map [menu-bar goto julian]
12033
f7638ab47de7 Fix capitalization in menu bar.
Karl Heuer <kwzh@gnu.org>
parents: 9999
diff changeset
106 '("Julian Date" . calendar-goto-julian-date))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
107 (define-key calendar-mode-map [menu-bar goto islamic]
12033
f7638ab47de7 Fix capitalization in menu bar.
Karl Heuer <kwzh@gnu.org>
parents: 9999
diff changeset
108 '("Islamic Date" . calendar-goto-islamic-date))
14915
5a4b28f19b75 Add references to Persian calendar.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 14169
diff changeset
109 (define-key calendar-mode-map [menu-bar goto persian]
5a4b28f19b75 Add references to Persian calendar.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 14169
diff changeset
110 '("Persian Date" . calendar-goto-persian-date))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
111 (define-key calendar-mode-map [menu-bar goto hebrew]
12033
f7638ab47de7 Fix capitalization in menu bar.
Karl Heuer <kwzh@gnu.org>
parents: 9999
diff changeset
112 '("Hebrew Date" . calendar-goto-hebrew-date))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
113 (define-key calendar-mode-map [menu-bar goto astro]
12033
f7638ab47de7 Fix capitalization in menu bar.
Karl Heuer <kwzh@gnu.org>
parents: 9999
diff changeset
114 '("Astronomical Date" . calendar-goto-astro-day-number))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
115 (define-key calendar-mode-map [menu-bar goto iso]
12033
f7638ab47de7 Fix capitalization in menu bar.
Karl Heuer <kwzh@gnu.org>
parents: 9999
diff changeset
116 '("ISO Date" . calendar-goto-iso-date))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
117 (define-key calendar-mode-map [menu-bar goto gregorian]
12033
f7638ab47de7 Fix capitalization in menu bar.
Karl Heuer <kwzh@gnu.org>
parents: 9999
diff changeset
118 '("Other Date" . calendar-goto-date))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
119 (define-key calendar-mode-map [menu-bar goto end-of-year]
12033
f7638ab47de7 Fix capitalization in menu bar.
Karl Heuer <kwzh@gnu.org>
parents: 9999
diff changeset
120 '("End of Year" . calendar-end-of-year))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
121 (define-key calendar-mode-map [menu-bar goto beginning-of-year]
12033
f7638ab47de7 Fix capitalization in menu bar.
Karl Heuer <kwzh@gnu.org>
parents: 9999
diff changeset
122 '("Beginning of Year" . calendar-beginning-of-year))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
123 (define-key calendar-mode-map [menu-bar goto end-of-month]
12033
f7638ab47de7 Fix capitalization in menu bar.
Karl Heuer <kwzh@gnu.org>
parents: 9999
diff changeset
124 '("End of Month" . calendar-end-of-month))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
125 (define-key calendar-mode-map [menu-bar goto beginning-of-month]
12033
f7638ab47de7 Fix capitalization in menu bar.
Karl Heuer <kwzh@gnu.org>
parents: 9999
diff changeset
126 '("Beginning of Month" . calendar-beginning-of-month))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
127 (define-key calendar-mode-map [menu-bar goto end-of-week]
12033
f7638ab47de7 Fix capitalization in menu bar.
Karl Heuer <kwzh@gnu.org>
parents: 9999
diff changeset
128 '("End of Week" . calendar-end-of-week))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
129 (define-key calendar-mode-map [menu-bar goto beginning-of-week]
12033
f7638ab47de7 Fix capitalization in menu bar.
Karl Heuer <kwzh@gnu.org>
parents: 9999
diff changeset
130 '("Beginning of Week" . calendar-beginning-of-week))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
131 (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
132 '("Today" . calendar-goto-today))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
133
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
134
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
135 (define-key calendar-mode-map [menu-bar goto mayan prev-rnd]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
136 '("Previous Round" . calendar-previous-calendar-round-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
137 (define-key calendar-mode-map [menu-bar goto mayan nxt-rnd]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
138 '("Next Round" . calendar-next-calendar-round-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
139 (define-key calendar-mode-map [menu-bar goto mayan prev-haab]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
140 '("Previous Haab" . calendar-previous-haab-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
141 (define-key calendar-mode-map [menu-bar goto mayan next-haab]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
142 '("Next Haab" . calendar-next-haab-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
143 (define-key calendar-mode-map [menu-bar goto mayan prev-tzol]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
144 '("Previous Tzolkin" . calendar-previous-tzolkin-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
145 (define-key calendar-mode-map [menu-bar goto mayan next-tzol]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
146 '("Next Tzolkin" . calendar-next-tzolkin-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
147
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
148 (define-key calendar-mode-map [menu-bar scroll]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
149 (cons "Scroll" (make-sparse-keymap "Scroll")))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
150
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
151 (define-key calendar-mode-map [menu-bar scroll bk-12]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
152 '("Backward 1 Year" . "4\ev"))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
153 (define-key calendar-mode-map [menu-bar scroll bk-3]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
154 '("Backward 3 Months" . scroll-calendar-right-three-months))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
155 (define-key calendar-mode-map [menu-bar scroll bk-1]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
156 '("Backward 1 Month" . scroll-calendar-right))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
157 (define-key calendar-mode-map [menu-bar scroll fwd-12]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
158 '("Forward 1 Year" . "4\C-v"))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
159 (define-key calendar-mode-map [menu-bar scroll fwd-3]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
160 '("Forward 3 Months" . scroll-calendar-left-three-months))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
161 (define-key calendar-mode-map [menu-bar scroll fwd-1]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
162 '("Forward 1 Month" . scroll-calendar-left))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
163
17667
fd527e9aa377 (cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents: 17553
diff changeset
164 (defun cal-menu-list-holidays-year ()
fd527e9aa377 (cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents: 17553
diff changeset
165 "Display a list of the holidays of the selected date's year."
fd527e9aa377 (cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents: 17553
diff changeset
166 (interactive)
fd527e9aa377 (cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents: 17553
diff changeset
167 (let ((year (extract-calendar-year (calendar-cursor-to-date))))
fd527e9aa377 (cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents: 17553
diff changeset
168 (list-holidays year year)))
fd527e9aa377 (cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents: 17553
diff changeset
169
fd527e9aa377 (cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents: 17553
diff changeset
170 (defun cal-menu-list-holidays-following-year ()
fd527e9aa377 (cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents: 17553
diff changeset
171 "Display a list of the holidays of the following year."
fd527e9aa377 (cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents: 17553
diff changeset
172 (interactive)
fd527e9aa377 (cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents: 17553
diff changeset
173 (let ((year (1+ (extract-calendar-year (calendar-cursor-to-date)))))
fd527e9aa377 (cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents: 17553
diff changeset
174 (list-holidays year year)))
fd527e9aa377 (cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents: 17553
diff changeset
175
fd527e9aa377 (cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents: 17553
diff changeset
176 (defun cal-menu-list-holidays-previous-year ()
fd527e9aa377 (cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents: 17553
diff changeset
177 "Display a list of the holidays of the previous year."
fd527e9aa377 (cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents: 17553
diff changeset
178 (interactive)
fd527e9aa377 (cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents: 17553
diff changeset
179 (let ((year (1- (extract-calendar-year (calendar-cursor-to-date)))))
fd527e9aa377 (cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents: 17553
diff changeset
180 (list-holidays year year)))
fd527e9aa377 (cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents: 17553
diff changeset
181
22027
aca7f8a34a9e Made holiday button on menu bar related to current calendar display.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20424
diff changeset
182 (defun cal-menu-update ()
aca7f8a34a9e Made holiday button on menu bar related to current calendar display.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20424
diff changeset
183 ;; Update the holiday part of calendar menu bar for the current display.
aca7f8a34a9e Made holiday button on menu bar related to current calendar display.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20424
diff changeset
184 (condition-case nil
aca7f8a34a9e Made holiday button on menu bar related to current calendar display.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20424
diff changeset
185 (if (eq major-mode 'calendar-mode)
aca7f8a34a9e Made holiday button on menu bar related to current calendar display.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20424
diff changeset
186 (let ((l))
aca7f8a34a9e Made holiday button on menu bar related to current calendar display.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20424
diff changeset
187 (calendar-for-loop;; Show 11 years--5 before, 5 after year of
aca7f8a34a9e Made holiday button on menu bar related to current calendar display.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20424
diff changeset
188 ;; middle month
aca7f8a34a9e Made holiday button on menu bar related to current calendar display.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20424
diff changeset
189 i from (- displayed-year 5) to (+ displayed-year 5) do
aca7f8a34a9e Made holiday button on menu bar related to current calendar display.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20424
diff changeset
190 (setq l (cons (vector (format "For Year %s" i)
aca7f8a34a9e Made holiday button on menu bar related to current calendar display.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20424
diff changeset
191 (list (list 'lambda 'nil '(interactive)
aca7f8a34a9e Made holiday button on menu bar related to current calendar display.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20424
diff changeset
192 (list 'list-holidays i i)))
aca7f8a34a9e Made holiday button on menu bar related to current calendar display.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20424
diff changeset
193 t)
aca7f8a34a9e Made holiday button on menu bar related to current calendar display.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20424
diff changeset
194 l)))
aca7f8a34a9e Made holiday button on menu bar related to current calendar display.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20424
diff changeset
195 (setq l (cons ["Mark Holidays" mark-calendar-holidays t]
22036
342138eae82d Add separators to Holidays menu.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22035
diff changeset
196 (cons ["Unmark Calendar" calendar-unmark t]
22365
042d83ae4200 Fix menu separators.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22036
diff changeset
197 (cons ["--" '("--") t] l))))
22035
887dbe664b45 (calendar-mode-map): Rename `holidays' menu to `Holidays'.
Richard M. Stallman <rms@gnu.org>
parents: 22031
diff changeset
198 (easy-menu-change nil "Holidays" (nreverse l))
22365
042d83ae4200 Fix menu separators.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22036
diff changeset
199 (define-key calendar-mode-map [menu-bar Holidays separator]
22036
342138eae82d Add separators to Holidays menu.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22035
diff changeset
200 '("--"))
22035
887dbe664b45 (calendar-mode-map): Rename `holidays' menu to `Holidays'.
Richard M. Stallman <rms@gnu.org>
parents: 22031
diff changeset
201 (define-key calendar-mode-map [menu-bar Holidays today]
22031
879df83433a1 Minor fix to earlier changes today.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22027
diff changeset
202 `(,(format "For Today (%s)"
879df83433a1 Minor fix to earlier changes today.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22027
diff changeset
203 (calendar-date-string (calendar-current-date) t t))
879df83433a1 Minor fix to earlier changes today.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22027
diff changeset
204 . cal-menu-today-holidays))
22027
aca7f8a34a9e Made holiday button on menu bar related to current calendar display.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20424
diff changeset
205 (let ((title
aca7f8a34a9e Made holiday button on menu bar related to current calendar display.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20424
diff changeset
206 (let ((m1 displayed-month)
aca7f8a34a9e Made holiday button on menu bar related to current calendar display.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20424
diff changeset
207 (y1 displayed-year)
aca7f8a34a9e Made holiday button on menu bar related to current calendar display.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20424
diff changeset
208 (m2 displayed-month)
aca7f8a34a9e Made holiday button on menu bar related to current calendar display.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20424
diff changeset
209 (y2 displayed-year))
aca7f8a34a9e Made holiday button on menu bar related to current calendar display.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20424
diff changeset
210 (increment-calendar-month m1 y1 -1)
aca7f8a34a9e Made holiday button on menu bar related to current calendar display.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20424
diff changeset
211 (increment-calendar-month m2 y2 1)
aca7f8a34a9e Made holiday button on menu bar related to current calendar display.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20424
diff changeset
212 (if (= y1 y2)
aca7f8a34a9e Made holiday button on menu bar related to current calendar display.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20424
diff changeset
213 (format "%s-%s, %d"
aca7f8a34a9e Made holiday button on menu bar related to current calendar display.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20424
diff changeset
214 (calendar-month-name m1 3)
aca7f8a34a9e Made holiday button on menu bar related to current calendar display.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20424
diff changeset
215 (calendar-month-name m2 3)
aca7f8a34a9e Made holiday button on menu bar related to current calendar display.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20424
diff changeset
216 y2)
aca7f8a34a9e Made holiday button on menu bar related to current calendar display.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20424
diff changeset
217 (format "%s, %d-%s, %d"
aca7f8a34a9e Made holiday button on menu bar related to current calendar display.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20424
diff changeset
218 (calendar-month-name m1 3)
aca7f8a34a9e Made holiday button on menu bar related to current calendar display.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20424
diff changeset
219 y1
aca7f8a34a9e Made holiday button on menu bar related to current calendar display.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20424
diff changeset
220 (calendar-month-name m2 3)
aca7f8a34a9e Made holiday button on menu bar related to current calendar display.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20424
diff changeset
221 y2)))))
22035
887dbe664b45 (calendar-mode-map): Rename `holidays' menu to `Holidays'.
Richard M. Stallman <rms@gnu.org>
parents: 22031
diff changeset
222 (define-key calendar-mode-map [menu-bar Holidays 3-month]
887dbe664b45 (calendar-mode-map): Rename `holidays' menu to `Holidays'.
Richard M. Stallman <rms@gnu.org>
parents: 22031
diff changeset
223 `(,(format "For Window (%s)" title)
22027
aca7f8a34a9e Made holiday button on menu bar related to current calendar display.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20424
diff changeset
224 . list-calendar-holidays)))
aca7f8a34a9e Made holiday button on menu bar related to current calendar display.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20424
diff changeset
225 (let ((date (calendar-cursor-to-date)))
aca7f8a34a9e Made holiday button on menu bar related to current calendar display.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20424
diff changeset
226 (if date
22035
887dbe664b45 (calendar-mode-map): Rename `holidays' menu to `Holidays'.
Richard M. Stallman <rms@gnu.org>
parents: 22031
diff changeset
227 (define-key calendar-mode-map [menu-bar Holidays 1-day]
23593
594ed104120c (cal-menu-update): Fix menu wording.
Karl Heuer <kwzh@gnu.org>
parents: 22414
diff changeset
228 `(,(format "For Cursor Date (%s)"
22027
aca7f8a34a9e Made holiday button on menu bar related to current calendar display.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20424
diff changeset
229 (calendar-date-string date t t))
aca7f8a34a9e Made holiday button on menu bar related to current calendar display.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20424
diff changeset
230 . calendar-cursor-holidays))))))
aca7f8a34a9e Made holiday button on menu bar related to current calendar display.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20424
diff changeset
231 ;; Try to avoid entering infinite beep mode in case of errors.
aca7f8a34a9e Made holiday button on menu bar related to current calendar display.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20424
diff changeset
232 (error (ding))))
aca7f8a34a9e Made holiday button on menu bar related to current calendar display.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20424
diff changeset
233
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
234 (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
235 "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
236 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
237 ERROR is t, otherwise just returns nil."
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
238 (save-excursion
14951
15ab8e95a50a (calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14915
diff changeset
239 (set-buffer (window-buffer (posn-window (event-start last-input-event))))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
240 (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
241 (calendar-cursor-to-date error)))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
242
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
243 (defun calendar-mouse-insert-hebrew-diary-entry (event)
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
244 "Pop up menu to insert a Hebrew-date diary entry."
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
245 (interactive "e")
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
246 (let ((hebrew-selection
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
247 (x-popup-menu
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
248 event
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
249 (list "Hebrew insert menu"
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
250 (list (calendar-hebrew-date-string (calendar-cursor-to-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
251 '("One time" . insert-hebrew-diary-entry)
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
252 '("Monthly" . insert-monthly-hebrew-diary-entry)
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
253 '("Yearly" . insert-yearly-hebrew-diary-entry))))))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
254 (and hebrew-selection (call-interactively hebrew-selection))))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
255
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
256 (defun calendar-mouse-insert-islamic-diary-entry (event)
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
257 "Pop up menu to insert an Islamic-date diary entry."
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
258 (interactive "e")
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
259 (let ((islamic-selection
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
260 (x-popup-menu
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
261 event
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
262 (list "Islamic insert menu"
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
263 (list (calendar-islamic-date-string (calendar-cursor-to-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
264 '("One time" . insert-islamic-diary-entry)
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
265 '("Monthly" . insert-monthly-islamic-diary-entry)
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
266 '("Yearly" . insert-yearly-islamic-diary-entry))))))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
267 (and islamic-selection (call-interactively islamic-selection))))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
268
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
269 (defun calendar-mouse-sunrise/sunset ()
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
270 "Show sunrise/sunset times for mouse-selected date."
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
271 (interactive)
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
272 (save-excursion
14951
15ab8e95a50a (calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14915
diff changeset
273 (calendar-mouse-goto-date (calendar-event-to-date))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
274 (calendar-sunrise-sunset)))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
275
22031
879df83433a1 Minor fix to earlier changes today.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22027
diff changeset
276 (defun cal-menu-today-holidays ()
879df83433a1 Minor fix to earlier changes today.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22027
diff changeset
277 "Show holidays for today's date."
879df83433a1 Minor fix to earlier changes today.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22027
diff changeset
278 (interactive)
879df83433a1 Minor fix to earlier changes today.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22027
diff changeset
279 (save-excursion
879df83433a1 Minor fix to earlier changes today.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22027
diff changeset
280 (calendar-cursor-to-date (calendar-current-date))
879df83433a1 Minor fix to earlier changes today.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22027
diff changeset
281 (calendar-cursor-holidays)))
879df83433a1 Minor fix to earlier changes today.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22027
diff changeset
282
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
283 (defun calendar-mouse-holidays ()
22413
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
284 "Pop up menu of holidays for mouse selected date."
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
285 (interactive)
22413
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
286 (let* ((date (calendar-event-to-date))
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
287 (l (mapcar '(lambda (x) (list x))
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
288 (check-calendar-holidays date)))
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
289 (selection
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
290 (x-popup-menu
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
291 event
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
292 (list
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
293 (format "Holidays for %s" (calendar-date-string date))
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
294 (append
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
295 (list (format "Holidays for %s" (calendar-date-string date)))
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
296 (if l l '("None")))))))
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
297 (and selection (call-interactively selection))))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
298
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
299 (defun calendar-mouse-view-diary-entries ()
22413
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
300 "Pop up menu of diary entries for mouse selected date."
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
301 (interactive)
22413
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
302 (let* ((date (calendar-event-to-date))
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
303 (l (mapcar '(lambda (x) (list (car (cdr x))))
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
304 (let ((diary-list-include-blanks nil)
22414
80fbcba480dc Minor fix to previous change.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22413
diff changeset
305 (diary-display-hook 'ignore))
22413
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
306 (list-diary-entries date 1))))
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
307 (selection
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
308 (x-popup-menu
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
309 event
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
310 (list
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
311 (format "Diary entries for %s" (calendar-date-string date))
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
312 (append
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
313 (list (format "Diary entries for %s" (calendar-date-string date)))
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
314 (if l l '("None")))))))
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
315 (and selection (call-interactively selection))))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
316
9766
71c37f31a02d Bind new function to mouse.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 9734
diff changeset
317 (defun calendar-mouse-view-other-diary-entries ()
22413
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
318 "Pop up menu of diary entries from alternative file on mouse-selected date."
9766
71c37f31a02d Bind new function to mouse.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 9734
diff changeset
319 (interactive)
22413
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
320 (let* ((date (calendar-event-to-date))
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
321 (l (mapcar '(lambda (x) (list (car (cdr x))))
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
322 (let ((diary-list-include-blanks nil)
22414
80fbcba480dc Minor fix to previous change.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22413
diff changeset
323 (diary-display-hook 'ignore)
22413
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
324 (diary-file (read-file-name
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
325 "Enter diary file name: "
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
326 default-directory nil t)))
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
327 (list-diary-entries date 1))))
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
328 (selection
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
329 (x-popup-menu
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
330 event
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
331 (list
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
332 (format "Diary entries from %s for %s"
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
333 diary-file
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
334 (calendar-date-string date))
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
335 (append
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
336 (list (format "Diary entries from %s for %s"
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
337 diary-file
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
338 (calendar-date-string date)))
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
339 (if l l '("None")))))))
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
340 (and selection (call-interactively selection))))
9766
71c37f31a02d Bind new function to mouse.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 9734
diff changeset
341
9710
b5fb08fb2cb3 Put insertion of diary entry on daily menu.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 8308
diff changeset
342 (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
343 "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
344 (interactive)
b5fb08fb2cb3 Put insertion of diary entry on daily menu.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 8308
diff changeset
345 (save-excursion
14951
15ab8e95a50a (calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14915
diff changeset
346 (calendar-mouse-goto-date (calendar-event-to-date))
9710
b5fb08fb2cb3 Put insertion of diary entry on daily menu.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 8308
diff changeset
347 (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
348
7412
f067e1a5ceb4 (calendar-mouse-set-mark): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7403
diff changeset
349 (defun calendar-mouse-set-mark ()
f067e1a5ceb4 (calendar-mouse-set-mark): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7403
diff changeset
350 "Mark the date under the cursor."
f067e1a5ceb4 (calendar-mouse-set-mark): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7403
diff changeset
351 (interactive)
f067e1a5ceb4 (calendar-mouse-set-mark): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7403
diff changeset
352 (save-excursion
14951
15ab8e95a50a (calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14915
diff changeset
353 (calendar-mouse-goto-date (calendar-event-to-date))
7412
f067e1a5ceb4 (calendar-mouse-set-mark): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7403
diff changeset
354 (calendar-set-mark nil)))
f067e1a5ceb4 (calendar-mouse-set-mark): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7403
diff changeset
355
13194
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
356 (defun cal-tex-mouse-day ()
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
357 "Make a buffer with LaTeX commands for the day mouse is on."
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
358 (interactive)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
359 (save-excursion
14951
15ab8e95a50a (calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14915
diff changeset
360 (calendar-mouse-goto-date (calendar-event-to-date))
13194
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
361 (cal-tex-cursor-day nil)))
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
362
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
363 (defun cal-tex-mouse-week ()
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
364 "One page calendar for week indicated by cursor.
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
365 Holidays are included if `cal-tex-holidays' is t."
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
366 (interactive)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
367 (save-excursion
14951
15ab8e95a50a (calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14915
diff changeset
368 (calendar-mouse-goto-date (calendar-event-to-date))
13194
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
369 (cal-tex-cursor-week nil)))
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
370
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
371 (defun cal-tex-mouse-week2 ()
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
372 "Make a buffer with LaTeX commands for the week cursor is on.
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
373 The printed output will be on two pages."
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
374 (interactive)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
375 (save-excursion
14951
15ab8e95a50a (calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14915
diff changeset
376 (calendar-mouse-goto-date (calendar-event-to-date))
13194
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
377 (cal-tex-cursor-week2 nil)))
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
378
13689
a04244ec8530 Repair function names from rms error in modifying!
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13285
diff changeset
379 (defun cal-tex-mouse-week-iso ()
13194
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
380 "One page calendar for week indicated by cursor.
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
381 Holidays are included if `cal-tex-holidays' is t."
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
382 (interactive)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
383 (save-excursion
14951
15ab8e95a50a (calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14915
diff changeset
384 (calendar-mouse-goto-date (calendar-event-to-date))
13689
a04244ec8530 Repair function names from rms error in modifying!
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13285
diff changeset
385 (cal-tex-cursor-week-iso nil)))
13194
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
386
13689
a04244ec8530 Repair function names from rms error in modifying!
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13285
diff changeset
387 (defun cal-tex-mouse-week-monday ()
13194
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
388 "One page calendar for week indicated by cursor."
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
389 (interactive)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
390 (save-excursion
14951
15ab8e95a50a (calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14915
diff changeset
391 (calendar-mouse-goto-date (calendar-event-to-date))
13689
a04244ec8530 Repair function names from rms error in modifying!
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13285
diff changeset
392 (cal-tex-cursor-week-monday nil)))
13194
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
393
19975
927a8710de05 (cal-tex-mouse-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19950
diff changeset
394 (defun cal-tex-mouse-filofax-daily ()
927a8710de05 (cal-tex-mouse-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19950
diff changeset
395 "Day-per-page Filofax calendar for week indicated by cursor."
927a8710de05 (cal-tex-mouse-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19950
diff changeset
396 (interactive)
927a8710de05 (cal-tex-mouse-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19950
diff changeset
397 (save-excursion
927a8710de05 (cal-tex-mouse-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19950
diff changeset
398 (calendar-mouse-goto-date (calendar-event-to-date))
927a8710de05 (cal-tex-mouse-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19950
diff changeset
399 (cal-tex-cursor-filofax-daily nil)))
927a8710de05 (cal-tex-mouse-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19950
diff changeset
400
13690
8a3ceaf9bfee More repairs of wrong function names in menus!
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13689
diff changeset
401 (defun cal-tex-mouse-filofax-2week ()
13194
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
402 "One page Filofax calendar for week indicated by cursor."
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
403 (interactive)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
404 (save-excursion
14951
15ab8e95a50a (calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14915
diff changeset
405 (calendar-mouse-goto-date (calendar-event-to-date))
13690
8a3ceaf9bfee More repairs of wrong function names in menus!
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13689
diff changeset
406 (cal-tex-cursor-filofax-2week nil)))
13194
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
407
13690
8a3ceaf9bfee More repairs of wrong function names in menus!
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13689
diff changeset
408 (defun cal-tex-mouse-filofax-week ()
13194
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
409 "Two page Filofax calendar for week indicated by cursor."
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
410 (interactive)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
411 (save-excursion
14951
15ab8e95a50a (calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14915
diff changeset
412 (calendar-mouse-goto-date (calendar-event-to-date))
13690
8a3ceaf9bfee More repairs of wrong function names in menus!
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13689
diff changeset
413 (cal-tex-cursor-filofax-week nil)))
13194
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
414
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
415 (defun cal-tex-mouse-month ()
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
416 "Make a buffer with LaTeX commands for the month cursor is on.
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
417 Calendar is condensed onto one page."
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
418 (interactive)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
419 (save-excursion
14951
15ab8e95a50a (calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14915
diff changeset
420 (calendar-mouse-goto-date (calendar-event-to-date))
13194
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
421 (cal-tex-cursor-month nil)))
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
422
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
423 (defun cal-tex-mouse-month-landscape ()
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
424 "Make a buffer with LaTeX commands for the month cursor is on.
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
425 The output is in landscape format, one month to a page."
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
426 (interactive)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
427 (save-excursion
14951
15ab8e95a50a (calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14915
diff changeset
428 (calendar-mouse-goto-date (calendar-event-to-date))
13194
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
429 (cal-tex-cursor-month-landscape nil)))
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
430
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
431 (defun cal-tex-mouse-year ()
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
432 "Make a buffer with LaTeX commands for the year cursor is on."
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
433 (interactive)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
434 (save-excursion
14951
15ab8e95a50a (calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14915
diff changeset
435 (calendar-mouse-goto-date (calendar-event-to-date))
13194
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
436 (cal-tex-cursor-year nil)))
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
437
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
438 (defun cal-tex-mouse-filofax-year ()
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
439 "Make a buffer with LaTeX commands for Filofax calendar of year cursor is on."
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
440 (interactive)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
441 (save-excursion
14951
15ab8e95a50a (calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14915
diff changeset
442 (calendar-mouse-goto-date (calendar-event-to-date))
13194
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
443 (cal-tex-cursor-filofax-year nil)))
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
444
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
445 (defun cal-tex-mouse-year-landscape ()
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
446 "Make a buffer with LaTeX commands for the year cursor is on."
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
447 (interactive)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
448 (save-excursion
14951
15ab8e95a50a (calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14915
diff changeset
449 (calendar-mouse-goto-date (calendar-event-to-date))
13194
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
450 (cal-tex-cursor-year-landscape nil)))
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
451
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
452 (defun calendar-mouse-print-dates ()
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
453 "Pop up menu of equivalent dates to mouse selected date."
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
454 (interactive)
13047
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
455 (let ((date (calendar-event-to-date))
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
456 (selection
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
457 (x-popup-menu
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
458 event
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
459 (list
13876
16decb4ae75f Put date on top of other-calendars menu.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13690
diff changeset
460 (concat (calendar-date-string date) " (Gregorian)")
13047
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
461 (append
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
462 (list
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
463 (concat (calendar-date-string date) " (Gregorian)")
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
464 (list (calendar-day-of-year-string date))
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
465 (list (format "ISO date: %s" (calendar-iso-date-string date)))
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
466 (list (format "Julian date: %s"
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
467 (calendar-julian-date-string date)))
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
468 (list
15068
47ef84d3738d Spelling fix.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 14951
diff changeset
469 (format "Astronomical (Julian) day number (at noon UTC): %s.0"
13047
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
470 (calendar-astro-date-string date)))
20423
f2a0f6498003 Add fixed date (RD) to menu of other dates.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 19975
diff changeset
471 (list
20424
bfc68d8546f3 Minor repair of previous change.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20423
diff changeset
472 (format "Fixed (RD) date: %s"
20423
f2a0f6498003 Add fixed date (RD) to menu of other dates.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 19975
diff changeset
473 (calendar-absolute-from-gregorian date)))
13047
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
474 (list (format "Hebrew date (before sunset): %s"
14915
5a4b28f19b75 Add references to Persian calendar.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 14169
diff changeset
475 (calendar-hebrew-date-string date)))
5a4b28f19b75 Add references to Persian calendar.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 14169
diff changeset
476 (list (format "Persian date: %s"
5a4b28f19b75 Add references to Persian calendar.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 14169
diff changeset
477 (calendar-persian-date-string date))))
13047
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
478 (let ((i (calendar-islamic-date-string date)))
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
479 (if (not (string-equal i ""))
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
480 (list (list (format "Islamic date (before sunset): %s" i)))))
13285
7ccba52e1e3e Fix menu for Chinese calendar.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13194
diff changeset
481 (list
7ccba52e1e3e Fix menu for Chinese calendar.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13194
diff changeset
482 (list (format "Chinese date: %s"
7ccba52e1e3e Fix menu for Chinese calendar.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13194
diff changeset
483 (calendar-chinese-date-string date))))
7ccba52e1e3e Fix menu for Chinese calendar.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13194
diff changeset
484 ; (list '("Chinese date (select to echo Chinese date)"
7ccba52e1e3e Fix menu for Chinese calendar.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13194
diff changeset
485 ; . calendar-mouse-chinese-date))
13047
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
486 (let ((c (calendar-coptic-date-string date)))
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
487 (if (not (string-equal c ""))
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
488 (list (list (format "Coptic date: %s" c)))))
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
489 (let ((e (calendar-ethiopic-date-string date)))
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
490 (if (not (string-equal e ""))
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
491 (list (list (format "Ethiopic date: %s" e)))))
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
492 (let ((f (calendar-french-date-string date)))
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
493 (if (not (string-equal f ""))
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
494 (list (list (format "French Revolutionary date: %s" f)))))
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
495 (list
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
496 (list
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
497 (format "Mayan date: %s"
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
498 (calendar-mayan-date-string date)))))))))
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
499 (and selection (call-interactively selection))))
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
500
13063
30ee606ce331 Fix display of Chinese date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13047
diff changeset
501 (defun calendar-mouse-chinese-date ()
30ee606ce331 Fix display of Chinese date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13047
diff changeset
502 "Show Chinese equivalent for mouse-selected date."
30ee606ce331 Fix display of Chinese date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13047
diff changeset
503 (interactive)
30ee606ce331 Fix display of Chinese date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13047
diff changeset
504 (save-excursion
14951
15ab8e95a50a (calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14915
diff changeset
505 (calendar-mouse-goto-date (calendar-event-to-date))
13063
30ee606ce331 Fix display of Chinese date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13047
diff changeset
506 (calendar-print-chinese-date)))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
507
14951
15ab8e95a50a (calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14915
diff changeset
508 (defun calendar-mouse-goto-date (date)
15ab8e95a50a (calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14915
diff changeset
509 (set-buffer (window-buffer (posn-window (event-start last-input-event))))
15ab8e95a50a (calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14915
diff changeset
510 (calendar-goto-date date))
15ab8e95a50a (calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14915
diff changeset
511
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
512 (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
513 "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
514 (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
515 (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
516 (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
517 (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
518 event
13690
8a3ceaf9bfee More repairs of wrong function names in menus!
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13689
diff changeset
519 (list (calendar-date-string date t nil)
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
520 (list
13690
8a3ceaf9bfee More repairs of wrong function names in menus!
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13689
diff changeset
521 ""
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
522 '("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
523 '("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
524 '("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
525 '("Other calendars" . calendar-mouse-print-dates)
13194
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
526 '("Prepare LaTeX buffer" . calendar-mouse-cal-tex-menu)
9766
71c37f31a02d Bind new function to mouse.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 9734
diff changeset
527 '("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
528 '("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
529 '("Other diary file entries"
71c37f31a02d Bind new function to mouse.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 9734
diff changeset
530 . calendar-mouse-view-other-diary-entries)
71c37f31a02d Bind new function to mouse.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 9734
diff changeset
531 )))))
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
532 (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
533
13194
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
534 (defun calendar-mouse-cal-tex-menu (event)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
535 "Pop up submenu for Mouse-2 for cal-tex commands for selected date in the calendar window."
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
536 (interactive "e")
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
537 (let* ((selection
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
538 (x-popup-menu
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
539 event
13690
8a3ceaf9bfee More repairs of wrong function names in menus!
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13689
diff changeset
540 (list (calendar-date-string date t nil)
13194
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
541 (list
13690
8a3ceaf9bfee More repairs of wrong function names in menus!
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13689
diff changeset
542 ""
13194
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
543 '("Daily (1 page)" . cal-tex-mouse-day)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
544 '("Weekly (1 page)" . cal-tex-mouse-week)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
545 '("Weekly (2 pages)" . cal-tex-mouse-week2)
13690
8a3ceaf9bfee More repairs of wrong function names in menus!
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13689
diff changeset
546 '("Weekly (other style; 1 page)" . cal-tex-mouse-week-iso)
8a3ceaf9bfee More repairs of wrong function names in menus!
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13689
diff changeset
547 '("Weekly (yet another style; 1 page)" .
8a3ceaf9bfee More repairs of wrong function names in menus!
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13689
diff changeset
548 cal-tex-mouse-week-monday)
13194
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
549 '("Monthly" . cal-tex-mouse-month)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
550 '("Monthly (landscape)" . cal-tex-mouse-month-landscape)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
551 '("Yearly" . cal-tex-mouse-year)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
552 '("Yearly (landscape)" . cal-tex-mouse-year-landscape)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
553 '("Filofax styles" . cal-tex-mouse-filofax)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
554 )))))
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
555 (and selection (call-interactively selection))))
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
556
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
557 (defun cal-tex-mouse-filofax (event)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
558 "Pop up sub-submenu for Mouse-2 for Filofax cal-tex commands for selected date."
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
559 (interactive "e")
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
560 (let* ((selection
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
561 (x-popup-menu
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
562 event
13690
8a3ceaf9bfee More repairs of wrong function names in menus!
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13689
diff changeset
563 (list (calendar-date-string date t nil)
13194
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
564 (list
13690
8a3ceaf9bfee More repairs of wrong function names in menus!
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13689
diff changeset
565 ""
19975
927a8710de05 (cal-tex-mouse-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19950
diff changeset
566 '("Filofax Daily (one-day-per-page)" .
927a8710de05 (cal-tex-mouse-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19950
diff changeset
567 cal-tex-mouse-filofax-daily)
13690
8a3ceaf9bfee More repairs of wrong function names in menus!
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13689
diff changeset
568 '("Filofax Weekly (2-weeks-at-a-glance)" .
8a3ceaf9bfee More repairs of wrong function names in menus!
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13689
diff changeset
569 cal-tex-mouse-filofax-2week)
8a3ceaf9bfee More repairs of wrong function names in menus!
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13689
diff changeset
570 '("Filofax Weekly (week-at-a-glance)" .
8a3ceaf9bfee More repairs of wrong function names in menus!
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13689
diff changeset
571 cal-tex-mouse-filofax-week)
13194
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
572 '("Filofax Yearly" . cal-tex-mouse-filofax-year)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
573 )))))
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
574 (and selection (call-interactively selection))))
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
575
7478
57cfbcfdf92a Rewrite mouse-3 menu as a keymap.
Richard M. Stallman <rms@gnu.org>
parents: 7442
diff changeset
576 (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
577 '("Exit calendar" . exit-calendar))
57cfbcfdf92a Rewrite mouse-3 menu as a keymap.
Richard M. Stallman <rms@gnu.org>
parents: 7442
diff changeset
578 (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
579 '("Show diary" . show-all-diary-entries))
57cfbcfdf92a Rewrite mouse-3 menu as a keymap.
Richard M. Stallman <rms@gnu.org>
parents: 7442
diff changeset
580 (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
581 '("Lunar phases" . calendar-phases-of-moon))
57cfbcfdf92a Rewrite mouse-3 menu as a keymap.
Richard M. Stallman <rms@gnu.org>
parents: 7442
diff changeset
582 (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
583 '("Unmark" . calendar-unmark))
57cfbcfdf92a Rewrite mouse-3 menu as a keymap.
Richard M. Stallman <rms@gnu.org>
parents: 7442
diff changeset
584 (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
585 '("Mark holidays" . mark-calendar-holidays))
57cfbcfdf92a Rewrite mouse-3 menu as a keymap.
Richard M. Stallman <rms@gnu.org>
parents: 7442
diff changeset
586 (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
587 '("List holidays" . list-calendar-holidays))
57cfbcfdf92a Rewrite mouse-3 menu as a keymap.
Richard M. Stallman <rms@gnu.org>
parents: 7442
diff changeset
588 (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
589 '("Mark diary entries" . mark-diary-entries))
57cfbcfdf92a Rewrite mouse-3 menu as a keymap.
Richard M. Stallman <rms@gnu.org>
parents: 7442
diff changeset
590 (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
591 '("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
592 (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
593 '("Scroll forward" . scroll-calendar-left-three-months))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
594
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
595 (run-hooks 'cal-menu-load-hook)
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
596
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
597 (provide 'cal-menu)
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
598
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
599 ;;; cal-menu.el ends here