Mercurial > emacs
annotate lisp/calendar/cal-menu.el @ 93162:9ad0e809937c
(vc-hg-state): Return 'edited for removed files.
author | Dan Nicolaescu <dann@ics.uci.edu> |
---|---|
date | Sun, 23 Mar 2008 19:31:22 +0000 |
parents | 6c0dbddcd03a |
children | e800589311a9 |
rev | line source |
---|---|
5701 | 1 ;;; cal-menu.el --- calendar functions for menu bar and popup menu support |
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 | 5 |
6 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> | |
92854 | 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 | 9 ;; Keywords: calendar |
10 ;; Human-Keywords: calendar, popup menus, menu bar | |
11 | |
12 ;; This file is part of GNU Emacs. | |
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 | 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 | 25 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
64085 | 26 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
27 ;; Boston, MA 02110-1301, USA. | |
5701 | 28 |
29 ;;; Commentary: | |
30 | |
31 ;; This collection of functions implements menu bar and popup menu support for | |
32 ;; calendar.el. | |
33 | |
34 ;;; Code: | |
35 | |
86491 | 36 ;; The code in this file is only called from calendar.el, but can't |
37 ;; require it (to supress undefined function warnings from compiler) | |
38 ;; without a recursive require. | |
86514 | 39 ;; All these functions are either autoloaded, or autoloaded or defined |
40 ;; in calendar.el. | |
41 (declare-function calendar-increment-month "calendar" (n &optional mon yr)) | |
42 (declare-function calendar-month-name "calendar" (month &optional abbrev)) | |
43 (declare-function extract-calendar-year "calendar" (date)) | |
44 (declare-function calendar-cursor-to-date "calendar" (&optional error)) | |
45 (declare-function holiday-list "holidays" (y1 y2 &optional l label)) | |
46 (declare-function calendar-sunrise-sunset "solar" nil) | |
47 (declare-function calendar-current-date "calendar" nil) | |
48 (declare-function calendar-cursor-holidays "holidays" nil) | |
49 (declare-function calendar-date-string "calendar" | |
50 (date &optional abbreviate nodayname)) | |
51 (declare-function insert-diary-entry "diary-lib" (arg)) | |
52 (declare-function calendar-set-mark "calendar" (arg)) | |
53 (declare-function cal-tex-cursor-day "cal-tex" (&optional arg)) | |
54 (declare-function cal-tex-cursor-week "cal-tex" (&optional arg)) | |
55 (declare-function cal-tex-cursor-week2 "cal-tex" (&optional arg)) | |
56 (declare-function cal-tex-cursor-week-iso "cal-tex" (&optional arg)) | |
93092
6c0dbddcd03a
(calendar-other-dates): Declare it, and removes the declarations it replaces.
Glenn Morris <rgm@gnu.org>
parents:
92962
diff
changeset
|
57 (declare-function cal-tex-cursor-week-monday "cal-tex" (&optional arg)) |
6c0dbddcd03a
(calendar-other-dates): Declare it, and removes the declarations it replaces.
Glenn Morris <rgm@gnu.org>
parents:
92962
diff
changeset
|
58 (declare-function cal-tex-cursor-filofax-daily "cal-tex" (&optional arg)) |
6c0dbddcd03a
(calendar-other-dates): Declare it, and removes the declarations it replaces.
Glenn Morris <rgm@gnu.org>
parents:
92962
diff
changeset
|
59 (declare-function cal-tex-cursor-filofax-2week "cal-tex" (&optional arg)) |
6c0dbddcd03a
(calendar-other-dates): Declare it, and removes the declarations it replaces.
Glenn Morris <rgm@gnu.org>
parents:
92962
diff
changeset
|
60 (declare-function cal-tex-cursor-filofax-week "cal-tex" (&optional arg)) |
6c0dbddcd03a
(calendar-other-dates): Declare it, and removes the declarations it replaces.
Glenn Morris <rgm@gnu.org>
parents:
92962
diff
changeset
|
61 (declare-function cal-tex-cursor-month "cal-tex" (arg)) |
6c0dbddcd03a
(calendar-other-dates): Declare it, and removes the declarations it replaces.
Glenn Morris <rgm@gnu.org>
parents:
92962
diff
changeset
|
62 (declare-function cal-tex-cursor-month-landscape "cal-tex" (&optional arg)) |
6c0dbddcd03a
(calendar-other-dates): Declare it, and removes the declarations it replaces.
Glenn Morris <rgm@gnu.org>
parents:
92962
diff
changeset
|
63 (declare-function cal-tex-cursor-year "cal-tex" (&optional arg)) |
6c0dbddcd03a
(calendar-other-dates): Declare it, and removes the declarations it replaces.
Glenn Morris <rgm@gnu.org>
parents:
92962
diff
changeset
|
64 (declare-function cal-tex-cursor-filofax-year "cal-tex" (&optional arg)) |
6c0dbddcd03a
(calendar-other-dates): Declare it, and removes the declarations it replaces.
Glenn Morris <rgm@gnu.org>
parents:
92962
diff
changeset
|
65 (declare-function cal-tex-cursor-year-landscape "cal-tex" (&optional arg)) |
6c0dbddcd03a
(calendar-other-dates): Declare it, and removes the declarations it replaces.
Glenn Morris <rgm@gnu.org>
parents:
92962
diff
changeset
|
66 (declare-function calendar-other-dates "calendar" (date)) |
6c0dbddcd03a
(calendar-other-dates): Declare it, and removes the declarations it replaces.
Glenn Morris <rgm@gnu.org>
parents:
92962
diff
changeset
|
67 (declare-function calendar-goto-date "cal-move" (date)) |
86491 | 68 |
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
|
69 (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
|
70 '("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
|
71 ["Lunar Phases" calendar-phases-of-moon])) |
5701 | 72 |
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
|
73 (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
|
74 '("Diary" |
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 ["Other File" view-other-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
|
76 ["Cursor Date" diary-view-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
|
77 ["Mark All" mark-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
|
78 ["Show All" diary-show-all-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
|
79 ["Insert Diary Entry" 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
|
80 ["Insert Weekly" insert-weekly-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
|
81 ["Insert Monthly" insert-monthly-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
|
82 ["Insert Yearly" insert-yearly-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
|
83 ["Insert Anniversary" insert-anniversary-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
|
84 ["Insert Block" insert-block-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
|
85 ["Insert Cyclic" insert-cyclic-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
|
86 ("Insert Baha'i" |
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 [" " nil :suffix (calendar-bahai-date-string (calendar-cursor-to-date))] |
84592
a2988c19b72c
(cal-menu-diary-menu, cal-menu-goto-menu):
Glenn Morris <rgm@gnu.org>
parents:
84553
diff
changeset
|
88 ["One time" diary-bahai-insert-entry] |
a2988c19b72c
(cal-menu-diary-menu, cal-menu-goto-menu):
Glenn Morris <rgm@gnu.org>
parents:
84553
diff
changeset
|
89 ["Monthly" diary-bahai-insert-monthly-entry] |
a2988c19b72c
(cal-menu-diary-menu, cal-menu-goto-menu):
Glenn Morris <rgm@gnu.org>
parents:
84553
diff
changeset
|
90 ["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
|
91 ("Insert Islamic" |
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 [" " nil :suffix (calendar-islamic-date-string (calendar-cursor-to-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
|
93 ["One time" insert-islamic-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
|
94 ["Monthly" insert-monthly-islamic-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
|
95 ["Yearly" insert-yearly-islamic-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
|
96 ("Insert Hebrew" |
8410b0ff0e7a
Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
77279
diff
changeset
|
97 [" " nil :suffix (calendar-hebrew-date-string (calendar-cursor-to-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
|
98 ["One time" insert-hebrew-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
|
99 ["Monthly" insert-monthly-hebrew-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
|
100 ["Yearly" insert-yearly-hebrew-diary-entry]))) |
5701 | 101 |
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
|
102 (defun cal-menu-holiday-window-suffix () |
92647
8b4648ec6f76
(cal-menu-holiday-window-suffix)
Glenn Morris <rgm@gnu.org>
parents:
92549
diff
changeset
|
103 "Return a string suffix for the \"Window\" entry in `cal-menu-holidays-menu'." |
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
|
104 (let ((my1 (calendar-increment-month -1)) |
8410b0ff0e7a
Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
77279
diff
changeset
|
105 (my2 (calendar-increment-month 1))) |
8410b0ff0e7a
Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
77279
diff
changeset
|
106 (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
|
107 (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
|
108 (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
|
109 (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
|
110 (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
|
111 (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
|
112 (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
|
113 (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
|
114 (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
|
115 (cdr my2))))) |
5701 | 116 |
92907
d89709effe07
(displayed-year): Move declaration where needed.
Glenn Morris <rgm@gnu.org>
parents:
92854
diff
changeset
|
117 (defvar displayed-year) ; from generate-calendar |
d89709effe07
(displayed-year): Move declaration where needed.
Glenn Morris <rgm@gnu.org>
parents:
92854
diff
changeset
|
118 |
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
|
119 (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
|
120 `("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
|
121 ["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
|
122 :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
|
123 :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
|
124 ["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
|
125 :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
|
126 ["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
|
127 :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
|
128 "--" |
8410b0ff0e7a
Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
77279
diff
changeset
|
129 ,@(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
|
130 ;; 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
|
131 ;; 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
|
132 ;; an easymenu bug: |
86445
8385b57c5ce6
(cal-menu-holidays-menu): Use :label rather than :suffix.
Glenn Morris <rgm@gnu.org>
parents:
86430
diff
changeset
|
133 ;; 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
|
134 ;; 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
|
135 (dotimes (i 11) |
86445
8385b57c5ce6
(cal-menu-holidays-menu): Use :label rather than :suffix.
Glenn Morris <rgm@gnu.org>
parents:
86430
diff
changeset
|
136 (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
|
137 `(lambda () |
4c73f7497804
Revert previous commit, made without ChangeLog entry.
Glenn Morris <rgm@gnu.org>
parents:
86414
diff
changeset
|
138 (interactive) |
4c73f7497804
Revert previous commit, made without ChangeLog entry.
Glenn Morris <rgm@gnu.org>
parents:
86414
diff
changeset
|
139 (holiday-list (+ displayed-year ,(- i 5)) |
4c73f7497804
Revert previous commit, made without ChangeLog entry.
Glenn Morris <rgm@gnu.org>
parents:
86414
diff
changeset
|
140 (+ displayed-year ,(- i 5)))) |
86445
8385b57c5ce6
(cal-menu-holidays-menu): Use :label rather than :suffix.
Glenn Morris <rgm@gnu.org>
parents:
86430
diff
changeset
|
141 :label `(format "For Year %d" |
8385b57c5ce6
(cal-menu-holidays-menu): Use :label rather than :suffix.
Glenn Morris <rgm@gnu.org>
parents:
86430
diff
changeset
|
142 (+ displayed-year ,(- i 5)))) |
86430
4c73f7497804
Revert previous commit, made without ChangeLog entry.
Glenn Morris <rgm@gnu.org>
parents:
86414
diff
changeset
|
143 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
|
144 (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
|
145 "--" |
8410b0ff0e7a
Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
77279
diff
changeset
|
146 ["Unmark Calendar" 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
|
147 ["Mark Holidays" mark-calendar-holidays])) |
5701 | 148 |
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
|
149 (defconst cal-menu-goto-menu |
92962
b3d9a4a54d89
(cal-menu-goto-menu): Use "Go To".
Glenn Morris <rgm@gnu.org>
parents:
92907
diff
changeset
|
150 '("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
|
151 ["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
|
152 ["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
|
153 ["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
|
154 ["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
|
155 ["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
|
156 ["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
|
157 ["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
|
158 ["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
|
159 ["Day of Year" calendar-goto-day-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
|
160 ["ISO Week" calendar-goto-iso-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
|
161 ["ISO Date" calendar-goto-iso-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
|
162 ["Astronomical Date" calendar-goto-astro-day-number] |
8410b0ff0e7a
Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
77279
diff
changeset
|
163 ["Hebrew Date" calendar-goto-hebrew-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
|
164 ["Persian Date" calendar-goto-persian-date] |
84592
a2988c19b72c
(cal-menu-diary-menu, cal-menu-goto-menu):
Glenn Morris <rgm@gnu.org>
parents:
84553
diff
changeset
|
165 ["Baha'i Date" calendar-bahai-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
|
166 ["Islamic Date" calendar-goto-islamic-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
|
167 ["Julian Date" calendar-goto-julian-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
|
168 ["Chinese Date" calendar-goto-chinese-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
|
169 ["Coptic Date" calendar-goto-coptic-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
|
170 ["Ethiopic Date" calendar-goto-ethiopic-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
|
171 ("Mayan 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
|
172 ["Next Tzolkin" calendar-next-tzolkin-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
|
173 ["Previous Tzolkin" calendar-previous-tzolkin-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
|
174 ["Next Haab" calendar-next-haab-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
|
175 ["Previous Haab" calendar-previous-haab-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
|
176 ["Next Round" calendar-next-calendar-round-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
|
177 ["Previous Round" calendar-previous-calendar-round-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
|
178 ["French Date" calendar-goto-french-date])) |
5701 | 179 |
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
|
180 (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
|
181 '("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
|
182 ["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
|
183 ["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
|
184 ["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
|
185 ["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
|
186 ["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
|
187 ["Backward 1 Year" "4\ev"])) |
52230
75388c0f3104
Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents:
52116
diff
changeset
|
188 |
39524
291264d596e9
(cal-menu-x-popup-menu): New function,
Eli Zaretskii <eliz@gnu.org>
parents:
39133
diff
changeset
|
189 (defun cal-menu-x-popup-menu (position menu) |
92647
8b4648ec6f76
(cal-menu-holiday-window-suffix)
Glenn Morris <rgm@gnu.org>
parents:
92549
diff
changeset
|
190 "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
|
191 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
|
192 (if (display-popup-menus-p) |
291264d596e9
(cal-menu-x-popup-menu): New function,
Eli Zaretskii <eliz@gnu.org>
parents:
39133
diff
changeset
|
193 (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
|
194 (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
|
195 |
17667
fd527e9aa377
(cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents:
17553
diff
changeset
|
196 (defun cal-menu-list-holidays-year () |
fd527e9aa377
(cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents:
17553
diff
changeset
|
197 "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
|
198 (interactive) |
fd527e9aa377
(cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents:
17553
diff
changeset
|
199 (let ((year (extract-calendar-year (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
|
200 (holiday-list year year))) |
17667
fd527e9aa377
(cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents:
17553
diff
changeset
|
201 |
fd527e9aa377
(cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents:
17553
diff
changeset
|
202 (defun cal-menu-list-holidays-following-year () |
fd527e9aa377
(cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents:
17553
diff
changeset
|
203 "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
|
204 (interactive) |
fd527e9aa377
(cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents:
17553
diff
changeset
|
205 (let ((year (1+ (extract-calendar-year (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
|
206 (holiday-list year year))) |
17667
fd527e9aa377
(cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents:
17553
diff
changeset
|
207 |
fd527e9aa377
(cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents:
17553
diff
changeset
|
208 (defun cal-menu-list-holidays-previous-year () |
fd527e9aa377
(cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents:
17553
diff
changeset
|
209 "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
|
210 (interactive) |
fd527e9aa377
(cal-menu-list-holidays-following-year)
Richard M. Stallman <rms@gnu.org>
parents:
17553
diff
changeset
|
211 (let ((year (1- (extract-calendar-year (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
|
212 (holiday-list year year))) |
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
|
213 |
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
|
214 (defun calendar-event-to-date (&optional error) |
27fdaecd7cb1
(calendar-mode-map): Change binding of Mouse-2. Bind Mouse-3.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
7412
diff
changeset
|
215 "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
|
216 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
|
217 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
|
218 (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
|
219 (window-buffer (posn-window (event-start last-input-event))) |
5701 | 220 (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
|
221 (calendar-cursor-to-date error))) |
5701 | 222 |
92907
d89709effe07
(displayed-year): Move declaration where needed.
Glenn Morris <rgm@gnu.org>
parents:
92854
diff
changeset
|
223 (defun calendar-mouse-goto-date (date) |
92962
b3d9a4a54d89
(cal-menu-goto-menu): Use "Go To".
Glenn Morris <rgm@gnu.org>
parents:
92907
diff
changeset
|
224 "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
|
225 (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
|
226 (calendar-goto-date date)) |
d89709effe07
(displayed-year): Move declaration where needed.
Glenn Morris <rgm@gnu.org>
parents:
92854
diff
changeset
|
227 |
5701 | 228 (defun calendar-mouse-sunrise/sunset () |
229 "Show sunrise/sunset times for mouse-selected date." | |
230 (interactive) | |
231 (save-excursion | |
14951
15ab8e95a50a
(calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents:
14915
diff
changeset
|
232 (calendar-mouse-goto-date (calendar-event-to-date)) |
5701 | 233 (calendar-sunrise-sunset))) |
234 | |
22031
879df83433a1
Minor fix to earlier changes today.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22027
diff
changeset
|
235 (defun cal-menu-today-holidays () |
879df83433a1
Minor fix to earlier changes today.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22027
diff
changeset
|
236 "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
|
237 (interactive) |
879df83433a1
Minor fix to earlier changes today.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22027
diff
changeset
|
238 (save-excursion |
879df83433a1
Minor fix to earlier changes today.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22027
diff
changeset
|
239 (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
|
240 (calendar-cursor-holidays))) |
879df83433a1
Minor fix to earlier changes today.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22027
diff
changeset
|
241 |
84553
383791965ba9
Rename all list-calendar-holidays callers to calendar-list-holidays,
Glenn Morris <rgm@gnu.org>
parents:
82202
diff
changeset
|
242 (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
|
243 (autoload 'diary-list-entries "diary-lib") |
24f7082aa7af
Don't require easymenu, since we don't use it.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
65145
diff
changeset
|
244 |
66617
ed95f221960d
(date, event): Don't declare as dynamic-var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
65919
diff
changeset
|
245 (defun calendar-mouse-holidays (&optional event) |
92647
8b4648ec6f76
(cal-menu-holiday-window-suffix)
Glenn Morris <rgm@gnu.org>
parents:
92549
diff
changeset
|
246 "Pop up menu of holidays for mouse selected date. |
8b4648ec6f76
(cal-menu-holiday-window-suffix)
Glenn Morris <rgm@gnu.org>
parents:
92549
diff
changeset
|
247 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
|
248 (interactive "e") |
22413
be2f536a1358
Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22365
diff
changeset
|
249 (let* ((date (calendar-event-to-date)) |
84553
383791965ba9
Rename all list-calendar-holidays callers to calendar-list-holidays,
Glenn Morris <rgm@gnu.org>
parents:
82202
diff
changeset
|
250 (l (mapcar 'list (calendar-check-holidays date))) |
93092
6c0dbddcd03a
(calendar-other-dates): Declare it, and removes the declarations it replaces.
Glenn Morris <rgm@gnu.org>
parents:
92962
diff
changeset
|
251 (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
|
252 (selection |
39524
291264d596e9
(cal-menu-x-popup-menu): New function,
Eli Zaretskii <eliz@gnu.org>
parents:
39133
diff
changeset
|
253 (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
|
254 event |
93092
6c0dbddcd03a
(calendar-other-dates): Declare it, and removes the declarations it replaces.
Glenn Morris <rgm@gnu.org>
parents:
92962
diff
changeset
|
255 (list title |
6c0dbddcd03a
(calendar-other-dates): Declare it, and removes the declarations it replaces.
Glenn Morris <rgm@gnu.org>
parents:
92962
diff
changeset
|
256 (append (list title) (or l '("None"))))))) |
22413
be2f536a1358
Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22365
diff
changeset
|
257 (and selection (call-interactively selection)))) |
5701 | 258 |
92549
389da10cb238
(holidays-in-diary-buffer): Declare for compiler.
Glenn Morris <rgm@gnu.org>
parents:
87769
diff
changeset
|
259 (defvar holidays-in-diary-buffer) ; only called from calendar.el |
389da10cb238
(holidays-in-diary-buffer): Declare for compiler.
Glenn Morris <rgm@gnu.org>
parents:
87769
diff
changeset
|
260 |
66617
ed95f221960d
(date, event): Don't declare as dynamic-var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
65919
diff
changeset
|
261 (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
|
262 "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
|
263 Use optional DATE and alternative file DIARY. EVENT is the event |
8b4648ec6f76
(cal-menu-holiday-window-suffix)
Glenn Morris <rgm@gnu.org>
parents:
92549
diff
changeset
|
264 that invoked this command. Shows holidays if `holidays-in-diary-buffer' |
8b4648ec6f76
(cal-menu-holiday-window-suffix)
Glenn Morris <rgm@gnu.org>
parents:
92549
diff
changeset
|
265 is non-nil." |
66617
ed95f221960d
(date, event): Don't declare as dynamic-var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
65919
diff
changeset
|
266 (interactive "i\ni\ne") |
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
|
267 (let* ((date (or date (calendar-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
|
268 (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
|
269 (diary-list-include-blanks nil) |
75388c0f3104
Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents:
52116
diff
changeset
|
270 (diary-display-hook 'ignore) |
75388c0f3104
Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents:
52116
diff
changeset
|
271 (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
|
272 (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
|
273 (diary-list-entries date 1 'list-only))) |
52230
75388c0f3104
Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents:
52116
diff
changeset
|
274 (holidays (if holidays-in-diary-buffer |
84553
383791965ba9
Rename all list-calendar-holidays callers to calendar-list-holidays,
Glenn Morris <rgm@gnu.org>
parents:
82202
diff
changeset
|
275 (calendar-check-holidays date))) |
52230
75388c0f3104
Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents:
52116
diff
changeset
|
276 (title (concat "Diary entries " |
75388c0f3104
Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents:
52116
diff
changeset
|
277 (if diary (format "from %s " diary) "") |
75388c0f3104
Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents:
52116
diff
changeset
|
278 "for " |
75388c0f3104
Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents:
52116
diff
changeset
|
279 (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
|
280 (selection |
39524
291264d596e9
(cal-menu-x-popup-menu): New function,
Eli Zaretskii <eliz@gnu.org>
parents:
39133
diff
changeset
|
281 (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
|
282 event |
52230
75388c0f3104
Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents:
52116
diff
changeset
|
283 (list title |
75388c0f3104
Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents:
52116
diff
changeset
|
284 (append |
75388c0f3104
Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents:
52116
diff
changeset
|
285 (list title) |
65510
24f7082aa7af
Don't require easymenu, since we don't use it.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
65145
diff
changeset
|
286 (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
|
287 (if holidays |
75388c0f3104
Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents:
52116
diff
changeset
|
288 (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
|
289 (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
|
290 (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
|
291 '("None"))))))) |
22413
be2f536a1358
Rewrote calendar-mouse-holidays, calendar-mouse-view-diary-entries,
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22365
diff
changeset
|
292 (and selection (call-interactively selection)))) |
5701 | 293 |
9766
71c37f31a02d
Bind new function to mouse.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9734
diff
changeset
|
294 (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
|
295 "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
|
296 (interactive) |
52230
75388c0f3104
Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents:
52116
diff
changeset
|
297 (calendar-mouse-view-diary-entries |
75388c0f3104
Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents:
52116
diff
changeset
|
298 (calendar-event-to-date) |
75388c0f3104
Edward M. Reingold <reingold@emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents:
52116
diff
changeset
|
299 (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
|
300 |
9710
b5fb08fb2cb3
Put insertion of diary entry on daily menu.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
8308
diff
changeset
|
301 (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
|
302 "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
|
303 (interactive) |
b5fb08fb2cb3
Put insertion of diary entry on daily menu.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
8308
diff
changeset
|
304 (save-excursion |
14951
15ab8e95a50a
(calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents:
14915
diff
changeset
|
305 (calendar-mouse-goto-date (calendar-event-to-date)) |
9710
b5fb08fb2cb3
Put insertion of diary entry on daily menu.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
8308
diff
changeset
|
306 (insert-diary-entry nil))) |
b5fb08fb2cb3
Put insertion of diary entry on daily menu.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
8308
diff
changeset
|
307 |
7412
f067e1a5ceb4
(calendar-mouse-set-mark): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7403
diff
changeset
|
308 (defun calendar-mouse-set-mark () |
f067e1a5ceb4
(calendar-mouse-set-mark): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7403
diff
changeset
|
309 "Mark the date under the cursor." |
f067e1a5ceb4
(calendar-mouse-set-mark): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7403
diff
changeset
|
310 (interactive) |
f067e1a5ceb4
(calendar-mouse-set-mark): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7403
diff
changeset
|
311 (save-excursion |
14951
15ab8e95a50a
(calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents:
14915
diff
changeset
|
312 (calendar-mouse-goto-date (calendar-event-to-date)) |
7412
f067e1a5ceb4
(calendar-mouse-set-mark): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7403
diff
changeset
|
313 (calendar-set-mark nil))) |
f067e1a5ceb4
(calendar-mouse-set-mark): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7403
diff
changeset
|
314 |
13194
7e90c5fce35f
Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13063
diff
changeset
|
315 (defun cal-tex-mouse-day () |
7e90c5fce35f
Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13063
diff
changeset
|
316 "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
|
317 (interactive) |
7e90c5fce35f
Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13063
diff
changeset
|
318 (save-excursion |
14951
15ab8e95a50a
(calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents:
14915
diff
changeset
|
319 (calendar-mouse-goto-date (calendar-event-to-date)) |
13194
7e90c5fce35f
Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13063
diff
changeset
|
320 (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
|
321 |
7e90c5fce35f
Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13063
diff
changeset
|
322 (defun cal-tex-mouse-week () |
7e90c5fce35f
Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13063
diff
changeset
|
323 "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
|
324 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
|
325 (interactive) |
7e90c5fce35f
Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13063
diff
changeset
|
326 (save-excursion |
14951
15ab8e95a50a
(calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents:
14915
diff
changeset
|
327 (calendar-mouse-goto-date (calendar-event-to-date)) |
13194
7e90c5fce35f
Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13063
diff
changeset
|
328 (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
|
329 |
7e90c5fce35f
Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13063
diff
changeset
|
330 (defun cal-tex-mouse-week2 () |
7e90c5fce35f
Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13063
diff
changeset
|
331 "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
|
332 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
|
333 (interactive) |
7e90c5fce35f
Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13063
diff
changeset
|
334 (save-excursion |
14951
15ab8e95a50a
(calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents:
14915
diff
changeset
|
335 (calendar-mouse-goto-date (calendar-event-to-date)) |
13194
7e90c5fce35f
Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13063
diff
changeset
|
336 (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
|
337 |
13689
a04244ec8530
Repair function names from rms error in modifying!
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13285
diff
changeset
|
338 (defun cal-tex-mouse-week-iso () |
13194
7e90c5fce35f
Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13063
diff
changeset
|
339 "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
|
340 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
|
341 (interactive) |
7e90c5fce35f
Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13063
diff
changeset
|
342 (save-excursion |
14951
15ab8e95a50a
(calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents:
14915
diff
changeset
|
343 (calendar-mouse-goto-date (calendar-event-to-date)) |
13689
a04244ec8530
Repair function names from rms error in modifying!
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13285
diff
changeset
|
344 (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
|
345 |
13689
a04244ec8530
Repair function names from rms error in modifying!
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13285
diff
changeset
|
346 (defun cal-tex-mouse-week-monday () |
13194
7e90c5fce35f
Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13063
diff
changeset
|
347 "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
|
348 (interactive) |
7e90c5fce35f
Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13063
diff
changeset
|
349 (save-excursion |
14951
15ab8e95a50a
(calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents:
14915
diff
changeset
|
350 (calendar-mouse-goto-date (calendar-event-to-date)) |
13689
a04244ec8530
Repair function names from rms error in modifying!
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13285
diff
changeset
|
351 (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
|
352 |
19975
927a8710de05
(cal-tex-mouse-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents:
19950
diff
changeset
|
353 (defun cal-tex-mouse-filofax-daily () |
927a8710de05
(cal-tex-mouse-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents:
19950
diff
changeset
|
354 "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
|
355 (interactive) |
927a8710de05
(cal-tex-mouse-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents:
19950
diff
changeset
|
356 (save-excursion |
927a8710de05
(cal-tex-mouse-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents:
19950
diff
changeset
|
357 (calendar-mouse-goto-date (calendar-event-to-date)) |
927a8710de05
(cal-tex-mouse-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents:
19950
diff
changeset
|
358 (cal-tex-cursor-filofax-daily nil))) |
927a8710de05
(cal-tex-mouse-filofax-daily): New function.
Karl Heuer <kwzh@gnu.org>
parents:
19950
diff
changeset
|
359 |
13690
8a3ceaf9bfee
More repairs of wrong function names in menus!
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13689
diff
changeset
|
360 (defun cal-tex-mouse-filofax-2week () |
13194
7e90c5fce35f
Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13063
diff
changeset
|
361 "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
|
362 (interactive) |
7e90c5fce35f
Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13063
diff
changeset
|
363 (save-excursion |
14951
15ab8e95a50a
(calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents:
14915
diff
changeset
|
364 (calendar-mouse-goto-date (calendar-event-to-date)) |
13690
8a3ceaf9bfee
More repairs of wrong function names in menus!
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13689
diff
changeset
|
365 (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
|
366 |
13690
8a3ceaf9bfee
More repairs of wrong function names in menus!
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13689
diff
changeset
|
367 (defun cal-tex-mouse-filofax-week () |
13194
7e90c5fce35f
Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13063
diff
changeset
|
368 "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
|
369 (interactive) |
7e90c5fce35f
Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13063
diff
changeset
|
370 (save-excursion |
14951
15ab8e95a50a
(calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents:
14915
diff
changeset
|
371 (calendar-mouse-goto-date (calendar-event-to-date)) |
13690
8a3ceaf9bfee
More repairs of wrong function names in menus!
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13689
diff
changeset
|
372 (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
|
373 |
7e90c5fce35f
Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13063
diff
changeset
|
374 (defun cal-tex-mouse-month () |
7e90c5fce35f
Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13063
diff
changeset
|
375 "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
|
376 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
|
377 (interactive) |
7e90c5fce35f
Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13063
diff
changeset
|
378 (save-excursion |
14951
15ab8e95a50a
(calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents:
14915
diff
changeset
|
379 (calendar-mouse-goto-date (calendar-event-to-date)) |
13194
7e90c5fce35f
Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13063
diff
changeset
|
380 (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
|
381 |
7e90c5fce35f
Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13063
diff
changeset
|
382 (defun cal-tex-mouse-month-landscape () |
7e90c5fce35f
Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13063
diff
changeset
|
383 "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
|
384 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
|
385 (interactive) |
7e90c5fce35f
Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13063
diff
changeset
|
386 (save-excursion |
14951
15ab8e95a50a
(calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents:
14915
diff
changeset
|
387 (calendar-mouse-goto-date (calendar-event-to-date)) |
13194
7e90c5fce35f
Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13063
diff
changeset
|
388 (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
|
389 |
7e90c5fce35f
Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13063
diff
changeset
|
390 (defun cal-tex-mouse-year () |
7e90c5fce35f
Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13063
diff
changeset
|
391 "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
|
392 (interactive) |
7e90c5fce35f
Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13063
diff
changeset
|
393 (save-excursion |
14951
15ab8e95a50a
(calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents:
14915
diff
changeset
|
394 (calendar-mouse-goto-date (calendar-event-to-date)) |
13194
7e90c5fce35f
Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13063
diff
changeset
|
395 (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
|
396 |
7e90c5fce35f
Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13063
diff
changeset
|
397 (defun cal-tex-mouse-filofax-year () |
7e90c5fce35f
Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13063
diff
changeset
|
398 "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
|
399 (interactive) |
7e90c5fce35f
Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13063
diff
changeset
|
400 (save-excursion |
14951
15ab8e95a50a
(calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents:
14915
diff
changeset
|
401 (calendar-mouse-goto-date (calendar-event-to-date)) |
13194
7e90c5fce35f
Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13063
diff
changeset
|
402 (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
|
403 |
7e90c5fce35f
Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13063
diff
changeset
|
404 (defun cal-tex-mouse-year-landscape () |
7e90c5fce35f
Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13063
diff
changeset
|
405 "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
|
406 (interactive) |
7e90c5fce35f
Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13063
diff
changeset
|
407 (save-excursion |
14951
15ab8e95a50a
(calendar-mouse-goto-date): New function.
Richard M. Stallman <rms@gnu.org>
parents:
14915
diff
changeset
|
408 (calendar-mouse-goto-date (calendar-event-to-date)) |
13194
7e90c5fce35f
Added menu items for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13063
diff
changeset
|
409 (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
|
410 |
66617
ed95f221960d
(date, event): Don't declare as dynamic-var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
65919
diff
changeset
|
411 (defun calendar-mouse-print-dates (&optional event) |
92647
8b4648ec6f76
(cal-menu-holiday-window-suffix)
Glenn Morris <rgm@gnu.org>
parents:
92549
diff
changeset
|
412 "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
|
413 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
|
414 (interactive "e") |
ed95f221960d
(date, event): Don't declare as dynamic-var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
65919
diff
changeset
|
415 (let* ((date (calendar-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
|
416 (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
|
417 (selection |
6c0dbddcd03a
(calendar-other-dates): Declare it, and removes the declarations it replaces.
Glenn Morris <rgm@gnu.org>
parents:
92962
diff
changeset
|
418 (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
|
419 event |
6c0dbddcd03a
(calendar-other-dates): Declare it, and removes the declarations it replaces.
Glenn Morris <rgm@gnu.org>
parents:
92962
diff
changeset
|
420 (list title |
6c0dbddcd03a
(calendar-other-dates): Declare it, and removes the declarations it replaces.
Glenn Morris <rgm@gnu.org>
parents:
92962
diff
changeset
|
421 (append (list title) |
6c0dbddcd03a
(calendar-other-dates): Declare it, and removes the declarations it replaces.
Glenn Morris <rgm@gnu.org>
parents:
92962
diff
changeset
|
422 (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
|
423 (and selection (call-interactively selection)))) |
5701 | 424 |
92647
8b4648ec6f76
(cal-menu-holiday-window-suffix)
Glenn Morris <rgm@gnu.org>
parents:
92549
diff
changeset
|
425 (defun cal-menu-set-date-title (menu) |
8b4648ec6f76
(cal-menu-holiday-window-suffix)
Glenn Morris <rgm@gnu.org>
parents:
92549
diff
changeset
|
426 "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
|
427 (easy-menu-filter-return |
8b4648ec6f76
(cal-menu-holiday-window-suffix)
Glenn Morris <rgm@gnu.org>
parents:
92549
diff
changeset
|
428 menu (calendar-date-string (calendar-event-to-date t) t nil))) |
8b4648ec6f76
(cal-menu-holiday-window-suffix)
Glenn Morris <rgm@gnu.org>
parents:
92549
diff
changeset
|
429 |
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
|
430 (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
|
431 "Pop up menu for Mouse-2 for selected date in the calendar window." |
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
|
432 '("foo" :filter cal-menu-set-date-title |
8410b0ff0e7a
Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
77279
diff
changeset
|
433 "--" |
8410b0ff0e7a
Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
77279
diff
changeset
|
434 ["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
|
435 ["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
|
436 ["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
|
437 ["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
|
438 ("Prepare LaTeX 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
|
439 ["Daily (1 page)" cal-tex-mouse-day] |
8410b0ff0e7a
Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
77279
diff
changeset
|
440 ["Weekly (1 page)" cal-tex-mouse-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
|
441 ["Weekly (2 pages)" cal-tex-mouse-week2] |
8410b0ff0e7a
Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
77279
diff
changeset
|
442 ["Weekly (other style; 1 page)" cal-tex-mouse-week-iso] |
8410b0ff0e7a
Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
77279
diff
changeset
|
443 ["Weekly (yet another style; 1 page)" cal-tex-mouse-week-monday] |
8410b0ff0e7a
Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
77279
diff
changeset
|
444 ["Monthly" cal-tex-mouse-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
|
445 ["Monthly (landscape)" cal-tex-mouse-month-landscape] |
8410b0ff0e7a
Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
77279
diff
changeset
|
446 ["Yearly" cal-tex-mouse-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
|
447 ["Yearly (landscape)" cal-tex-mouse-year-landscape] |
8410b0ff0e7a
Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
77279
diff
changeset
|
448 ("Filofax styles" |
8410b0ff0e7a
Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
77279
diff
changeset
|
449 ["Filofax Daily (one-day-per-page)" cal-tex-mouse-filofax-daily] |
8410b0ff0e7a
Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
77279
diff
changeset
|
450 ["Filofax Weekly (2-weeks-at-a-glance)" cal-tex-mouse-filofax-2week] |
8410b0ff0e7a
Break dependency on calendar.el (i.e. do not modify calendar-mode-map),
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
77279
diff
changeset
|
451 ["Filofax Weekly (week-at-a-glance)" cal-tex-mouse-filofax-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
|
452 ["Filofax Yearly" cal-tex-mouse-filofax-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
|
453 ["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
|
454 ["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
|
455 ["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
|
456 |
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
|
457 (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
|
458 "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
|
459 '("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
|
460 ["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
|
461 ["Scroll backward" 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
|
462 ["Mark diary entries" mark-diary-entries] |
84553
383791965ba9
Rename all list-calendar-holidays callers to calendar-list-holidays,
Glenn Morris <rgm@gnu.org>
parents:
82202
diff
changeset
|
463 ["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
|
464 ["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
|
465 ["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
|
466 ["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
|
467 ["Show diary" diary-show-all-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
|
468 ["Exit calendar" exit-calendar])) |
5701 | 469 |
93092
6c0dbddcd03a
(calendar-other-dates): Declare it, and removes the declarations it replaces.
Glenn Morris <rgm@gnu.org>
parents:
92962
diff
changeset
|
470 ;; 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
|
471 (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
|
472 "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
|
473 (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
|
474 "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
|
475 |
5701 | 476 (run-hooks 'cal-menu-load-hook) |
477 | |
478 (provide 'cal-menu) | |
479 | |
66617
ed95f221960d
(date, event): Don't declare as dynamic-var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
65919
diff
changeset
|
480 ;; arch-tag: aa81cf73-ce89-48a4-97ec-9ef861e87fe9 |
5701 | 481 ;;; cal-menu.el ends here |