annotate lisp/calendar/cal-menu.el @ 94146:096ad76b9ccf

(Fmultibyte_char_to_unibyte): Return latin1 chars unchanged.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 18 Apr 2008 03:26:55 +0000
parents 61357badb5fa
children 17765ebde76c
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,
b3d9a4a54d89 (cal-menu-goto-menu): Use "Go To".
Glenn Morris <rgm@gnu.org>
parents: 92907
diff changeset
4 ;; 2008 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
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
78216
93e11478c954 Switch license to GPLv3 or later.
Glenn Morris <rgm@gnu.org>
parents: 77279
diff changeset
16 ;; the Free Software Foundation; either version 3, or (at your option)
6736
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
93485
bbd30b42485a (Commentary): Point to calendar.el.
Glenn Morris <rgm@gnu.org>
parents: 93328
diff changeset
31 ;; See calendar.el.
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
32
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
33 ;;; Code:
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
34
93224
e800589311a9 Require calendar rather than declaring functions.
Glenn Morris <rgm@gnu.org>
parents: 93092
diff changeset
35 (require 'calendar)
86491
341f1d128c8b Comment.
Glenn Morris <rgm@gnu.org>
parents: 86445
diff changeset
36
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
37 (defconst cal-menu-moon-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
38 '("Moon"
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
39 ["Lunar Phases" calendar-phases-of-moon]))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
40
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
41 (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
42 '("Diary"
93793
5c3eedca8e41 Update for diary-lib name changes.
Glenn Morris <rgm@gnu.org>
parents: 93742
diff changeset
43 ["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
44 ["Cursor Date" diary-view-entries]
93793
5c3eedca8e41 Update for diary-lib name changes.
Glenn Morris <rgm@gnu.org>
parents: 93742
diff changeset
45 ["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
46 ["Show All" diary-show-all-entries]
93793
5c3eedca8e41 Update for diary-lib name changes.
Glenn Morris <rgm@gnu.org>
parents: 93742
diff changeset
47 ["Insert Diary Entry" diary-insert-entry]
5c3eedca8e41 Update for diary-lib name changes.
Glenn Morris <rgm@gnu.org>
parents: 93742
diff changeset
48 ["Insert Weekly" diary-insert-weekly-entry]
5c3eedca8e41 Update for diary-lib name changes.
Glenn Morris <rgm@gnu.org>
parents: 93742
diff changeset
49 ["Insert Monthly" diary-insert-monthly-entry]
5c3eedca8e41 Update for diary-lib name changes.
Glenn Morris <rgm@gnu.org>
parents: 93742
diff changeset
50 ["Insert Yearly" diary-insert-yearly-entry]
5c3eedca8e41 Update for diary-lib name changes.
Glenn Morris <rgm@gnu.org>
parents: 93742
diff changeset
51 ["Insert Anniversary" diary-insert-anniversary-entry]
5c3eedca8e41 Update for diary-lib name changes.
Glenn Morris <rgm@gnu.org>
parents: 93742
diff changeset
52 ["Insert Block" diary-insert-block-entry]
5c3eedca8e41 Update for diary-lib name changes.
Glenn Morris <rgm@gnu.org>
parents: 93742
diff changeset
53 ["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
54 ("Insert Baha'i"
84592
a2988c19b72c (cal-menu-diary-menu, cal-menu-goto-menu):
Glenn Morris <rgm@gnu.org>
parents: 84553
diff changeset
55 ["One time" diary-bahai-insert-entry]
a2988c19b72c (cal-menu-diary-menu, cal-menu-goto-menu):
Glenn Morris <rgm@gnu.org>
parents: 84553
diff changeset
56 ["Monthly" diary-bahai-insert-monthly-entry]
a2988c19b72c (cal-menu-diary-menu, cal-menu-goto-menu):
Glenn Morris <rgm@gnu.org>
parents: 84553
diff changeset
57 ["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
58 ("Insert Islamic"
93649
498835e424c8 Update for iso, islamic, julian, mayan, persian name changes.
Glenn Morris <rgm@gnu.org>
parents: 93485
diff changeset
59 ["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
60 ["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
61 ["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
62 ("Insert Hebrew"
93742
370289920262 Update for chinese and hebrew name changes.
Glenn Morris <rgm@gnu.org>
parents: 93718
diff changeset
63 ["One time" diary-hebrew-insert-entry]
370289920262 Update for chinese and hebrew name changes.
Glenn Morris <rgm@gnu.org>
parents: 93718
diff changeset
64 ["Monthly" diary-hebrew--insert-monthly-entry]
370289920262 Update for chinese and hebrew name changes.
Glenn Morris <rgm@gnu.org>
parents: 93718
diff changeset
65 ["Yearly" diary-hebrew-insert-yearly-entry])))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
66
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
67 (defun cal-menu-holiday-window-suffix ()
92647
8b4648ec6f76 (cal-menu-holiday-window-suffix)
Glenn Morris <rgm@gnu.org>
parents: 92549
diff changeset
68 "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
69 (let ((my1 (calendar-increment-month-cons -1))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93793
diff changeset
70 (my2 (calendar-increment-month-cons 1)))
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
71 (if (= (cdr my1) (cdr my2))
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
72 (format "%s-%s, %d"
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
73 (calendar-month-name (car my1) 'abbrev)
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
74 (calendar-month-name (car my2) 'abbrev)
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
75 (cdr my2))
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
76 (format "%s, %d-%s, %d"
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
77 (calendar-month-name (car my1) 'abbrev)
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
78 (cdr my1)
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
79 (calendar-month-name (car my2) 'abbrev)
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
80 (cdr my2)))))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
81
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93793
diff changeset
82 (defvar displayed-year) ; from calendar-generate
92907
d89709effe07 (displayed-year): Move declaration where needed.
Glenn Morris <rgm@gnu.org>
parents: 92854
diff changeset
83
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
84 (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
85 `("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
86 ["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
87 :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
88 :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
89 ["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
90 :suffix (cal-menu-holiday-window-suffix)]
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 ["For Today -" cal-menu-today-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
92 :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
93 "--"
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 ,@(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
95 ;; 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
96 ;; 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
97 ;; an easymenu bug:
86445
8385b57c5ce6 (cal-menu-holidays-menu): Use :label rather than :suffix.
Glenn Morris <rgm@gnu.org>
parents: 86430
diff changeset
98 ;; 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
99 ;; 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
100 (dotimes (i 11)
86445
8385b57c5ce6 (cal-menu-holidays-menu): Use :label rather than :suffix.
Glenn Morris <rgm@gnu.org>
parents: 86430
diff changeset
101 (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
102 `(lambda ()
4c73f7497804 Revert previous commit, made without ChangeLog entry.
Glenn Morris <rgm@gnu.org>
parents: 86414
diff changeset
103 (interactive)
93328
15b0834c93df (cal-menu-holidays-menu, cal-menu-list-holidays-year)
Glenn Morris <rgm@gnu.org>
parents: 93224
diff changeset
104 (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
105 :label `(format "For Year %d"
8385b57c5ce6 (cal-menu-holidays-menu): Use :label rather than :suffix.
Glenn Morris <rgm@gnu.org>
parents: 86430
diff changeset
106 (+ displayed-year ,(- i 5))))
86430
4c73f7497804 Revert previous commit, made without ChangeLog entry.
Glenn Morris <rgm@gnu.org>
parents: 86414
diff changeset
107 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
108 (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
109 "--"
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 ["Unmark Calendar" calendar-unmark]
93485
bbd30b42485a (Commentary): Point to calendar.el.
Glenn Morris <rgm@gnu.org>
parents: 93328
diff changeset
111 ["Mark Holidays" calendar-mark-holidays]))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
112
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
113 (defconst cal-menu-goto-menu
92962
b3d9a4a54d89 (cal-menu-goto-menu): Use "Go To".
Glenn Morris <rgm@gnu.org>
parents: 92907
diff changeset
114 '("Go To"
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 ["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
116 ["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
117 ["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
118 ["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
119 ["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
120 ["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
121 ["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
122 ["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
123 ["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
124 ["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
125 ["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
126 ["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
127 ["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
128 ["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
129 ["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
130 ["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
131 ["Julian Date" calendar-julian-goto-date]
93742
370289920262 Update for chinese and hebrew name changes.
Glenn Morris <rgm@gnu.org>
parents: 93718
diff changeset
132 ["Chinese Date" calendar-chinese-goto-date]
93718
2b79fd9755d7 Update for coptic and french name changes.
Glenn Morris <rgm@gnu.org>
parents: 93649
diff changeset
133 ["Coptic Date" calendar-coptic-goto-date]
2b79fd9755d7 Update for coptic and french name changes.
Glenn Morris <rgm@gnu.org>
parents: 93649
diff changeset
134 ["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
135 ("Mayan Date"
93649
498835e424c8 Update for iso, islamic, julian, mayan, persian name changes.
Glenn Morris <rgm@gnu.org>
parents: 93485
diff changeset
136 ["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
137 ["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
138 ["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
139 ["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
140 ["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
141 ["Previous Round" calendar-mayan-previous-round-date])
93718
2b79fd9755d7 Update for coptic and french name changes.
Glenn Morris <rgm@gnu.org>
parents: 93649
diff changeset
142 ["French Date" calendar-french-goto-date]))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
143
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
144 (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
145 '("Scroll"
82149
2914fd1abc3e (cal-menu-scroll-menu, cal-menu-global-mouse-menu): Use new names.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 82140
diff changeset
146 ["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
147 ["Forward 3 Months" calendar-scroll-left-three-months]
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
148 ["Forward 1 Year" "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
149 ["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
150 ["Backward 3 Months" calendar-scroll-right-three-months]
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
151 ["Backward 1 Year" "4\ev"]))
52230
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
152
39524
291264d596e9 (cal-menu-x-popup-menu): New function,
Eli Zaretskii <eliz@gnu.org>
parents: 39133
diff changeset
153 (defun cal-menu-x-popup-menu (position menu)
92647
8b4648ec6f76 (cal-menu-holiday-window-suffix)
Glenn Morris <rgm@gnu.org>
parents: 92549
diff changeset
154 "Like `x-popup-menu', but print an error message if popups are unavailable.
8b4648ec6f76 (cal-menu-holiday-window-suffix)
Glenn Morris <rgm@gnu.org>
parents: 92549
diff changeset
155 POSITION and MENU are passed to `x-popup-menu'."
39524
291264d596e9 (cal-menu-x-popup-menu): New function,
Eli Zaretskii <eliz@gnu.org>
parents: 39133
diff changeset
156 (if (display-popup-menus-p)
291264d596e9 (cal-menu-x-popup-menu): New function,
Eli Zaretskii <eliz@gnu.org>
parents: 39133
diff changeset
157 (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
158 (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
159
17667
fd527e9aa377 (cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents: 17553
diff changeset
160 (defun cal-menu-list-holidays-year ()
fd527e9aa377 (cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents: 17553
diff changeset
161 "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
162 (interactive)
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93793
diff changeset
163 (holiday-list (calendar-extract-year (calendar-cursor-to-date))))
17667
fd527e9aa377 (cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents: 17553
diff changeset
164
fd527e9aa377 (cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents: 17553
diff changeset
165 (defun cal-menu-list-holidays-following-year ()
fd527e9aa377 (cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents: 17553
diff changeset
166 "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
167 (interactive)
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93793
diff changeset
168 (holiday-list (1+ (calendar-extract-year (calendar-cursor-to-date)))))
17667
fd527e9aa377 (cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents: 17553
diff changeset
169
fd527e9aa377 (cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents: 17553
diff changeset
170 (defun cal-menu-list-holidays-previous-year ()
fd527e9aa377 (cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents: 17553
diff changeset
171 "Display a list of the holidays of the previous year."
fd527e9aa377 (cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents: 17553
diff changeset
172 (interactive)
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93793
diff changeset
173 (holiday-list (1- (calendar-extract-year (calendar-cursor-to-date)))))
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
174
93843
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
175 (defun cal-menu-event-to-date (&optional error)
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
176 "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
177 If event is not on a specific date, signals an error if optional parameter
92907
d89709effe07 (displayed-year): Move declaration where needed.
Glenn Morris <rgm@gnu.org>
parents: 92854
diff changeset
178 ERROR is non-nil, otherwise just returns nil."
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
179 (with-current-buffer
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
180 (window-buffer (posn-window (event-start last-input-event)))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
181 (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
182 (calendar-cursor-to-date error)))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
183
92907
d89709effe07 (displayed-year): Move declaration where needed.
Glenn Morris <rgm@gnu.org>
parents: 92854
diff changeset
184 (defun calendar-mouse-goto-date (date)
92962
b3d9a4a54d89 (cal-menu-goto-menu): Use "Go To".
Glenn Morris <rgm@gnu.org>
parents: 92907
diff changeset
185 "Go to DATE in the buffer specified by `last-input-event'."
92907
d89709effe07 (displayed-year): Move declaration where needed.
Glenn Morris <rgm@gnu.org>
parents: 92854
diff changeset
186 (set-buffer (window-buffer (posn-window (event-start last-input-event))))
d89709effe07 (displayed-year): Move declaration where needed.
Glenn Morris <rgm@gnu.org>
parents: 92854
diff changeset
187 (calendar-goto-date date))
d89709effe07 (displayed-year): Move declaration where needed.
Glenn Morris <rgm@gnu.org>
parents: 92854
diff changeset
188
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
189 (defun calendar-mouse-sunrise/sunset ()
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
190 "Show sunrise/sunset times for mouse-selected date."
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
191 (interactive)
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
192 (save-excursion
93843
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
193 (calendar-mouse-goto-date (cal-menu-event-to-date))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
194 (calendar-sunrise-sunset)))
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
195
22031
879df83433a1 Minor fix to earlier changes today.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22027
diff changeset
196 (defun cal-menu-today-holidays ()
879df83433a1 Minor fix to earlier changes today.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22027
diff changeset
197 "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
198 (interactive)
879df83433a1 Minor fix to earlier changes today.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22027
diff changeset
199 (save-excursion
879df83433a1 Minor fix to earlier changes today.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22027
diff changeset
200 (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
201 (calendar-cursor-holidays)))
879df83433a1 Minor fix to earlier changes today.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22027
diff changeset
202
84553
383791965ba9 Rename all list-calendar-holidays callers to calendar-list-holidays,
Glenn Morris <rgm@gnu.org>
parents: 82202
diff changeset
203 (autoload 'calendar-check-holidays "holidays")
65510
24f7082aa7af Don't require easymenu, since we don't use it.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 65145
diff changeset
204
66617
ed95f221960d (date, event): Don't declare as dynamic-var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 65919
diff changeset
205 (defun calendar-mouse-holidays (&optional event)
92647
8b4648ec6f76 (cal-menu-holiday-window-suffix)
Glenn Morris <rgm@gnu.org>
parents: 92549
diff changeset
206 "Pop up menu of holidays for mouse selected date.
8b4648ec6f76 (cal-menu-holiday-window-suffix)
Glenn Morris <rgm@gnu.org>
parents: 92549
diff changeset
207 EVENT is the event that invoked this command."
66617
ed95f221960d (date, event): Don't declare as dynamic-var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 65919
diff changeset
208 (interactive "e")
93843
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
209 (let* ((date (cal-menu-event-to-date))
93092
6c0dbddcd03a (calendar-other-dates): Declare it, and removes the declarations it replaces.
Glenn Morris <rgm@gnu.org>
parents: 92962
diff changeset
210 (title (format "Holidays for %s" (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
211 (selection
39524
291264d596e9 (cal-menu-x-popup-menu): New function,
Eli Zaretskii <eliz@gnu.org>
parents: 39133
diff changeset
212 (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
213 event
93092
6c0dbddcd03a (calendar-other-dates): Declare it, and removes the declarations it replaces.
Glenn Morris <rgm@gnu.org>
parents: 92962
diff changeset
214 (list title
93328
15b0834c93df (cal-menu-holidays-menu, cal-menu-list-holidays-year)
Glenn Morris <rgm@gnu.org>
parents: 93224
diff changeset
215 (append (list title)
15b0834c93df (cal-menu-holidays-menu, cal-menu-list-holidays-year)
Glenn Morris <rgm@gnu.org>
parents: 93224
diff changeset
216 (or (mapcar 'list (calendar-check-holidays date))
15b0834c93df (cal-menu-holidays-menu, cal-menu-list-holidays-year)
Glenn Morris <rgm@gnu.org>
parents: 93224
diff changeset
217 '("None")))))))
22413
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
218 (and selection (call-interactively selection))))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
219
93328
15b0834c93df (cal-menu-holidays-menu, cal-menu-list-holidays-year)
Glenn Morris <rgm@gnu.org>
parents: 93224
diff changeset
220 (autoload 'diary-list-entries "diary-lib")
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93793
diff changeset
221 (defvar diary-show-holidays-flag) ; only called from calendar.el
92549
389da10cb238 (holidays-in-diary-buffer): Declare for compiler.
Glenn Morris <rgm@gnu.org>
parents: 87769
diff changeset
222
66617
ed95f221960d (date, event): Don't declare as dynamic-var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 65919
diff changeset
223 (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
224 "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
225 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
226 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
227 is non-nil."
66617
ed95f221960d (date, event): Don't declare as dynamic-var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 65919
diff changeset
228 (interactive "i\ni\ne")
93843
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
229 (let* ((date (or date (cal-menu-event-to-date)))
93092
6c0dbddcd03a (calendar-other-dates): Declare it, and removes the declarations it replaces.
Glenn Morris <rgm@gnu.org>
parents: 92962
diff changeset
230 (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
231 (diary-list-include-blanks nil)
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
232 (diary-display-hook 'ignore)
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
233 (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
234 (mapcar (lambda (x) (split-string (cadr x) "\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
235 (diary-list-entries date 1 'list-only)))
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93793
diff changeset
236 (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
237 (calendar-check-holidays date)))
52230
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
238 (title (concat "Diary entries "
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
239 (if diary (format "from %s " diary) "")
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
240 "for "
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
241 (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
242 (selection
39524
291264d596e9 (cal-menu-x-popup-menu): New function,
Eli Zaretskii <eliz@gnu.org>
parents: 39133
diff changeset
243 (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
244 event
52230
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
245 (list title
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
246 (append
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
247 (list title)
65510
24f7082aa7af Don't require easymenu, since we don't use it.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 65145
diff changeset
248 (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
249 (if holidays
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
250 (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
251 (if 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
252 (mapcar 'list (apply 'append diary-entries))
52230
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
253 '("None")))))))
22413
be2f536a1358 Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 22365
diff changeset
254 (and selection (call-interactively selection))))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
255
9766
71c37f31a02d Bind new function to mouse.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 9734
diff changeset
256 (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
257 "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
258 (interactive)
52230
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
259 (calendar-mouse-view-diary-entries
93843
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
260 (cal-menu-event-to-date)
52230
75388c0f3104 Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 52116
diff changeset
261 (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
262
9710
b5fb08fb2cb3 Put insertion of diary entry on daily menu.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 8308
diff changeset
263 (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
264 "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
265 (interactive)
b5fb08fb2cb3 Put insertion of diary entry on daily menu.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 8308
diff changeset
266 (save-excursion
93843
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
267 (calendar-mouse-goto-date (cal-menu-event-to-date))
93793
5c3eedca8e41 Update for diary-lib name changes.
Glenn Morris <rgm@gnu.org>
parents: 93742
diff changeset
268 (diary-insert-entry nil)))
9710
b5fb08fb2cb3 Put insertion of diary entry on daily menu.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 8308
diff changeset
269
7412
f067e1a5ceb4 (calendar-mouse-set-mark): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7403
diff changeset
270 (defun calendar-mouse-set-mark ()
f067e1a5ceb4 (calendar-mouse-set-mark): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7403
diff changeset
271 "Mark the date under the cursor."
f067e1a5ceb4 (calendar-mouse-set-mark): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7403
diff changeset
272 (interactive)
f067e1a5ceb4 (calendar-mouse-set-mark): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7403
diff changeset
273 (save-excursion
93843
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
274 (calendar-mouse-goto-date (cal-menu-event-to-date))
7412
f067e1a5ceb4 (calendar-mouse-set-mark): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7403
diff changeset
275 (calendar-set-mark nil)))
f067e1a5ceb4 (calendar-mouse-set-mark): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7403
diff changeset
276
93843
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
277 (defun calendar-mouse-tex-day ()
13194
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
278 "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
279 (interactive)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
280 (save-excursion
93843
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
281 (calendar-mouse-goto-date (cal-menu-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
282 (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
283
93843
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
284 (defun calendar-mouse-tex-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
285 "One page calendar for week indicated by cursor.
92907
d89709effe07 (displayed-year): Move declaration where needed.
Glenn Morris <rgm@gnu.org>
parents: 92854
diff changeset
286 Holidays are included if `cal-tex-holidays' is non-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
287 (interactive)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
288 (save-excursion
93843
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
289 (calendar-mouse-goto-date (cal-menu-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
290 (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
291
93843
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
292 (defun calendar-mouse-tex-week2 ()
13194
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
293 "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
294 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
295 (interactive)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
296 (save-excursion
93843
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
297 (calendar-mouse-goto-date (cal-menu-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
298 (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
299
93843
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
300 (defun calendar-mouse-tex-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
301 "One page calendar for week indicated by cursor.
92907
d89709effe07 (displayed-year): Move declaration where needed.
Glenn Morris <rgm@gnu.org>
parents: 92854
diff changeset
302 Holidays are included if `cal-tex-holidays' is non-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
303 (interactive)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
304 (save-excursion
93843
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
305 (calendar-mouse-goto-date (cal-menu-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
306 (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
307
93843
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
308 (defun calendar-mouse-tex-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
309 "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
310 (interactive)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
311 (save-excursion
93843
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
312 (calendar-mouse-goto-date (cal-menu-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
313 (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
314
93843
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
315 (defun calendar-mouse-tex-filofax-daily ()
19975
927a8710de05 (cal-tex-mouse-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19950
diff changeset
316 "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
317 (interactive)
927a8710de05 (cal-tex-mouse-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19950
diff changeset
318 (save-excursion
93843
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
319 (calendar-mouse-goto-date (cal-menu-event-to-date))
19975
927a8710de05 (cal-tex-mouse-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19950
diff changeset
320 (cal-tex-cursor-filofax-daily nil)))
927a8710de05 (cal-tex-mouse-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents: 19950
diff changeset
321
93843
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
322 (defun calendar-mouse-tex-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
323 "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
324 (interactive)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
325 (save-excursion
93843
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
326 (calendar-mouse-goto-date (cal-menu-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
327 (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
328
93843
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
329 (defun calendar-mouse-tex-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
330 "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
331 (interactive)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
332 (save-excursion
93843
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
333 (calendar-mouse-goto-date (cal-menu-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
334 (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
335
93843
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
336 (defun calendar-mouse-tex-month ()
13194
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
337 "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
338 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
339 (interactive)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
340 (save-excursion
93843
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
341 (calendar-mouse-goto-date (cal-menu-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
342 (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
343
93843
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
344 (defun calendar-mouse-tex-month-landscape ()
13194
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
345 "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
346 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
347 (interactive)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
348 (save-excursion
93843
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
349 (calendar-mouse-goto-date (cal-menu-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
350 (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
351
93843
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
352 (defun calendar-mouse-tex-year ()
13194
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
353 "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
354 (interactive)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
355 (save-excursion
93843
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
356 (calendar-mouse-goto-date (cal-menu-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
357 (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
358
93843
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
359 (defun calendar-mouse-tex-filofax-year ()
13194
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
360 "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
361 (interactive)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
362 (save-excursion
93843
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
363 (calendar-mouse-goto-date (cal-menu-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
364 (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
365
93843
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
366 (defun calendar-mouse-tex-year-landscape ()
13194
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
367 "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
368 (interactive)
7e90c5fce35f Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents: 13063
diff changeset
369 (save-excursion
93843
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
370 (calendar-mouse-goto-date (cal-menu-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
371 (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
372
66617
ed95f221960d (date, event): Don't declare as dynamic-var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 65919
diff changeset
373 (defun calendar-mouse-print-dates (&optional event)
92647
8b4648ec6f76 (cal-menu-holiday-window-suffix)
Glenn Morris <rgm@gnu.org>
parents: 92549
diff changeset
374 "Pop up menu of equivalent dates to mouse selected date.
8b4648ec6f76 (cal-menu-holiday-window-suffix)
Glenn Morris <rgm@gnu.org>
parents: 92549
diff changeset
375 EVENT is the event that invoked this command."
66617
ed95f221960d (date, event): Don't declare as dynamic-var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 65919
diff changeset
376 (interactive "e")
93843
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
377 (let* ((date (cal-menu-event-to-date))
93092
6c0dbddcd03a (calendar-other-dates): Declare it, and removes the declarations it replaces.
Glenn Morris <rgm@gnu.org>
parents: 92962
diff changeset
378 (title (format "%s (Gregorian)" (calendar-date-string date)))
6c0dbddcd03a (calendar-other-dates): Declare it, and removes the declarations it replaces.
Glenn Morris <rgm@gnu.org>
parents: 92962
diff changeset
379 (selection
6c0dbddcd03a (calendar-other-dates): Declare it, and removes the declarations it replaces.
Glenn Morris <rgm@gnu.org>
parents: 92962
diff changeset
380 (cal-menu-x-popup-menu
6c0dbddcd03a (calendar-other-dates): Declare it, and removes the declarations it replaces.
Glenn Morris <rgm@gnu.org>
parents: 92962
diff changeset
381 event
6c0dbddcd03a (calendar-other-dates): Declare it, and removes the declarations it replaces.
Glenn Morris <rgm@gnu.org>
parents: 92962
diff changeset
382 (list title
6c0dbddcd03a (calendar-other-dates): Declare it, and removes the declarations it replaces.
Glenn Morris <rgm@gnu.org>
parents: 92962
diff changeset
383 (append (list title)
6c0dbddcd03a (calendar-other-dates): Declare it, and removes the declarations it replaces.
Glenn Morris <rgm@gnu.org>
parents: 92962
diff changeset
384 (mapcar 'list (calendar-other-dates date)))))))
6c0dbddcd03a (calendar-other-dates): Declare it, and removes the declarations it replaces.
Glenn Morris <rgm@gnu.org>
parents: 92962
diff changeset
385 (and selection (call-interactively selection))))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
386
92647
8b4648ec6f76 (cal-menu-holiday-window-suffix)
Glenn Morris <rgm@gnu.org>
parents: 92549
diff changeset
387 (defun cal-menu-set-date-title (menu)
8b4648ec6f76 (cal-menu-holiday-window-suffix)
Glenn Morris <rgm@gnu.org>
parents: 92549
diff changeset
388 "Convert date of last event to title suitable for MENU."
8b4648ec6f76 (cal-menu-holiday-window-suffix)
Glenn Morris <rgm@gnu.org>
parents: 92549
diff changeset
389 (easy-menu-filter-return
93843
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
390 menu (calendar-date-string (cal-menu-event-to-date t) t nil)))
92647
8b4648ec6f76 (cal-menu-holiday-window-suffix)
Glenn Morris <rgm@gnu.org>
parents: 92549
diff changeset
391
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
392 (easy-menu-define cal-menu-context-mouse-menu 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
393 "Pop up menu for Mouse-2 for selected date in the calendar window."
93843
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
394 '("cal-menu-mouse2" :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
395 "--"
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
396 ["Holidays" calendar-mouse-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
397 ["Mark date" calendar-mouse-set-mark]
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
398 ["Sunrise/sunset" calendar-mouse-sunrise/sunset]
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
399 ["Other calendars" calendar-mouse-print-dates]
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
400 ("Prepare LaTeX buffer"
93843
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
401 ["Daily (1 page)" calendar-mouse-tex-day]
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
402 ["Weekly (1 page)" calendar-mouse-tex-week]
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
403 ["Weekly (2 pages)" calendar-mouse-tex-week2]
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
404 ["Weekly (other style; 1 page)" calendar-mouse-tex-week-iso]
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
405 ["Weekly (yet another style; 1 page)" calendar-mouse-tex-week-monday]
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
406 ["Monthly" calendar-mouse-tex-month]
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
407 ["Monthly (landscape)" calendar-mouse-tex-month-landscape]
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
408 ["Yearly" calendar-mouse-tex-year]
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
409 ["Yearly (landscape)" calendar-mouse-tex-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
410 ("Filofax styles"
93843
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
411 ["Filofax Daily (one-day-per-page)" calendar-mouse-tex-filofax-daily]
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
412 ["Filofax Weekly (2-weeks-at-a-glance)" calendar-mouse-tex-filofax-2week]
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
413 ["Filofax Weekly (week-at-a-glance)" calendar-mouse-tex-filofax-week]
61357badb5fa (cal-menu-event-to-date): Rename calendar-event-to-date. Update callers.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
414 ["Filofax Yearly" calendar-mouse-tex-filofax-year]))
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
415 ["Diary entries" calendar-mouse-view-diary-entries]
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
416 ["Insert diary entry" calendar-mouse-insert-diary-entry]
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
417 ["Other diary file entries" calendar-mouse-view-other-diary-entries]))
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
418
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
419 (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
420 "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
421 '("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
422 ["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
423 ["Scroll backward" calendar-scroll-right-three-months]
93793
5c3eedca8e41 Update for diary-lib name changes.
Glenn Morris <rgm@gnu.org>
parents: 93742
diff changeset
424 ["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
425 ["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
426 ["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
427 ["Unmark" calendar-unmark]
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
428 ["Lunar phases" calendar-phases-of-moon]
8410b0ff0e7a Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 77279
diff changeset
429 ["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
430 ["Exit calendar" calendar-exit]))
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
431
93092
6c0dbddcd03a (calendar-other-dates): Declare it, and removes the declarations it replaces.
Glenn Morris <rgm@gnu.org>
parents: 92962
diff changeset
432 ;; 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
433 (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
434 "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
435 (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
436 "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
437
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
438 (run-hooks 'cal-menu-load-hook)
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
439
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
440 (provide 'cal-menu)
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
441
66617
ed95f221960d (date, event): Don't declare as dynamic-var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 65919
diff changeset
442 ;; arch-tag: aa81cf73-ce89-48a4-97ec-9ef861e87fe9
5701
b2f1e7bb5d00 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
443 ;;; cal-menu.el ends here