annotate lisp/calendar/cal-menu.el @ 70083:61d8c79b3c79

(describe_map): Make "shadowed" warning more verbose.
author Richard M. Stallman <rms@gnu.org>
date Tue, 18 Apr 2006 20:58:59 +0000
parents 94d20d05817b
children d38bfc1692a5 5b7d410e31f9
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
68368
94d20d05817b Avoid macros from calendar.el so as to break
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 67464
diff changeset
3 ;; Copyright (C) 1994, 1995, 2001, 2002, 2003, 2004, 2005, 2006
67464
757a5ae466cd Update copyright info.
Glenn Morris <rgm@gnu.org>
parents: 66617
diff changeset
4 ;; Free Software Foundation, Inc.
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
6 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
7 ;; Lara Rios <lrios@coewl.cen.uiuc.edu>
65919
5c09efcfc1d9 Update maintainer email address.
Glenn Morris <rgm@gnu.org>
parents: 65876
diff changeset
8 ;; Maintainer: Glenn Morris <rgm@gnu.org>
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
9 ;; Keywords: calendar
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
10 ;; Human-Keywords: calendar, popup menus, menu bar
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
11
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
12 ;; This file is part of GNU Emacs.
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
13
6736
3e1323443b1a Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents: 5701
diff changeset
14 ;; 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
15 ;; 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
16 ;; 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
17 ;; any later version.
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
18
6736
3e1323443b1a Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents: 5701
diff changeset
19 ;; 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
20 ;; 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
21 ;; 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
22 ;; 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
23
3e1323443b1a Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents: 5701
diff changeset
24 ;; 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
25 ;; along with GNU Emacs; see the file COPYING. If not, write to the
64085
18a818a2ee7c Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 62577
diff changeset
26 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18a818a2ee7c Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 62577
diff changeset
27 ;; Boston, MA 02110-1301, USA.
5701
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 ;;; Commentary:
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
30
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
31 ;; This collection of functions implements menu bar and popup menu support for
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
32 ;; calendar.el.
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
33
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
34 ;; Comments, corrections, and improvements should be sent to
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
35 ;; Edward M. Reingold Department of Computer Science
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
36 ;; (217) 333-6733 University of Illinois at Urbana-Champaign
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
37 ;; reingold@cs.uiuc.edu 1304 West Springfield Avenue
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
38 ;; Urbana, Illinois 61801
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
39
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
40 ;;; Code:
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
41
52116
3132ffb5a7ab (displayed-month, displayed-year): Define for compiler.
Glenn Morris <rgm@gnu.org>
parents: 50465
diff changeset
42 (defvar displayed-month)
3132ffb5a7ab (displayed-month, displayed-year): Define for compiler.
Glenn Morris <rgm@gnu.org>
parents: 50465
diff changeset
43 (defvar displayed-year)
3132ffb5a7ab (displayed-month, displayed-year): Define for compiler.
Glenn Morris <rgm@gnu.org>
parents: 50465
diff changeset
44
68368
94d20d05817b Avoid macros from calendar.el so as to break
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 67464
diff changeset
45 ;; Don't require calendar because calendar requires us.
94d20d05817b Avoid macros from calendar.el so as to break
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 67464
diff changeset
46 ;; (eval-when-compile (require 'calendar))
94d20d05817b Avoid macros from calendar.el so as to break
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 67464
diff changeset
47 (defvar calendar-mode-map)
19892
b3d4cde6e4c3 Require calendar.el.
Richard M. Stallman <rms@gnu.org>
parents: 17667
diff changeset
48
9999
8187800943e7 Get rid of edit menu.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 9766
diff changeset
49 (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
50 (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
51
7478
57cfbcfdf92a Rewrite mouse-3 menu as a keymap.
Richard M. Stallman <rms@gnu.org>
parents: 7442
diff changeset
52 (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
53 (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
54
57cfbcfdf92a Rewrite mouse-3 menu as a keymap.
Richard M. Stallman <rms@gnu.org>
parents: 7442
diff changeset
55 (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
56 (define-key calendar-mode-map [down-mouse-3] calendar-mouse-3-map)
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
57
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 (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
59 (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
60
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
61 (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
62 '("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
63
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
64 (define-key calendar-mode-map [menu-bar diary]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
65 (cons "Diary" (make-sparse-keymap "Diary")))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
66
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
67 (define-key calendar-mode-map [menu-bar diary heb]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
68 '("Insert Hebrew" . calendar-mouse-insert-hebrew-diary-entry))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
69 (define-key calendar-mode-map [menu-bar diary isl]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
70 '("Insert Islamic" . calendar-mouse-insert-islamic-diary-entry))
55431
b278cb498cc8 2004-05-08 John Wiegley <johnw@newartisans.com>
John Wiegley <johnw@newartisans.com>
parents: 52401
diff changeset
71 (define-key calendar-mode-map [menu-bar diary baha]
b278cb498cc8 2004-05-08 John Wiegley <johnw@newartisans.com>
John Wiegley <johnw@newartisans.com>
parents: 52401
diff changeset
72 '("Insert Baha'i" . calendar-mouse-insert-bahai-diary-entry))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
73 (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
74 '("Insert Cyclic" . insert-cyclic-diary-entry))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
75 (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
76 '("Insert Block" . insert-block-diary-entry))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
77 (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
78 '("Insert Anniversary" . insert-anniversary-diary-entry))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
79 (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
80 '("Insert Yearly" . insert-yearly-diary-entry))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
81 (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
82 '("Insert Monthly" . insert-monthly-diary-entry))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
83 (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
84 '("Insert Weekly" . insert-weekly-diary-entry))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
85 (define-key calendar-mode-map [menu-bar diary ent]
43195
b5177d0b2c9f (calendar-mode-map): Change the menu item's name to "Insert Diary Entry".
Eli Zaretskii <eliz@gnu.org>
parents: 39524
diff changeset
86 '("Insert Diary Entry" . insert-diary-entry))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
87 (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
88 '("Show All" . show-all-diary-entries))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
89 (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
90 '("Mark All" . mark-diary-entries))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
91 (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
92 '("Cursor Date" . view-diary-entries))
9766
71c37f31a02d Bind new function to mouse.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 9734
diff changeset
93 (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
94 '("Other File" . view-other-diary-entries))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
95
22035
887dbe664b45 (calendar-mode-map): Rename `holidays' menu to `Holidays'.
Richard M. Stallman <rms@gnu.org>
parents: 22031
diff changeset
96 (define-key calendar-mode-map [menu-bar Holidays]
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
97 (cons "Holidays" (make-sparse-keymap "Holidays")))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
98
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
99 (define-key calendar-mode-map [menu-bar goto]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
100 (cons "Goto" (make-sparse-keymap "Goto")))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
101
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
102 (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
103 '("French Date" . calendar-goto-french-date))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
104 (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
105 (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
106 (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
107 '("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
108 (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
109 '("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
110 (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
111 '("Chinese Date" . calendar-goto-chinese-date))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
112 (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
113 '("Julian Date" . calendar-goto-julian-date))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
114 (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
115 '("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
116 (define-key calendar-mode-map [menu-bar goto persian]
55431
b278cb498cc8 2004-05-08 John Wiegley <johnw@newartisans.com>
John Wiegley <johnw@newartisans.com>
parents: 52401
diff changeset
117 '("Baha'i Date" . calendar-goto-bahai-date))
b278cb498cc8 2004-05-08 John Wiegley <johnw@newartisans.com>
John Wiegley <johnw@newartisans.com>
parents: 52401
diff changeset
118 (define-key calendar-mode-map [menu-bar goto persian]
14915
5a4b28f19b75 Add references to Persian calendar.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 14169
diff changeset
119 '("Persian Date" . calendar-goto-persian-date))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
120 (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
121 '("Hebrew Date" . calendar-goto-hebrew-date))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
122 (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
123 '("Astronomical Date" . calendar-goto-astro-day-number))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
124 (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
125 '("ISO Date" . calendar-goto-iso-date))
57325
670acab99124 Update copyright and maintainer.
Glenn Morris <rgm@gnu.org>
parents: 55431
diff changeset
126 (define-key calendar-mode-map [menu-bar goto iso-week]
670acab99124 Update copyright and maintainer.
Glenn Morris <rgm@gnu.org>
parents: 55431
diff changeset
127 '("ISO Week" . calendar-goto-iso-week))
52230
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
128 (define-key calendar-mode-map [menu-bar goto day-of-year]
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
129 '("Day of Year" . calendar-goto-day-of-year))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
130 (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
131 '("Other Date" . calendar-goto-date))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
132 (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
133 '("End of Year" . calendar-end-of-year))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
134 (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
135 '("Beginning of Year" . calendar-beginning-of-year))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
136 (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
137 '("End of Month" . calendar-end-of-month))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
138 (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
139 '("Beginning of Month" . calendar-beginning-of-month))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
140 (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
141 '("End of Week" . calendar-end-of-week))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
142 (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
143 '("Beginning of Week" . calendar-beginning-of-week))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
144 (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
145 '("Today" . calendar-goto-today))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
146
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
147
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
148 (define-key calendar-mode-map [menu-bar goto mayan prev-rnd]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
149 '("Previous Round" . calendar-previous-calendar-round-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
150 (define-key calendar-mode-map [menu-bar goto mayan nxt-rnd]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
151 '("Next Round" . calendar-next-calendar-round-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
152 (define-key calendar-mode-map [menu-bar goto mayan prev-haab]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
153 '("Previous Haab" . calendar-previous-haab-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
154 (define-key calendar-mode-map [menu-bar goto mayan next-haab]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
155 '("Next Haab" . calendar-next-haab-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
156 (define-key calendar-mode-map [menu-bar goto mayan prev-tzol]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
157 '("Previous Tzolkin" . calendar-previous-tzolkin-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
158 (define-key calendar-mode-map [menu-bar goto mayan next-tzol]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
159 '("Next Tzolkin" . calendar-next-tzolkin-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
160
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
161 (define-key calendar-mode-map [menu-bar scroll]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
162 (cons "Scroll" (make-sparse-keymap "Scroll")))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
163
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
164 (define-key calendar-mode-map [menu-bar scroll bk-12]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
165 '("Backward 1 Year" . "4\ev"))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
166 (define-key calendar-mode-map [menu-bar scroll bk-3]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
167 '("Backward 3 Months" . scroll-calendar-right-three-months))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
168 (define-key calendar-mode-map [menu-bar scroll bk-1]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
169 '("Backward 1 Month" . scroll-calendar-right))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
170 (define-key calendar-mode-map [menu-bar scroll fwd-12]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
171 '("Forward 1 Year" . "4\C-v"))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
172 (define-key calendar-mode-map [menu-bar scroll fwd-3]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
173 '("Forward 3 Months" . scroll-calendar-left-three-months))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
174 (define-key calendar-mode-map [menu-bar scroll fwd-1]
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
175 '("Forward 1 Month" . scroll-calendar-left))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
176
52230
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
177 (defun calendar-flatten (list)
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
178 "Flatten LIST eliminating sublists structure; result is a list of atoms.
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
179 This is the same as the preorder list of leaves in a rooted forest."
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
180 (if (atom list)
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
181 (list list)
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
182 (if (cdr list)
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
183 (append (calendar-flatten (car list)) (calendar-flatten (cdr list)))
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
184 (calendar-flatten (car list)))))
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
185
39524
291264d596e9 (cal-menu-x-popup-menu): New function,
Eli Zaretskii <eliz@gnu.org>
parents: 39133
diff changeset
186 (defun cal-menu-x-popup-menu (position menu)
291264d596e9 (cal-menu-x-popup-menu): New function,
Eli Zaretskii <eliz@gnu.org>
parents: 39133
diff changeset
187 "Like `x-popup-menu', but prints an error message if popup menus are
291264d596e9 (cal-menu-x-popup-menu): New function,
Eli Zaretskii <eliz@gnu.org>
parents: 39133
diff changeset
188 not available."
291264d596e9 (cal-menu-x-popup-menu): New function,
Eli Zaretskii <eliz@gnu.org>
parents: 39133
diff changeset
189 (if (display-popup-menus-p)
291264d596e9 (cal-menu-x-popup-menu): New function,
Eli Zaretskii <eliz@gnu.org>
parents: 39133
diff changeset
190 (x-popup-menu position menu)
45058
5413ef3a62a3 (cal-menu-x-popup-menu): Fix argument of error call.
Pavel Janík <Pavel@Janik.cz>
parents: 43195
diff changeset
191 (error "Popup menus are not available on this system")))
39524
291264d596e9 (cal-menu-x-popup-menu): New function,
Eli Zaretskii <eliz@gnu.org>
parents: 39133
diff changeset
192
17667
fd527e9aa377 (cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents: 17553
diff changeset
193 (defun cal-menu-list-holidays-year ()
fd527e9aa377 (cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents: 17553
diff changeset
194 "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
195 (interactive)
fd527e9aa377 (cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents: 17553
diff changeset
196 (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
197 (list-holidays year year)))
fd527e9aa377 (cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents: 17553
diff changeset
198
fd527e9aa377 (cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents: 17553
diff changeset
199 (defun cal-menu-list-holidays-following-year ()
fd527e9aa377 (cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents: 17553
diff changeset
200 "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
201 (interactive)
fd527e9aa377 (cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents: 17553
diff changeset
202 (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
203 (list-holidays year year)))
fd527e9aa377 (cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents: 17553
diff changeset
204
fd527e9aa377 (cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents: 17553
diff changeset
205 (defun cal-menu-list-holidays-previous-year ()
fd527e9aa377 (cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents: 17553
diff changeset
206 "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
207 (interactive)
fd527e9aa377 (cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents: 17553
diff changeset
208 (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
209 (list-holidays year year)))
fd527e9aa377 (cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents: 17553
diff changeset
210
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
211 (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
212 ;; 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
213 (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
214 (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
215 (let ((l))
68368
94d20d05817b Avoid macros from calendar.el so as to break
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 67464
diff changeset
216 ;; Show 11 years--5 before, 5 after year of middle month
94d20d05817b Avoid macros from calendar.el so as to break
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 67464
diff changeset
217 (dotimes (i 11)
94d20d05817b Avoid macros from calendar.el so as to break
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 67464
diff changeset
218 (let ((y (+ displayed-year -5 i)))
94d20d05817b Avoid macros from calendar.el so as to break
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 67464
diff changeset
219 (push (vector (format "For Year %s" y)
94d20d05817b Avoid macros from calendar.el so as to break
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 67464
diff changeset
220 (list (list 'lambda 'nil '(interactive)
94d20d05817b Avoid macros from calendar.el so as to break
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 67464
diff changeset
221 (list 'list-holidays y y)))
94d20d05817b Avoid macros from calendar.el so as to break
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 67464
diff changeset
222 t)
94d20d05817b Avoid macros from calendar.el so as to break
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 67464
diff changeset
223 l)))
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 (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
225 (cons ["Unmark Calendar" calendar-unmark t]
62577
ffc19ed45d7f (cal-menu-update): Add separator as a string so that tmm doesn't create
Eli Zaretskii <eliz@gnu.org>
parents: 60980
diff changeset
226 (cons "--" l))))
50465
6fc90e779714 (cal-menu-update): Use easy-menu-create-menu rather than easy-menu-change.
Richard M. Stallman <rms@gnu.org>
parents: 45058
diff changeset
227 (define-key calendar-mode-map [menu-bar Holidays]
6fc90e779714 (cal-menu-update): Use easy-menu-create-menu rather than easy-menu-change.
Richard M. Stallman <rms@gnu.org>
parents: 45058
diff changeset
228 (cons "Holidays" (easy-menu-create-menu "Holidays" (nreverse l))))
22365
042d83ae4200 Fix menu separators.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22036
diff changeset
229 (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
230 '("--"))
22035
887dbe664b45 (calendar-mode-map): Rename `holidays' menu to `Holidays'.
Richard M. Stallman <rms@gnu.org>
parents: 22031
diff changeset
231 (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
232 `(,(format "For Today (%s)"
879df83433a1 Minor fix to earlier changes today.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22027
diff changeset
233 (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
234 . 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
235 (let ((title
68368
94d20d05817b Avoid macros from calendar.el so as to break
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 67464
diff changeset
236 (let ((my1 (calendar-increment-month -1))
94d20d05817b Avoid macros from calendar.el so as to break
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 67464
diff changeset
237 (my2 (calendar-increment-month 1)))
94d20d05817b Avoid macros from calendar.el so as to break
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 67464
diff changeset
238 (if (= (cdr my1) (cdr my2))
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
239 (format "%s-%s, %d"
68368
94d20d05817b Avoid macros from calendar.el so as to break
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 67464
diff changeset
240 (calendar-month-name (car my1) 'abbrev)
94d20d05817b Avoid macros from calendar.el so as to break
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 67464
diff changeset
241 (calendar-month-name (car my2) 'abbrev)
94d20d05817b Avoid macros from calendar.el so as to break
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 67464
diff changeset
242 (cdr my2))
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
243 (format "%s, %d-%s, %d"
68368
94d20d05817b Avoid macros from calendar.el so as to break
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 67464
diff changeset
244 (calendar-month-name (car my1) 'abbrev)
94d20d05817b Avoid macros from calendar.el so as to break
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 67464
diff changeset
245 (cdr my1)
94d20d05817b Avoid macros from calendar.el so as to break
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 67464
diff changeset
246 (calendar-month-name (car my2) 'abbrev)
94d20d05817b Avoid macros from calendar.el so as to break
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 67464
diff changeset
247 (cdr my2))))))
22035
887dbe664b45 (calendar-mode-map): Rename `holidays' menu to `Holidays'.
Richard M. Stallman <rms@gnu.org>
parents: 22031
diff changeset
248 (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
249 `(,(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
250 . 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
251 (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
252 (if date
22035
887dbe664b45 (calendar-mode-map): Rename `holidays' menu to `Holidays'.
Richard M. Stallman <rms@gnu.org>
parents: 22031
diff changeset
253 (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
254 `(,(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
255 (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
256 . 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
257 ;; 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
258 (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
259
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
260 (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
261 "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
262 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
263 ERROR is t, otherwise just returns nil."
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
264 (save-excursion
14951
15ab8e95a50a (calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14915
diff changeset
265 (set-buffer (window-buffer (posn-window (event-start last-input-event))))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
266 (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
267 (calendar-cursor-to-date error)))
5701
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-insert-hebrew-diary-entry (event)
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
270 "Pop up menu to insert a Hebrew-date diary entry."
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
271 (interactive "e")
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
272 (let ((hebrew-selection
39524
291264d596e9 (cal-menu-x-popup-menu): New function,
Eli Zaretskii <eliz@gnu.org>
parents: 39133
diff changeset
273 (cal-menu-x-popup-menu
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
274 event
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
275 (list "Hebrew insert menu"
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
276 (list (calendar-hebrew-date-string (calendar-cursor-to-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
277 '("One time" . insert-hebrew-diary-entry)
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
278 '("Monthly" . insert-monthly-hebrew-diary-entry)
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
279 '("Yearly" . insert-yearly-hebrew-diary-entry))))))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
280 (and hebrew-selection (call-interactively hebrew-selection))))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
281
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
282 (defun calendar-mouse-insert-islamic-diary-entry (event)
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
283 "Pop up menu to insert an Islamic-date diary entry."
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
284 (interactive "e")
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
285 (let ((islamic-selection
39524
291264d596e9 (cal-menu-x-popup-menu): New function,
Eli Zaretskii <eliz@gnu.org>
parents: 39133
diff changeset
286 (cal-menu-x-popup-menu
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
287 event
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
288 (list "Islamic insert menu"
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
289 (list (calendar-islamic-date-string (calendar-cursor-to-date))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
290 '("One time" . insert-islamic-diary-entry)
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
291 '("Monthly" . insert-monthly-islamic-diary-entry)
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
292 '("Yearly" . insert-yearly-islamic-diary-entry))))))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
293 (and islamic-selection (call-interactively islamic-selection))))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
294
55431
b278cb498cc8 2004-05-08 John Wiegley <johnw@newartisans.com>
John Wiegley <johnw@newartisans.com>
parents: 52401
diff changeset
295 (defun calendar-mouse-insert-bahai-diary-entry (event)
b278cb498cc8 2004-05-08 John Wiegley <johnw@newartisans.com>
John Wiegley <johnw@newartisans.com>
parents: 52401
diff changeset
296 "Pop up menu to insert an Baha'i-date diary entry."
b278cb498cc8 2004-05-08 John Wiegley <johnw@newartisans.com>
John Wiegley <johnw@newartisans.com>
parents: 52401
diff changeset
297 (interactive "e")
b278cb498cc8 2004-05-08 John Wiegley <johnw@newartisans.com>
John Wiegley <johnw@newartisans.com>
parents: 52401
diff changeset
298 (let ((bahai-selection
b278cb498cc8 2004-05-08 John Wiegley <johnw@newartisans.com>
John Wiegley <johnw@newartisans.com>
parents: 52401
diff changeset
299 (x-popup-menu
b278cb498cc8 2004-05-08 John Wiegley <johnw@newartisans.com>
John Wiegley <johnw@newartisans.com>
parents: 52401
diff changeset
300 event
b278cb498cc8 2004-05-08 John Wiegley <johnw@newartisans.com>
John Wiegley <johnw@newartisans.com>
parents: 52401
diff changeset
301 (list "Baha'i insert menu"
b278cb498cc8 2004-05-08 John Wiegley <johnw@newartisans.com>
John Wiegley <johnw@newartisans.com>
parents: 52401
diff changeset
302 (list (calendar-bahai-date-string (calendar-cursor-to-date))
b278cb498cc8 2004-05-08 John Wiegley <johnw@newartisans.com>
John Wiegley <johnw@newartisans.com>
parents: 52401
diff changeset
303 '("One time" . insert-bahai-diary-entry)
b278cb498cc8 2004-05-08 John Wiegley <johnw@newartisans.com>
John Wiegley <johnw@newartisans.com>
parents: 52401
diff changeset
304 '("Monthly" . insert-monthly-bahai-diary-entry)
b278cb498cc8 2004-05-08 John Wiegley <johnw@newartisans.com>
John Wiegley <johnw@newartisans.com>
parents: 52401
diff changeset
305 '("Yearly" . insert-yearly-bahai-diary-entry))))))
b278cb498cc8 2004-05-08 John Wiegley <johnw@newartisans.com>
John Wiegley <johnw@newartisans.com>
parents: 52401
diff changeset
306 (and bahai-selection (call-interactively bahai-selection))))
b278cb498cc8 2004-05-08 John Wiegley <johnw@newartisans.com>
John Wiegley <johnw@newartisans.com>
parents: 52401
diff changeset
307
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
308 (defun calendar-mouse-sunrise/sunset ()
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
309 "Show sunrise/sunset times for mouse-selected date."
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
310 (interactive)
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
311 (save-excursion
14951
15ab8e95a50a (calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14915
diff changeset
312 (calendar-mouse-goto-date (calendar-event-to-date))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
313 (calendar-sunrise-sunset)))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
314
22031
879df83433a1 Minor fix to earlier changes today.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22027
diff changeset
315 (defun cal-menu-today-holidays ()
879df83433a1 Minor fix to earlier changes today.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22027
diff changeset
316 "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
317 (interactive)
879df83433a1 Minor fix to earlier changes today.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22027
diff changeset
318 (save-excursion
879df83433a1 Minor fix to earlier changes today.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22027
diff changeset
319 (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
320 (calendar-cursor-holidays)))
879df83433a1 Minor fix to earlier changes today.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22027
diff changeset
321
65510
24f7082aa7af Don't require easymenu, since we don't use it.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 65145
diff changeset
322 (autoload 'check-calendar-holidays "holidays")
24f7082aa7af Don't require easymenu, since we don't use it.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 65145
diff changeset
323 (autoload 'diary-list-entries "diary-lib")
24f7082aa7af Don't require easymenu, since we don't use it.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 65145
diff changeset
324
66617
ed95f221960d (date, event): Don't declare as dynamic-var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 65919
diff changeset
325 (defun calendar-mouse-holidays (&optional event)
22413
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
326 "Pop up menu of holidays for mouse selected date."
66617
ed95f221960d (date, event): Don't declare as dynamic-var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 65919
diff changeset
327 (interactive "e")
22413
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
328 (let* ((date (calendar-event-to-date))
65510
24f7082aa7af Don't require easymenu, since we don't use it.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 65145
diff changeset
329 (l (mapcar 'list (check-calendar-holidays date)))
22413
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
330 (selection
39524
291264d596e9 (cal-menu-x-popup-menu): New function,
Eli Zaretskii <eliz@gnu.org>
parents: 39133
diff changeset
331 (cal-menu-x-popup-menu
22413
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
332 event
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
333 (list
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
334 (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
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 "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
337 (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
338 (and selection (call-interactively selection))))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
339
66617
ed95f221960d (date, event): Don't declare as dynamic-var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 65919
diff changeset
340 (defun calendar-mouse-view-diary-entries (&optional date diary event)
52230
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
341 "Pop up menu of diary entries for mouse-selected date.
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
342 Use optional DATE and alternative file DIARY.
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
343
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
344 Any holidays are shown if `holidays-in-diary-buffer' is t."
66617
ed95f221960d (date, event): Don't declare as dynamic-var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 65919
diff changeset
345 (interactive "i\ni\ne")
52230
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
346 (let* ((date (if date date (calendar-event-to-date)))
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
347 (diary-file (if diary diary diary-file))
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
348 (diary-list-include-blanks nil)
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
349 (diary-display-hook 'ignore)
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
350 (diary-entries
65510
24f7082aa7af Don't require easymenu, since we don't use it.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 65145
diff changeset
351 (mapcar (lambda (x) (split-string (car (cdr x)) "\^M\\|\n"))
65876
33868a8b76d1 (calendar-mouse-view-diary-entries): Use the new arg to diary-list-entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 65510
diff changeset
352 (diary-list-entries date 1 'list-only)))
52230
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
353 (holidays (if holidays-in-diary-buffer
65510
24f7082aa7af Don't require easymenu, since we don't use it.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 65145
diff changeset
354 (check-calendar-holidays date)))
52230
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
355 (title (concat "Diary entries "
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
356 (if diary (format "from %s " diary) "")
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
357 "for "
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
358 (calendar-date-string date)))
22413
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
359 (selection
39524
291264d596e9 (cal-menu-x-popup-menu): New function,
Eli Zaretskii <eliz@gnu.org>
parents: 39133
diff changeset
360 (cal-menu-x-popup-menu
22413
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
361 event
52230
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
362 (list title
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
363 (append
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
364 (list title)
65510
24f7082aa7af Don't require easymenu, since we don't use it.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 65145
diff changeset
365 (mapcar (lambda (x) (list (concat " " x))) holidays)
52230
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
366 (if holidays
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
367 (list "--shadow-etched-in" "--shadow-etched-in"))
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
368 (if diary-entries
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
369 (mapcar 'list (calendar-flatten diary-entries))
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
370 '("None")))))))
22413
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
371 (and selection (call-interactively selection))))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
372
9766
71c37f31a02d Bind new function to mouse.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 9734
diff changeset
373 (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
374 "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
375 (interactive)
52230
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
376 (calendar-mouse-view-diary-entries
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
377 (calendar-event-to-date)
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
378 (read-file-name "Enter diary file name: " default-directory nil t)))
9766
71c37f31a02d Bind new function to mouse.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 9734
diff changeset
379
9710
b5fb08fb2cb3 Put insertion of diary entry on daily menu.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 8308
diff changeset
380 (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
381 "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
382 (interactive)
b5fb08fb2cb3 Put insertion of diary entry on daily menu.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 8308
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))
9710
b5fb08fb2cb3 Put insertion of diary entry on daily menu.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 8308
diff changeset
385 (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
386
7412
f067e1a5ceb4 (calendar-mouse-set-mark): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7403
diff changeset
387 (defun calendar-mouse-set-mark ()
f067e1a5ceb4 (calendar-mouse-set-mark): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7403
diff changeset
388 "Mark the date under the cursor."
f067e1a5ceb4 (calendar-mouse-set-mark): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7403
diff changeset
389 (interactive)
f067e1a5ceb4 (calendar-mouse-set-mark): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7403
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))
7412
f067e1a5ceb4 (calendar-mouse-set-mark): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7403
diff changeset
392 (calendar-set-mark nil)))
f067e1a5ceb4 (calendar-mouse-set-mark): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7403
diff changeset
393
13194
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
394 (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
395 "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
396 (interactive)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
397 (save-excursion
14951
15ab8e95a50a (calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14915
diff changeset
398 (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
399 (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
400
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
401 (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
402 "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
403 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
404 (interactive)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
405 (save-excursion
14951
15ab8e95a50a (calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14915
diff changeset
406 (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
407 (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
408
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
409 (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
410 "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
411 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
412 (interactive)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
413 (save-excursion
14951
15ab8e95a50a (calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14915
diff changeset
414 (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
415 (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
416
13689
a04244ec8530 Repair function names from rms error in modifying!
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13285
diff changeset
417 (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
418 "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
419 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
420 (interactive)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
421 (save-excursion
14951
15ab8e95a50a (calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14915
diff changeset
422 (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
423 (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
424
13689
a04244ec8530 Repair function names from rms error in modifying!
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13285
diff changeset
425 (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
426 "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
427 (interactive)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
428 (save-excursion
14951
15ab8e95a50a (calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14915
diff changeset
429 (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
430 (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
431
19975
927a8710de05 (cal-tex-mouse-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19950
diff changeset
432 (defun cal-tex-mouse-filofax-daily ()
927a8710de05 (cal-tex-mouse-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19950
diff changeset
433 "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
434 (interactive)
927a8710de05 (cal-tex-mouse-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19950
diff changeset
435 (save-excursion
927a8710de05 (cal-tex-mouse-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19950
diff changeset
436 (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
437 (cal-tex-cursor-filofax-daily nil)))
927a8710de05 (cal-tex-mouse-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19950
diff changeset
438
13690
8a3ceaf9bfee More repairs of wrong function names in menus!
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13689
diff changeset
439 (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
440 "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
441 (interactive)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
442 (save-excursion
14951
15ab8e95a50a (calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14915
diff changeset
443 (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
444 (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
445
13690
8a3ceaf9bfee More repairs of wrong function names in menus!
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13689
diff changeset
446 (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
447 "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
448 (interactive)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
449 (save-excursion
14951
15ab8e95a50a (calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14915
diff changeset
450 (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
451 (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
452
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
453 (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
454 "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
455 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
456 (interactive)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
457 (save-excursion
14951
15ab8e95a50a (calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14915
diff changeset
458 (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
459 (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
460
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
461 (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
462 "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
463 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
464 (interactive)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
465 (save-excursion
14951
15ab8e95a50a (calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14915
diff changeset
466 (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
467 (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
468
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
469 (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
470 "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
471 (interactive)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
472 (save-excursion
14951
15ab8e95a50a (calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14915
diff changeset
473 (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
474 (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
475
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
476 (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
477 "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
478 (interactive)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
479 (save-excursion
14951
15ab8e95a50a (calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14915
diff changeset
480 (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
481 (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
482
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
483 (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
484 "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
485 (interactive)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
486 (save-excursion
14951
15ab8e95a50a (calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14915
diff changeset
487 (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
488 (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
489
66617
ed95f221960d (date, event): Don't declare as dynamic-var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 65919
diff changeset
490 (defun calendar-mouse-print-dates (&optional event)
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
491 "Pop up menu of equivalent dates to mouse selected date."
66617
ed95f221960d (date, event): Don't declare as dynamic-var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 65919
diff changeset
492 (interactive "e")
ed95f221960d (date, event): Don't declare as dynamic-var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 65919
diff changeset
493 (let* ((date (calendar-event-to-date))
13047
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
494 (selection
39524
291264d596e9 (cal-menu-x-popup-menu): New function,
Eli Zaretskii <eliz@gnu.org>
parents: 39133
diff changeset
495 (cal-menu-x-popup-menu
13047
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
496 event
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
497 (list
13876
16decb4ae75f Put date on top of other-calendars menu.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13690
diff changeset
498 (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
499 (append
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
500 (list
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
501 (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
502 (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
503 (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
504 (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
505 (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
506 (list
15068
47ef84d3738d Spelling fix.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 14951
diff changeset
507 (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
508 (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
509 (list
20424
bfc68d8546f3 Minor repair of previous change.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 20423
diff changeset
510 (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
511 (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
512 (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
513 (calendar-hebrew-date-string date)))
5a4b28f19b75 Add references to Persian calendar.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 14169
diff changeset
514 (list (format "Persian date: %s"
55431
b278cb498cc8 2004-05-08 John Wiegley <johnw@newartisans.com>
John Wiegley <johnw@newartisans.com>
parents: 52401
diff changeset
515 (calendar-persian-date-string date)))
b278cb498cc8 2004-05-08 John Wiegley <johnw@newartisans.com>
John Wiegley <johnw@newartisans.com>
parents: 52401
diff changeset
516 (list (format "Baha'i date (before sunset): %s"
b278cb498cc8 2004-05-08 John Wiegley <johnw@newartisans.com>
John Wiegley <johnw@newartisans.com>
parents: 52401
diff changeset
517 (calendar-bahai-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
518 (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
519 (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
520 (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
521 (list
7ccba52e1e3e Fix menu for Chinese calendar.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13194
diff changeset
522 (list (format "Chinese date: %s"
7ccba52e1e3e Fix menu for Chinese calendar.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13194
diff changeset
523 (calendar-chinese-date-string date))))
66617
ed95f221960d (date, event): Don't declare as dynamic-var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 65919
diff changeset
524 ;; (list '("Chinese date (select to echo Chinese date)"
ed95f221960d (date, event): Don't declare as dynamic-var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 65919
diff changeset
525 ;; . 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
526 (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
527 (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
528 (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
529 (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
530 (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
531 (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
532 (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
533 (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
534 (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
535 (list
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
536 (list
6c3c9645fbfd Added new calendars to menus and made minor fixes.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 12033
diff changeset
537 (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
538 (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
539 (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
540
13063
30ee606ce331 Fix display of Chinese date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13047
diff changeset
541 (defun calendar-mouse-chinese-date ()
30ee606ce331 Fix display of Chinese date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13047
diff changeset
542 "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
543 (interactive)
30ee606ce331 Fix display of Chinese date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13047
diff changeset
544 (save-excursion
14951
15ab8e95a50a (calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14915
diff changeset
545 (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
546 (calendar-print-chinese-date)))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
547
14951
15ab8e95a50a (calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14915
diff changeset
548 (defun calendar-mouse-goto-date (date)
15ab8e95a50a (calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14915
diff changeset
549 (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
550 (calendar-goto-date date))
15ab8e95a50a (calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14915
diff changeset
551
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
552 (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
553 "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
554 (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
555 (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
556 (selection
39524
291264d596e9 (cal-menu-x-popup-menu): New function,
Eli Zaretskii <eliz@gnu.org>
parents: 39133
diff changeset
557 (cal-menu-x-popup-menu
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
558 event
13690
8a3ceaf9bfee More repairs of wrong function names in menus!
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13689
diff changeset
559 (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
560 (list
13690
8a3ceaf9bfee More repairs of wrong function names in menus!
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13689
diff changeset
561 ""
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
562 '("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
563 '("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
564 '("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
565 '("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
566 '("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
567 '("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
568 '("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
569 '("Other diary file entries"
71c37f31a02d Bind new function to mouse.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 9734
diff changeset
570 . calendar-mouse-view-other-diary-entries)
71c37f31a02d Bind new function to mouse.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 9734
diff changeset
571 )))))
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
572 (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
573
13194
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
574 (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
575 "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
576 (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
577 (let* ((selection
39524
291264d596e9 (cal-menu-x-popup-menu): New function,
Eli Zaretskii <eliz@gnu.org>
parents: 39133
diff changeset
578 (cal-menu-x-popup-menu
13194
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
579 event
66617
ed95f221960d (date, event): Don't declare as dynamic-var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 65919
diff changeset
580 (list (calendar-date-string (calendar-event-to-date t) 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
581 (list
13690
8a3ceaf9bfee More repairs of wrong function names in menus!
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13689
diff changeset
582 ""
13194
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
583 '("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
584 '("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
585 '("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
586 '("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
587 '("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
588 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
589 '("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
590 '("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
591 '("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
592 '("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
593 '("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
594 )))))
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
595 (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
596
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
597 (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
598 "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
599 (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
600 (let* ((selection
39524
291264d596e9 (cal-menu-x-popup-menu): New function,
Eli Zaretskii <eliz@gnu.org>
parents: 39133
diff changeset
601 (cal-menu-x-popup-menu
13194
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
602 event
66617
ed95f221960d (date, event): Don't declare as dynamic-var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 65919
diff changeset
603 (list (calendar-date-string (calendar-event-to-date t) 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
604 (list
13690
8a3ceaf9bfee More repairs of wrong function names in menus!
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13689
diff changeset
605 ""
19975
927a8710de05 (cal-tex-mouse-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19950
diff changeset
606 '("Filofax Daily (one-day-per-page)" .
927a8710de05 (cal-tex-mouse-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19950
diff changeset
607 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
608 '("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
609 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
610 '("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
611 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
612 '("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
613 )))))
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
614 (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
615
7478
57cfbcfdf92a Rewrite mouse-3 menu as a keymap.
Richard M. Stallman <rms@gnu.org>
parents: 7442
diff changeset
616 (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
617 '("Exit calendar" . exit-calendar))
57cfbcfdf92a Rewrite mouse-3 menu as a keymap.
Richard M. Stallman <rms@gnu.org>
parents: 7442
diff changeset
618 (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
619 '("Show diary" . show-all-diary-entries))
57cfbcfdf92a Rewrite mouse-3 menu as a keymap.
Richard M. Stallman <rms@gnu.org>
parents: 7442
diff changeset
620 (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
621 '("Lunar phases" . calendar-phases-of-moon))
57cfbcfdf92a Rewrite mouse-3 menu as a keymap.
Richard M. Stallman <rms@gnu.org>
parents: 7442
diff changeset
622 (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
623 '("Unmark" . calendar-unmark))
57cfbcfdf92a Rewrite mouse-3 menu as a keymap.
Richard M. Stallman <rms@gnu.org>
parents: 7442
diff changeset
624 (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
625 '("Mark holidays" . mark-calendar-holidays))
57cfbcfdf92a Rewrite mouse-3 menu as a keymap.
Richard M. Stallman <rms@gnu.org>
parents: 7442
diff changeset
626 (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
627 '("List holidays" . list-calendar-holidays))
57cfbcfdf92a Rewrite mouse-3 menu as a keymap.
Richard M. Stallman <rms@gnu.org>
parents: 7442
diff changeset
628 (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
629 '("Mark diary entries" . mark-diary-entries))
57cfbcfdf92a Rewrite mouse-3 menu as a keymap.
Richard M. Stallman <rms@gnu.org>
parents: 7442
diff changeset
630 (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
631 '("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
632 (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
633 '("Scroll forward" . scroll-calendar-left-three-months))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
634
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
635 (run-hooks 'cal-menu-load-hook)
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
636
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
637 (provide 'cal-menu)
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
638
66617
ed95f221960d (date, event): Don't declare as dynamic-var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 65919
diff changeset
639 ;; arch-tag: aa81cf73-ce89-48a4-97ec-9ef861e87fe9
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
640 ;;; cal-menu.el ends here