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