annotate lisp/calendar/cal-menu.el @ 112293:568ea4e08e90

* xterm.h (struct x_display_info): Remove stray semicolon. The extra semicolon didn't conform to the C standard. Problem reported by Sun cc.
author Paul Eggert <eggert@cs.ucla.edu>
date Sun, 16 Jan 2011 23:27:25 -0800
parents ef719132ddfa
children
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
92962
b3d9a4a54d89 (cal-menu-goto-menu): Use "Go To".
Glenn Morris <rgm@gnu.org>
parents: 92907
diff changeset
3 ;; Copyright (C) 1994, 1995, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
112218
376148b31b5e Add 2011 to FSF/AIST copyright years.
Glenn Morris <rgm@gnu.org>
parents: 106815
diff changeset
4 ;; 2008, 2009, 2010, 2011 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>
92854
5ddbb514b6c5 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92647
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
110015
280c8ae2476d Add "Package:" file headers to denote built-in packages.
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
11 ;; Package: calendar
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
12
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
13 ;; This file is part of GNU Emacs.
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
14
94653
e49abd957e81 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94313
diff changeset
15 ;; GNU Emacs is free software: you can redistribute it and/or modify
6736
3e1323443b1a Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents: 5701
diff changeset
16 ;; it under the terms of the GNU General Public License as published by
94653
e49abd957e81 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94313
diff changeset
17 ;; the Free Software Foundation, either version 3 of the License, or
e49abd957e81 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94313
diff changeset
18 ;; (at your option) any later version.
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
19
6736
3e1323443b1a Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents: 5701
diff changeset
20 ;; 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
21 ;; 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
22 ;; 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
23 ;; 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
24
3e1323443b1a Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents: 5701
diff changeset
25 ;; You should have received a copy of the GNU General Public License
94653
e49abd957e81 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94313
diff changeset
26 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
27
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
28 ;;; Commentary:
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
29
93485
bbd30b42485a (Commentary): Point to calendar.el.
Glenn Morris <rgm@gnu.org>
parents: 93328
diff changeset
30 ;; See calendar.el.
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
31
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
32 ;;; Code:
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
33
93224
e800589311a9 Require calendar rather than declaring functions.
Glenn Morris <rgm@gnu.org>
parents: 93092
diff changeset
34 (require 'calendar)
86491
341f1d128c8b Comment.
Glenn Morris <rgm@gnu.org>
parents: 86445
diff changeset
35
96345
f0549aa8923b (cal-menu-sunmoon-menu): Rename from cal-menu-moon-menu. Add
Glenn Morris <rgm@gnu.org>
parents: 96317
diff changeset
36 (defconst cal-menu-sunmoon-menu
f0549aa8923b (cal-menu-sunmoon-menu): Rename from cal-menu-moon-menu. Add
Glenn Morris <rgm@gnu.org>
parents: 96317
diff changeset
37 '("Sun/Moon"
96356
9601e8a645ea (cal-menu-sunmoon-menu, cal-menu-global-mouse-menu): Update for lunar
Glenn Morris <rgm@gnu.org>
parents: 96345
diff changeset
38 ["Lunar Phases" calendar-lunar-phases]
96345
f0549aa8923b (cal-menu-sunmoon-menu): Rename from cal-menu-moon-menu. Add
Glenn Morris <rgm@gnu.org>
parents: 96317
diff changeset
39 ["Sunrise/sunset for cursor date" calendar-sunrise-sunset]
f0549aa8923b (cal-menu-sunmoon-menu): Rename from cal-menu-moon-menu. Add
Glenn Morris <rgm@gnu.org>
parents: 96317
diff changeset
40 ["Sunrise/sunset for cursor month" calendar-sunrise-sunset-month])
f0549aa8923b (cal-menu-sunmoon-menu): Rename from cal-menu-moon-menu. Add
Glenn Morris <rgm@gnu.org>
parents: 96317
diff changeset
41 "Key map for \"Sun/Moon\" menu in the calendar.")
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
42
82117
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
43 (defconst cal-menu-diary-menu
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
44 '("Diary"
93793
5c3eedca8e41 Update for diary-lib name changes.
Glenn Morris <rgm@gnu.org>
parents: 93742
diff changeset
45 ["Other File" diary-view-other-diary-entries]
82117
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
46 ["Cursor Date" diary-view-entries]
93793
5c3eedca8e41 Update for diary-lib name changes.
Glenn Morris <rgm@gnu.org>
parents: 93742
diff changeset
47 ["Mark All" diary-mark-entries]
82117
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
48 ["Show All" diary-show-all-entries]
93793
5c3eedca8e41 Update for diary-lib name changes.
Glenn Morris <rgm@gnu.org>
parents: 93742
diff changeset
49 ["Insert Diary Entry" diary-insert-entry]
5c3eedca8e41 Update for diary-lib name changes.
Glenn Morris <rgm@gnu.org>
parents: 93742
diff changeset
50 ["Insert Weekly" diary-insert-weekly-entry]
5c3eedca8e41 Update for diary-lib name changes.
Glenn Morris <rgm@gnu.org>
parents: 93742
diff changeset
51 ["Insert Monthly" diary-insert-monthly-entry]
5c3eedca8e41 Update for diary-lib name changes.
Glenn Morris <rgm@gnu.org>
parents: 93742
diff changeset
52 ["Insert Yearly" diary-insert-yearly-entry]
5c3eedca8e41 Update for diary-lib name changes.
Glenn Morris <rgm@gnu.org>
parents: 93742
diff changeset
53 ["Insert Anniversary" diary-insert-anniversary-entry]
5c3eedca8e41 Update for diary-lib name changes.
Glenn Morris <rgm@gnu.org>
parents: 93742
diff changeset
54 ["Insert Block" diary-insert-block-entry]
5c3eedca8e41 Update for diary-lib name changes.
Glenn Morris <rgm@gnu.org>
parents: 93742
diff changeset
55 ["Insert Cyclic" diary-insert-cyclic-entry]
82117
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
56 ("Insert Baha'i"
84592
a2988c19b72c (cal-menu-diary-menu, cal-menu-goto-menu):
Glenn Morris <rgm@gnu.org>
parents: 84553
diff changeset
57 ["One time" diary-bahai-insert-entry]
a2988c19b72c (cal-menu-diary-menu, cal-menu-goto-menu):
Glenn Morris <rgm@gnu.org>
parents: 84553
diff changeset
58 ["Monthly" diary-bahai-insert-monthly-entry]
a2988c19b72c (cal-menu-diary-menu, cal-menu-goto-menu):
Glenn Morris <rgm@gnu.org>
parents: 84553
diff changeset
59 ["Yearly" diary-bahai-insert-yearly-entry])
82117
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
60 ("Insert Islamic"
93649
498835e424c8 Update for iso, islamic, julian, mayan, persian name changes.
Glenn Morris <rgm@gnu.org>
parents: 93485
diff changeset
61 ["One time" diary-islamic-insert-entry]
498835e424c8 Update for iso, islamic, julian, mayan, persian name changes.
Glenn Morris <rgm@gnu.org>
parents: 93485
diff changeset
62 ["Monthly" diary-islamic-insert-monthly-entry]
498835e424c8 Update for iso, islamic, julian, mayan, persian name changes.
Glenn Morris <rgm@gnu.org>
parents: 93485
diff changeset
63 ["Yearly" diary-islamic-insert-yearly-entry])
82117
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
64 ("Insert Hebrew"
93742
370289920262 Update for chinese and hebrew name changes.
Glenn Morris <rgm@gnu.org>
parents: 93718
diff changeset
65 ["One time" diary-hebrew-insert-entry]
94313
17765ebde76c (cal-menu-diary-menu): Fix typo.
Glenn Morris <rgm@gnu.org>
parents: 93843
diff changeset
66 ["Monthly" diary-hebrew-insert-monthly-entry]
96297
7653ed8392c5 (cal-menu-moon-menu, cal-menu-diary-menu, cal-menu-holidays-menu)
Glenn Morris <rgm@gnu.org>
parents: 96067
diff changeset
67 ["Yearly" diary-hebrew-insert-yearly-entry]))
7653ed8392c5 (cal-menu-moon-menu, cal-menu-diary-menu, cal-menu-holidays-menu)
Glenn Morris <rgm@gnu.org>
parents: 96067
diff changeset
68 "Key map for \"Diary\" menu in the calendar.")
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
69
82117
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
70 (defun cal-menu-holiday-window-suffix ()
92647
8b4648ec6f76 (cal-menu-holiday-window-suffix)
Glenn Morris <rgm@gnu.org>
parents: 92549
diff changeset
71 "Return a string suffix for the \"Window\" entry in `cal-menu-holidays-menu'."
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93793
diff changeset
72 (let ((my1 (calendar-increment-month-cons -1))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93793
diff changeset
73 (my2 (calendar-increment-month-cons 1)))
96067
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
74 ;; Mon1-Mon2, Year or Mon1, Year1-Mon2, Year2.
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
75 (format "%s%s-%s, %d"
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
76 (calendar-month-name (car my1) 'abbrev)
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
77 (if (= (cdr my1) (cdr my2))
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
78 ""
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
79 (format ", %d" (cdr my1)))
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
80 (calendar-month-name (car my2) 'abbrev)
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
81 (cdr my2))))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
82
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93793
diff changeset
83 (defvar displayed-year) ; from calendar-generate
92907
d89709effe07 (displayed-year): Move declaration where needed.
Glenn Morris <rgm@gnu.org>
parents: 92854
diff changeset
84
82117
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
85 (defconst cal-menu-holidays-menu
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
86 `("Holidays"
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
87 ["For Cursor Date -" calendar-cursor-holidays
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
88 :suffix (calendar-date-string (calendar-cursor-to-date) t t)
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
89 :visible (calendar-cursor-to-date)]
84553
383791965ba9 Rename all list-calendar-holidays callers to calendar-list-holidays,
Glenn Morris <rgm@gnu.org>
parents: 82202
diff changeset
90 ["For Window -" calendar-list-holidays
82117
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
91 :suffix (cal-menu-holiday-window-suffix)]
96067
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
92 ["For Today -" (calendar-cursor-holidays (calendar-current-date))
82117
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
93 :suffix (calendar-date-string (calendar-current-date) t t)]
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
94 "--"
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
95 ,@(let ((l ()))
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
96 ;; Show 11 years--5 before, 5 after year of middle month.
87769
d62f6920cb4d (cal-menu-holidays-menu): Comment update.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 87649
diff changeset
97 ;; We used to use :suffix rather than :label and bumped into
d62f6920cb4d (cal-menu-holidays-menu): Comment update.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 87649
diff changeset
98 ;; an easymenu bug:
86445
8385b57c5ce6 (cal-menu-holidays-menu): Use :label rather than :suffix.
Glenn Morris <rgm@gnu.org>
parents: 86430
diff changeset
99 ;; http://lists.gnu.org/archive/html/emacs-devel/2007-11/msg01813.html
87769
d62f6920cb4d (cal-menu-holidays-menu): Comment update.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 87649
diff changeset
100 ;; The bug has since been fixed.
82117
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
101 (dotimes (i 11)
86445
8385b57c5ce6 (cal-menu-holidays-menu): Use :label rather than :suffix.
Glenn Morris <rgm@gnu.org>
parents: 86430
diff changeset
102 (push (vector (format "hol-year-%d" i)
86430
4c73f7497804 Revert previous commit, made without ChangeLog entry.
Glenn Morris <rgm@gnu.org>
parents: 86414
diff changeset
103 `(lambda ()
4c73f7497804 Revert previous commit, made without ChangeLog entry.
Glenn Morris <rgm@gnu.org>
parents: 86414
diff changeset
104 (interactive)
93328
15b0834c93df (cal-menu-holidays-menu, cal-menu-list-holidays-year)
Glenn Morris <rgm@gnu.org>
parents: 93224
diff changeset
105 (holiday-list (+ displayed-year ,(- i 5))))
86445
8385b57c5ce6 (cal-menu-holidays-menu): Use :label rather than :suffix.
Glenn Morris <rgm@gnu.org>
parents: 86430
diff changeset
106 :label `(format "For Year %d"
8385b57c5ce6 (cal-menu-holidays-menu): Use :label rather than :suffix.
Glenn Morris <rgm@gnu.org>
parents: 86430
diff changeset
107 (+ displayed-year ,(- i 5))))
86430
4c73f7497804 Revert previous commit, made without ChangeLog entry.
Glenn Morris <rgm@gnu.org>
parents: 86414
diff changeset
108 l))
82117
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
109 (nreverse l))
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
110 "--"
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
111 ["Unmark Calendar" calendar-unmark]
96297
7653ed8392c5 (cal-menu-moon-menu, cal-menu-diary-menu, cal-menu-holidays-menu)
Glenn Morris <rgm@gnu.org>
parents: 96067
diff changeset
112 ["Mark Holidays" calendar-mark-holidays])
7653ed8392c5 (cal-menu-moon-menu, cal-menu-diary-menu, cal-menu-holidays-menu)
Glenn Morris <rgm@gnu.org>
parents: 96067
diff changeset
113 "Key map for \"Holidays\" menu in the calendar.")
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
114
82117
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
115 (defconst cal-menu-goto-menu
96345
f0549aa8923b (cal-menu-sunmoon-menu): Rename from cal-menu-moon-menu. Add
Glenn Morris <rgm@gnu.org>
parents: 96317
diff changeset
116 '("Goto"
82117
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
117 ["Today" calendar-goto-today]
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
118 ["Beginning of Week" calendar-beginning-of-week]
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
119 ["End of Week" calendar-end-of-week]
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
120 ["Beginning of Month" calendar-beginning-of-month]
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
121 ["End of Month" calendar-end-of-month]
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
122 ["Beginning of Year" calendar-beginning-of-year]
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
123 ["End of Year" calendar-end-of-year]
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
124 ["Other Date" calendar-goto-date]
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
125 ["Day of Year" calendar-goto-day-of-year]
93649
498835e424c8 Update for iso, islamic, julian, mayan, persian name changes.
Glenn Morris <rgm@gnu.org>
parents: 93485
diff changeset
126 ["ISO Week" calendar-iso-goto-week]
498835e424c8 Update for iso, islamic, julian, mayan, persian name changes.
Glenn Morris <rgm@gnu.org>
parents: 93485
diff changeset
127 ["ISO Date" calendar-iso-goto-date]
498835e424c8 Update for iso, islamic, julian, mayan, persian name changes.
Glenn Morris <rgm@gnu.org>
parents: 93485
diff changeset
128 ["Astronomical Date" calendar-astro-goto-day-number]
93742
370289920262 Update for chinese and hebrew name changes.
Glenn Morris <rgm@gnu.org>
parents: 93718
diff changeset
129 ["Hebrew Date" calendar-hebrew-goto-date]
93649
498835e424c8 Update for iso, islamic, julian, mayan, persian name changes.
Glenn Morris <rgm@gnu.org>
parents: 93485
diff changeset
130 ["Persian Date" calendar-persian-goto-date]
84592
a2988c19b72c (cal-menu-diary-menu, cal-menu-goto-menu):
Glenn Morris <rgm@gnu.org>
parents: 84553
diff changeset
131 ["Baha'i Date" calendar-bahai-goto-date]
93649
498835e424c8 Update for iso, islamic, julian, mayan, persian name changes.
Glenn Morris <rgm@gnu.org>
parents: 93485
diff changeset
132 ["Islamic Date" calendar-islamic-goto-date]
498835e424c8 Update for iso, islamic, julian, mayan, persian name changes.
Glenn Morris <rgm@gnu.org>
parents: 93485
diff changeset
133 ["Julian Date" calendar-julian-goto-date]
93742
370289920262 Update for chinese and hebrew name changes.
Glenn Morris <rgm@gnu.org>
parents: 93718
diff changeset
134 ["Chinese Date" calendar-chinese-goto-date]
93718
2b79fd9755d7 Update for coptic and french name changes.
Glenn Morris <rgm@gnu.org>
parents: 93649
diff changeset
135 ["Coptic Date" calendar-coptic-goto-date]
2b79fd9755d7 Update for coptic and french name changes.
Glenn Morris <rgm@gnu.org>
parents: 93649
diff changeset
136 ["Ethiopic Date" calendar-ethiopic-goto-date]
82117
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
137 ("Mayan Date"
93649
498835e424c8 Update for iso, islamic, julian, mayan, persian name changes.
Glenn Morris <rgm@gnu.org>
parents: 93485
diff changeset
138 ["Next Tzolkin" calendar-mayan-next-tzolkin-date]
498835e424c8 Update for iso, islamic, julian, mayan, persian name changes.
Glenn Morris <rgm@gnu.org>
parents: 93485
diff changeset
139 ["Previous Tzolkin" calendar-mayan-previous-tzolkin-date]
498835e424c8 Update for iso, islamic, julian, mayan, persian name changes.
Glenn Morris <rgm@gnu.org>
parents: 93485
diff changeset
140 ["Next Haab" calendar-mayan-next-haab-date]
498835e424c8 Update for iso, islamic, julian, mayan, persian name changes.
Glenn Morris <rgm@gnu.org>
parents: 93485
diff changeset
141 ["Previous Haab" calendar-mayan-previous-haab-date]
498835e424c8 Update for iso, islamic, julian, mayan, persian name changes.
Glenn Morris <rgm@gnu.org>
parents: 93485
diff changeset
142 ["Next Round" calendar-mayan-next-round-date]
498835e424c8 Update for iso, islamic, julian, mayan, persian name changes.
Glenn Morris <rgm@gnu.org>
parents: 93485
diff changeset
143 ["Previous Round" calendar-mayan-previous-round-date])
96297
7653ed8392c5 (cal-menu-moon-menu, cal-menu-diary-menu, cal-menu-holidays-menu)
Glenn Morris <rgm@gnu.org>
parents: 96067
diff changeset
144 ["French Date" calendar-french-goto-date])
96345
f0549aa8923b (cal-menu-sunmoon-menu): Rename from cal-menu-moon-menu. Add
Glenn Morris <rgm@gnu.org>
parents: 96317
diff changeset
145 "Key map for \"Goto\" menu in the calendar.")
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
146
82117
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
147 (defconst cal-menu-scroll-menu
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
148 '("Scroll"
105140
c9ff23f80f09 (cal-menu-scroll-menu): Add a sub-section with commands that move
Glenn Morris <rgm@gnu.org>
parents: 103976
diff changeset
149 ["Scroll Commands" nil :help "Commands that scroll the visible window"]
82149
2914fd1abc3e (cal-menu-scroll-menu, cal-menu-global-mouse-menu): Use new names.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 82140
diff changeset
150 ["Forward 1 Month" calendar-scroll-left]
2914fd1abc3e (cal-menu-scroll-menu, cal-menu-global-mouse-menu): Use new names.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 82140
diff changeset
151 ["Forward 3 Months" calendar-scroll-left-three-months]
94313
17765ebde76c (cal-menu-diary-menu): Fix typo.
Glenn Morris <rgm@gnu.org>
parents: 93843
diff changeset
152 ["Forward 1 Year" (calendar-scroll-left 12) :keys "4 C-v"]
82149
2914fd1abc3e (cal-menu-scroll-menu, cal-menu-global-mouse-menu): Use new names.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 82140
diff changeset
153 ["Backward 1 Month" calendar-scroll-right]
2914fd1abc3e (cal-menu-scroll-menu, cal-menu-global-mouse-menu): Use new names.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 82140
diff changeset
154 ["Backward 3 Months" calendar-scroll-right-three-months]
105140
c9ff23f80f09 (cal-menu-scroll-menu): Add a sub-section with commands that move
Glenn Morris <rgm@gnu.org>
parents: 103976
diff changeset
155 ["Backward 1 Year" (calendar-scroll-right 12) :keys "4 M-v"]
c9ff23f80f09 (cal-menu-scroll-menu): Add a sub-section with commands that move
Glenn Morris <rgm@gnu.org>
parents: 103976
diff changeset
156 "--"
c9ff23f80f09 (cal-menu-scroll-menu): Add a sub-section with commands that move
Glenn Morris <rgm@gnu.org>
parents: 103976
diff changeset
157 ["Motion Commands" nil :help "Commands that move point"]
c9ff23f80f09 (cal-menu-scroll-menu): Add a sub-section with commands that move
Glenn Morris <rgm@gnu.org>
parents: 103976
diff changeset
158 ["Forward 1 Day" calendar-forward-day]
c9ff23f80f09 (cal-menu-scroll-menu): Add a sub-section with commands that move
Glenn Morris <rgm@gnu.org>
parents: 103976
diff changeset
159 ["Forward 1 Week" calendar-forward-week]
c9ff23f80f09 (cal-menu-scroll-menu): Add a sub-section with commands that move
Glenn Morris <rgm@gnu.org>
parents: 103976
diff changeset
160 ["Forward 1 Month" calendar-forward-month]
c9ff23f80f09 (cal-menu-scroll-menu): Add a sub-section with commands that move
Glenn Morris <rgm@gnu.org>
parents: 103976
diff changeset
161 ["Forward 1 Year" calendar-forward-year]
c9ff23f80f09 (cal-menu-scroll-menu): Add a sub-section with commands that move
Glenn Morris <rgm@gnu.org>
parents: 103976
diff changeset
162 ["Backward 1 Day" calendar-backward-day]
c9ff23f80f09 (cal-menu-scroll-menu): Add a sub-section with commands that move
Glenn Morris <rgm@gnu.org>
parents: 103976
diff changeset
163 ["Backward 1 Week" calendar-backward-week]
c9ff23f80f09 (cal-menu-scroll-menu): Add a sub-section with commands that move
Glenn Morris <rgm@gnu.org>
parents: 103976
diff changeset
164 ["Backward 1 Month" calendar-backward-month]
c9ff23f80f09 (cal-menu-scroll-menu): Add a sub-section with commands that move
Glenn Morris <rgm@gnu.org>
parents: 103976
diff changeset
165 ["Backward 1 Year" calendar-backward-year])
96297
7653ed8392c5 (cal-menu-moon-menu, cal-menu-diary-menu, cal-menu-holidays-menu)
Glenn Morris <rgm@gnu.org>
parents: 96067
diff changeset
166 "Key map for \"Scroll\" menu in the calendar.")
52230
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
167
105933
8f110099da5c Update x-popup-menu declaration.
Glenn Morris <rgm@gnu.org>
parents: 105140
diff changeset
168 (declare-function x-popup-menu "menu.c" (position menu))
97422
6e551caf98f6 Add declarations for builds without X.
Glenn Morris <rgm@gnu.org>
parents: 96356
diff changeset
169
96067
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
170 (defmacro cal-menu-x-popup-menu (event title &rest body)
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
171 "Call `x-popup-menu' at position EVENT, with TITLE and contents BODY.
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
172 Signals an error if popups are unavailable."
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
173 (declare (indent 2))
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
174 `(if (display-popup-menus-p)
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
175 (x-popup-menu ,event (list ,title (append (list ,title) ,@body)))
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
176 (error "Popup menus are not available on this system")))
22031
879df83433a1 Minor fix to earlier changes today.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22027
diff changeset
177
93328
15b0834c93df (cal-menu-holidays-menu, cal-menu-list-holidays-year)
Glenn Morris <rgm@gnu.org>
parents: 93224
diff changeset
178 (autoload 'diary-list-entries "diary-lib")
96317
1428d59cfd91 (calendar-check-holidays): Declare rather than autoloading.
Glenn Morris <rgm@gnu.org>
parents: 96314
diff changeset
179 ;; Autoloaded in diary-lib.
1428d59cfd91 (calendar-check-holidays): Declare rather than autoloading.
Glenn Morris <rgm@gnu.org>
parents: 96314
diff changeset
180 (declare-function calendar-check-holidays "holidays" (date))
92549
389da10cb238 (holidays-in-diary-buffer): Declare for compiler.
Glenn Morris <rgm@gnu.org>
parents: 87769
diff changeset
181
66617
ed95f221960d (date, event): Don't declare as dynamic-var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 65919
diff changeset
182 (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
183 "Pop up menu of diary entries for mouse-selected date.
92647
8b4648ec6f76 (cal-menu-holiday-window-suffix)
Glenn Morris <rgm@gnu.org>
parents: 92549
diff changeset
184 Use optional DATE and alternative file DIARY. EVENT is the event
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93793
diff changeset
185 that invoked this command. Shows holidays if `diary-show-holidays-flag'
92647
8b4648ec6f76 (cal-menu-holiday-window-suffix)
Glenn Morris <rgm@gnu.org>
parents: 92549
diff changeset
186 is non-nil."
66617
ed95f221960d (date, event): Don't declare as dynamic-var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 65919
diff changeset
187 (interactive "i\ni\ne")
96067
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
188 (let* ((date (or date (calendar-cursor-to-date nil event)))
93092
6c0dbddcd03a (calendar-other-dates): Declare it, and removes the declarations it replaces.
Glenn Morris <rgm@gnu.org>
parents: 92962
diff changeset
189 (diary-file (or diary diary-file))
52230
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
190 (diary-list-include-blanks nil)
96067
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
191 (diary-entries (mapcar (lambda (x) (split-string (cadr x) "\n"))
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
192 (diary-list-entries date 1 'list-only)))
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93793
diff changeset
193 (holidays (if diary-show-holidays-flag
84553
383791965ba9 Rename all list-calendar-holidays callers to calendar-list-holidays,
Glenn Morris <rgm@gnu.org>
parents: 82202
diff changeset
194 (calendar-check-holidays date)))
96067
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
195 (title (format "Diary entries%s for %s"
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
196 (if diary (format " from %s" diary) "")
52230
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
197 (calendar-date-string date)))
96067
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
198 (selection (cal-menu-x-popup-menu event title
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
199 (mapcar (lambda (x) (list (concat " " x))) holidays)
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
200 (if holidays
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
201 (list "--shadow-etched-in" "--shadow-etched-in"))
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
202 (if diary-entries
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
203 (mapcar 'list (apply 'append diary-entries))
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
204 '("None")))))
22413
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
205 (and selection (call-interactively selection))))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
206
96067
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
207 (defun calendar-mouse-view-other-diary-entries (&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
208 "Pop up menu of diary entries from alternative file on mouse-selected date."
96067
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
209 (interactive "e")
52230
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
210 (calendar-mouse-view-diary-entries
96067
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
211 (calendar-cursor-to-date nil event)
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
212 (read-file-name "Enter diary file name: " default-directory nil t)
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
213 event))
13194
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
214
103976
a1f42bc54ce3 (cal-menu-set-date-title): Handle calls from non-calendar buffers (Bug#3862).
Glenn Morris <rgm@gnu.org>
parents: 100970
diff changeset
215 ;; In 22, the equivalent code gave an error when not called on a date,
a1f42bc54ce3 (cal-menu-set-date-title): Handle calls from non-calendar buffers (Bug#3862).
Glenn Morris <rgm@gnu.org>
parents: 100970
diff changeset
216 ;; but easymenu does not seem to allow this (?).
a1f42bc54ce3 (cal-menu-set-date-title): Handle calls from non-calendar buffers (Bug#3862).
Glenn Morris <rgm@gnu.org>
parents: 100970
diff changeset
217 ;; The ignore-errors is because `documentation' can end up calling
a1f42bc54ce3 (cal-menu-set-date-title): Handle calls from non-calendar buffers (Bug#3862).
Glenn Morris <rgm@gnu.org>
parents: 100970
diff changeset
218 ;; this in a non-calendar buffer where displayed-month is unbound. (Bug#3862)
92647
8b4648ec6f76 (cal-menu-holiday-window-suffix)
Glenn Morris <rgm@gnu.org>
parents: 92549
diff changeset
219 (defun cal-menu-set-date-title (menu)
8b4648ec6f76 (cal-menu-holiday-window-suffix)
Glenn Morris <rgm@gnu.org>
parents: 92549
diff changeset
220 "Convert date of last event to title suitable for MENU."
103976
a1f42bc54ce3 (cal-menu-set-date-title): Handle calls from non-calendar buffers (Bug#3862).
Glenn Morris <rgm@gnu.org>
parents: 100970
diff changeset
221 (let ((date (ignore-errors (calendar-cursor-to-date nil last-input-event))))
a1f42bc54ce3 (cal-menu-set-date-title): Handle calls from non-calendar buffers (Bug#3862).
Glenn Morris <rgm@gnu.org>
parents: 100970
diff changeset
222 (if date
a1f42bc54ce3 (cal-menu-set-date-title): Handle calls from non-calendar buffers (Bug#3862).
Glenn Morris <rgm@gnu.org>
parents: 100970
diff changeset
223 (easy-menu-filter-return menu (calendar-date-string date t nil))
a1f42bc54ce3 (cal-menu-set-date-title): Handle calls from non-calendar buffers (Bug#3862).
Glenn Morris <rgm@gnu.org>
parents: 100970
diff changeset
224 (message "Not on a date!")
a1f42bc54ce3 (cal-menu-set-date-title): Handle calls from non-calendar buffers (Bug#3862).
Glenn Morris <rgm@gnu.org>
parents: 100970
diff changeset
225 nil)))
92647
8b4648ec6f76 (cal-menu-holiday-window-suffix)
Glenn Morris <rgm@gnu.org>
parents: 92549
diff changeset
226
82117
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
227 (easy-menu-define cal-menu-context-mouse-menu nil
103976
a1f42bc54ce3 (cal-menu-set-date-title): Handle calls from non-calendar buffers (Bug#3862).
Glenn Morris <rgm@gnu.org>
parents: 100970
diff changeset
228 "Pop up mouse menu for selected date in the calendar window."
a1f42bc54ce3 (cal-menu-set-date-title): Handle calls from non-calendar buffers (Bug#3862).
Glenn Morris <rgm@gnu.org>
parents: 100970
diff changeset
229 '("cal-menu-context-mouse-menu" :filter cal-menu-set-date-title
82117
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
230 "--"
96304
b56931e7df3b (calendar-mouse-holidays): Remove function.
Glenn Morris <rgm@gnu.org>
parents: 96297
diff changeset
231 ["Holidays" calendar-cursor-holidays]
96047
65c4c935e492 * calendar/calendar.el (calendar-cursor-to-date): Add argument `event'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 95415
diff changeset
232 ["Mark date" calendar-set-mark]
65c4c935e492 * calendar/calendar.el (calendar-cursor-to-date): Add argument `event'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 95415
diff changeset
233 ["Sunrise/sunset" calendar-sunrise-sunset]
96297
7653ed8392c5 (cal-menu-moon-menu, cal-menu-diary-menu, cal-menu-holidays-menu)
Glenn Morris <rgm@gnu.org>
parents: 96067
diff changeset
234 ["Other calendars" calendar-print-other-dates]
103976
a1f42bc54ce3 (cal-menu-set-date-title): Handle calls from non-calendar buffers (Bug#3862).
Glenn Morris <rgm@gnu.org>
parents: 100970
diff changeset
235 ;; There was a bug (#447; fixed) with last-nonmenu-event and submenus.
a1f42bc54ce3 (cal-menu-set-date-title): Handle calls from non-calendar buffers (Bug#3862).
Glenn Morris <rgm@gnu.org>
parents: 100970
diff changeset
236 ;; These did not work if called without calendar window selected.
82117
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
237 ("Prepare LaTeX buffer"
96067
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
238 ["Daily (1 page)" cal-tex-cursor-day]
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
239 ["Weekly (1 page)" cal-tex-cursor-week]
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
240 ["Weekly (2 pages)" cal-tex-cursor-week2]
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
241 ["Weekly (other style; 1 page)" cal-tex-cursor-week-iso]
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
242 ["Weekly (yet another style; 1 page)" cal-tex-cursor-week-monday]
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
243 ["Monthly" cal-tex-cursor-month]
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
244 ["Monthly (landscape)" cal-tex-cursor-month-landscape]
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
245 ["Yearly" cal-tex-cursor-year]
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
246 ["Yearly (landscape)" cal-tex-cursor-year-landscape]
82117
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
247 ("Filofax styles"
96067
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
248 ["Filofax Daily (one-day-per-page)" cal-tex-cursor-filofax-daily]
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
249 ["Filofax Weekly (2-weeks-at-a-glance)" cal-tex-cursor-filofax-2week]
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
250 ["Filofax Weekly (week-at-a-glance)" cal-tex-cursor-filofax-week]
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
251 ["Filofax Yearly" cal-tex-cursor-filofax-year]))
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
252 ("Write HTML calendar"
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
253 ["For selected month" cal-html-cursor-month]
e2c64ca546da (cal-menu-holidays-menu): Use calendar-cursor-holidays rather than
Glenn Morris <rgm@gnu.org>
parents: 96047
diff changeset
254 ["For selected year" cal-html-cursor-year])
96307
fd9cd4ce5935 (cal-menu-context-mouse-menu): Add some :keys.
Glenn Morris <rgm@gnu.org>
parents: 96304
diff changeset
255 ["Diary entries" calendar-mouse-view-diary-entries :keys "d"]
96047
65c4c935e492 * calendar/calendar.el (calendar-cursor-to-date): Add argument `event'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 95415
diff changeset
256 ["Insert diary entry" diary-insert-entry]
96307
fd9cd4ce5935 (cal-menu-context-mouse-menu): Add some :keys.
Glenn Morris <rgm@gnu.org>
parents: 96304
diff changeset
257 ["Other diary file entries" calendar-mouse-view-other-diary-entries
fd9cd4ce5935 (cal-menu-context-mouse-menu): Add some :keys.
Glenn Morris <rgm@gnu.org>
parents: 96304
diff changeset
258 :keys "D"]))
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
259
82117
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
260 (easy-menu-define cal-menu-global-mouse-menu nil
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
261 "Menu bound to a mouse event, not specific to the mouse-click location."
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
262 '("Calendar"
82149
2914fd1abc3e (cal-menu-scroll-menu, cal-menu-global-mouse-menu): Use new names.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 82140
diff changeset
263 ["Scroll forward" calendar-scroll-left-three-months]
2914fd1abc3e (cal-menu-scroll-menu, cal-menu-global-mouse-menu): Use new names.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 82140
diff changeset
264 ["Scroll backward" calendar-scroll-right-three-months]
93793
5c3eedca8e41 Update for diary-lib name changes.
Glenn Morris <rgm@gnu.org>
parents: 93742
diff changeset
265 ["Mark diary entries" diary-mark-entries]
84553
383791965ba9 Rename all list-calendar-holidays callers to calendar-list-holidays,
Glenn Morris <rgm@gnu.org>
parents: 82202
diff changeset
266 ["List holidays" calendar-list-holidays]
383791965ba9 Rename all list-calendar-holidays callers to calendar-list-holidays,
Glenn Morris <rgm@gnu.org>
parents: 82202
diff changeset
267 ["Mark holidays" calendar-mark-holidays]
82117
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
268 ["Unmark" calendar-unmark]
96356
9601e8a645ea (cal-menu-sunmoon-menu, cal-menu-global-mouse-menu): Update for lunar
Glenn Morris <rgm@gnu.org>
parents: 96345
diff changeset
269 ["Lunar phases" calendar-lunar-phases]
96345
f0549aa8923b (cal-menu-sunmoon-menu): Rename from cal-menu-moon-menu. Add
Glenn Morris <rgm@gnu.org>
parents: 96317
diff changeset
270 ["Sunrise times for month" calendar-sunrise-sunset-month]
82117
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
271 ["Show diary" diary-show-all-entries]
93843
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
272 ["Exit calendar" calendar-exit]))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
273
93092
6c0dbddcd03a (calendar-other-dates): Declare it, and removes the declarations it replaces.
Glenn Morris <rgm@gnu.org>
parents: 92962
diff changeset
274 ;; Undocumented and probably useless.
6c0dbddcd03a (calendar-other-dates): Declare it, and removes the declarations it replaces.
Glenn Morris <rgm@gnu.org>
parents: 92962
diff changeset
275 (defvar cal-menu-load-hook nil
6c0dbddcd03a (calendar-other-dates): Declare it, and removes the declarations it replaces.
Glenn Morris <rgm@gnu.org>
parents: 92962
diff changeset
276 "Hook run on loading of the `cal-menu' package.")
6c0dbddcd03a (calendar-other-dates): Declare it, and removes the declarations it replaces.
Glenn Morris <rgm@gnu.org>
parents: 92962
diff changeset
277 (make-obsolete-variable 'cal-menu-load-hook
6c0dbddcd03a (calendar-other-dates): Declare it, and removes the declarations it replaces.
Glenn Morris <rgm@gnu.org>
parents: 92962
diff changeset
278 "it will be removed in future." "23.1")
6c0dbddcd03a (calendar-other-dates): Declare it, and removes the declarations it replaces.
Glenn Morris <rgm@gnu.org>
parents: 92962
diff changeset
279
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
280 (run-hooks 'cal-menu-load-hook)
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 (provide 'cal-menu)
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
283
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
284 ;;; cal-menu.el ends here