Mercurial > emacs
annotate lisp/calendar/calendar.el @ 49828:88148dcfdd3a
(diary-file-name-prefix-function): Fix custom type.
author | Markus Rost <rost@math.uni-bielefeld.de> |
---|---|
date | Mon, 17 Feb 2003 22:24:30 +0000 |
parents | dd8404d4fed8 |
children | 60ffdeba6e0e |
rev | line source |
---|---|
38422
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
38088
diff
changeset
|
1 ;;; calendar.el --- calendar functions |
811
e694e0879463
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
732
diff
changeset
|
2 |
39785
5c56451d877f
(calendar-mode-line-format): do not use #' on undefined functions
Sam Steingold <sds@gnu.org>
parents:
39523
diff
changeset
|
3 ;; Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1997, |
38448
911d5f6da3f7
(calendar-goto-islamic-date): Add
Gerd Moellmann <gerd@gnu.org>
parents:
38422
diff
changeset
|
4 ;; 2000, 2001 Free Software Foundation, Inc. |
846
20674ae6bf52
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
811
diff
changeset
|
5 |
811
e694e0879463
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
732
diff
changeset
|
6 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> |
2247
2c7997f249eb
Add or correct keywords
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2211
diff
changeset
|
7 ;; Keywords: calendar |
13193
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
8 ;; Human-Keywords: calendar, Gregorian calendar, diary, holidays |
957 | 9 |
628 | 10 ;; This file is part of GNU Emacs. |
11 | |
6737 | 12 ;; GNU Emacs is free software; you can redistribute it and/or modify |
13 ;; it under the terms of the GNU General Public License as published by | |
14 ;; the Free Software Foundation; either version 2, or (at your option) | |
15 ;; any later version. | |
16 | |
628 | 17 ;; GNU Emacs is distributed in the hope that it will be useful, |
6737 | 18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
20 ;; GNU General Public License for more details. | |
21 | |
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. | |
628 | 26 |
811
e694e0879463
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
732
diff
changeset
|
27 ;;; Commentary: |
e694e0879463
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
732
diff
changeset
|
28 |
37001
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
29 ;; This collection of functions implements a calendar window. It generates a |
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
30 ;; calendar for the current month, together with the previous and coming |
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
31 ;; months, or for any other three-month period. The calendar can be scrolled |
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
32 ;; forward and backward in the window to show months in the past or future; |
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
33 ;; the cursor can move forward and backward by days, weeks, or months, making |
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
34 ;; it possible, for instance, to jump to the date a specified number of days, |
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
35 ;; weeks, or months from the date under the cursor. The user can display a |
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
36 ;; list of holidays and other notable days for the period shown; the notable |
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
37 ;; days can be marked on the calendar, if desired. The user can also specify |
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
38 ;; that dates having corresponding diary entries (in a file that the user |
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
39 ;; specifies) be marked; the diary entries for any date can be viewed in a |
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
40 ;; separate window. The diary and the notable days can be viewed |
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
41 ;; independently of the calendar. Dates can be translated from the (usual) |
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
42 ;; Gregorian calendar to the day of the year/days remaining in year, to the |
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
43 ;; ISO commercial calendar, to the Julian (old style) calendar, to the Hebrew |
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
44 ;; calendar, to the Islamic calendar, to the French Revolutionary calendar, to |
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
45 ;; the Mayan calendar, to the Chinese calendar, to the Coptic calendar, to the |
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
46 ;; Ethiopic calendar, and to the astronomical (Julian) day number. When |
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
47 ;; floating point is available, times of sunrise/sunset can be displayed, as |
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
48 ;; can the phases of the moon. Appointment notification for diary entries is |
13193
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
49 ;; available. Calendar printing via LaTeX is available. |
957 | 50 |
51 ;; The following files are part of the calendar/diary code: | |
52 | |
13193
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
53 ;; appt.el Appointment notification |
14687
0d4ff7e4d6a3
Use the new file names in autoloads.
Karl Heuer <kwzh@gnu.org>
parents:
14169
diff
changeset
|
54 ;; cal-china.el Chinese calendar |
13193
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
55 ;; cal-coptic.el Coptic/Ethiopic calendars |
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
56 ;; cal-dst.el Daylight savings time rules |
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
57 ;; cal-hebrew.el Hebrew calendar |
14687
0d4ff7e4d6a3
Use the new file names in autoloads.
Karl Heuer <kwzh@gnu.org>
parents:
14169
diff
changeset
|
58 ;; cal-islam.el Islamic calendar |
13193
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
59 ;; cal-iso.el ISO calendar |
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
60 ;; cal-julian.el Julian/astronomical calendars |
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
61 ;; cal-mayan.el Mayan calendars |
5694
69471d331d0c
(calendar-version): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5272
diff
changeset
|
62 ;; cal-menu.el Menu support |
13042
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
63 ;; cal-move.el Movement in the calendar |
15258
ab5975df6164
Change autoload references from cal-persian to cal-persia.
Karl Heuer <kwzh@gnu.org>
parents:
14937
diff
changeset
|
64 ;; cal-persia.el Persian calendar |
13193
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
65 ;; cal-tex.el Calendars in LaTeX |
10089
37edcffcf005
Mention cal-x.el in comments.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9998
diff
changeset
|
66 ;; cal-x.el X-windows dedicated frame functions |
15317 | 67 ;; diary-lib.el Diary functions |
957 | 68 ;; holidays.el Holiday functions |
13193
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
69 ;; lunar.el Phases of the moon |
957 | 70 ;; solar.el Sunrise/sunset, equinoxes/solstices |
628 | 71 |
20462
d179de7ad92e
Add reference to new Calendrical Calculations book.
Paul Eggert <eggert@twinsun.com>
parents:
20429
diff
changeset
|
72 ;; Technical details of all the calendrical calculations can be found in |
d179de7ad92e
Add reference to new Calendrical Calculations book.
Paul Eggert <eggert@twinsun.com>
parents:
20429
diff
changeset
|
73 ;; ``Calendrical Calculations'' by Nachum Dershowitz and Edward M. Reingold, |
d179de7ad92e
Add reference to new Calendrical Calculations book.
Paul Eggert <eggert@twinsun.com>
parents:
20429
diff
changeset
|
74 ;; Cambridge University Press (1997). |
628 | 75 |
20462
d179de7ad92e
Add reference to new Calendrical Calculations book.
Paul Eggert <eggert@twinsun.com>
parents:
20429
diff
changeset
|
76 ;; An earlier version of the technical details appeared in |
628 | 77 ;; ``Calendrical Calculations'' by Nachum Dershowitz and Edward M. Reingold, |
78 ;; Software--Practice and Experience, Volume 20, Number 9 (September, 1990), | |
957 | 79 ;; pages 899-928. ``Calendrical Calculations, Part II: Three Historical |
80 ;; Calendars'' by E. M. Reingold, N. Dershowitz, and S. M. Clamen, | |
2640
fc7b8160bcc9
* calendar.el: Update reference to the papers in S-P&E.
Jim Blandy <jimb@redhat.com>
parents:
2347
diff
changeset
|
81 ;; Software--Practice and Experience, Volume 23, Number 4 (April, 1993), |
fc7b8160bcc9
* calendar.el: Update reference to the papers in S-P&E.
Jim Blandy <jimb@redhat.com>
parents:
2347
diff
changeset
|
82 ;; pages 383-404. |
957 | 83 |
84 ;; Hard copies of these two papers can be obtained by sending email to | |
85 ;; reingold@cs.uiuc.edu with the SUBJECT "send-paper-cal" (no quotes) and | |
86 ;; the message BODY containing your mailing address (snail). | |
628 | 87 |
20462
d179de7ad92e
Add reference to new Calendrical Calculations book.
Paul Eggert <eggert@twinsun.com>
parents:
20429
diff
changeset
|
88 ;; Comments, corrections, and improvements should be sent to |
d179de7ad92e
Add reference to new Calendrical Calculations book.
Paul Eggert <eggert@twinsun.com>
parents:
20429
diff
changeset
|
89 ;; Edward M. Reingold Department of Computer Science |
d179de7ad92e
Add reference to new Calendrical Calculations book.
Paul Eggert <eggert@twinsun.com>
parents:
20429
diff
changeset
|
90 ;; (217) 333-6733 University of Illinois at Urbana-Champaign |
d179de7ad92e
Add reference to new Calendrical Calculations book.
Paul Eggert <eggert@twinsun.com>
parents:
20429
diff
changeset
|
91 ;; reingold@cs.uiuc.edu 1304 West Springfield Avenue |
d179de7ad92e
Add reference to new Calendrical Calculations book.
Paul Eggert <eggert@twinsun.com>
parents:
20429
diff
changeset
|
92 ;; Urbana, Illinois 61801 |
d179de7ad92e
Add reference to new Calendrical Calculations book.
Paul Eggert <eggert@twinsun.com>
parents:
20429
diff
changeset
|
93 |
811
e694e0879463
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
732
diff
changeset
|
94 ;;; Code: |
628 | 95 |
39785
5c56451d877f
(calendar-mode-line-format): do not use #' on undefined functions
Sam Steingold <sds@gnu.org>
parents:
39523
diff
changeset
|
96 (eval-when-compile |
31669
ec8ce5820488
(calendar-mode-line-format): Make fields
Dave Love <fx@gnu.org>
parents:
26530
diff
changeset
|
97 (defvar displayed-month) |
ec8ce5820488
(calendar-mode-line-format): Make fields
Dave Love <fx@gnu.org>
parents:
26530
diff
changeset
|
98 (defvar displayed-year) |
ec8ce5820488
(calendar-mode-line-format): Make fields
Dave Love <fx@gnu.org>
parents:
26530
diff
changeset
|
99 (defvar calendar-month-name-array) |
ec8ce5820488
(calendar-mode-line-format): Make fields
Dave Love <fx@gnu.org>
parents:
26530
diff
changeset
|
100 (defvar calendar-starred-day)) |
ec8ce5820488
(calendar-mode-line-format): Make fields
Dave Love <fx@gnu.org>
parents:
26530
diff
changeset
|
101 |
6737 | 102 (defun calendar-version () |
103 (interactive) | |
13193
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
104 (message "Version 6, October 12, 1995")) |
6737 | 105 |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
106 (defgroup calendar nil |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
107 "Calendar and time management support." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
108 :group 'applications) |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
109 |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
110 (defgroup diary nil |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
111 "Emacs diary." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
112 :group 'calendar) |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
113 |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
114 (defgroup appt nil |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
115 "Appointment notification." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
116 :group 'calendar) |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
117 |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
118 (defgroup holidays nil |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
119 "Holidays support in calendar." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
120 :group 'calendar |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
121 :prefix "calendar-" |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
122 :group 'local) |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
123 |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
124 (defgroup chinese-calendar nil |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
125 "Chinese calendar support." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
126 :group 'calendar) |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
127 |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
128 (defgroup calendar-tex nil |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
129 "Options for printing calendar with LaTeX." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
130 :prefix "cal-tex-" |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
131 :group 'calendar) |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
132 |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
133 (defgroup calendar-hooks nil |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
134 "Calendar hooks." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
135 :prefix "calendar-" |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
136 :group 'calendar) |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
137 |
4861
924486090b27
(calendar-week-start-day): New var (autoloaded) to
Richard M. Stallman <rms@gnu.org>
parents:
4658
diff
changeset
|
138 |
924486090b27
(calendar-week-start-day): New var (autoloaded) to
Richard M. Stallman <rms@gnu.org>
parents:
4658
diff
changeset
|
139 ;;;###autoload |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
140 (defcustom calendar-week-start-day 0 |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
141 "*The day of the week on which a week in the calendar begins. |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
142 0 means Sunday (default), 1 means Monday, and so on." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
143 :type 'integer |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
144 :group 'calendar) |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
145 |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
146 ;;;###autoload |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
147 (defcustom calendar-offset 0 |
9709
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
148 "*The offset of the principal month from the center of the calendar window. |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
149 0 means the principal month is in the center (default), -1 means on the left, |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
150 +1 means on the right. Larger (or smaller) values push the principal month off |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
151 the screen." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
152 :type 'integer |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
153 :group 'calendar) |
9709
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
154 |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
155 ;;;###autoload |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
156 (defcustom view-diary-entries-initially nil |
6737 | 157 "*Non-nil means display current date's diary entries on entry. |
628 | 158 The diary is displayed in another window when the calendar is first displayed, |
159 if the current date is visible. The number of days of diary entries displayed | |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
160 is governed by the variable `number-of-diary-entries'." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
161 :type 'boolean |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
162 :group 'diary) |
628 | 163 |
957 | 164 ;;;###autoload |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
165 (defcustom number-of-diary-entries 1 |
628 | 166 "*Specifies how many days of diary entries are to be displayed initially. |
31730
719a230f8091
Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31671
diff
changeset
|
167 This variable affects the diary display when the command \\[diary] is used, |
628 | 168 or if the value of the variable `view-diary-entries-initially' is t. For |
169 example, if the default value 1 is used, then only the current day's diary | |
170 entries will be displayed. If the value 2 is used, then both the current | |
6737 | 171 day's and the next day's entries will be displayed. |
172 | |
173 The value can also be a vector such as [0 2 2 2 2 4 1]; this value | |
174 says to display no diary entries on Sunday, the display the entries | |
175 for the current date and the day after on Monday through Thursday, | |
176 display Friday through Monday's entries on Friday, and display only | |
177 Saturday's entries on Saturday. | |
178 | |
179 This variable does not affect the diary display with the `d' command | |
180 from the calendar; in that case, the prefix argument controls the | |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
181 number of days of diary entries displayed." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
182 :type '(choice (integer :tag "Entries") |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
183 (vector :value [0 0 0 0 0 0 0] |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
184 (integer :tag "Sunday") |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
185 (integer :tag "Monday") |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
186 (integer :tag "Tuesday") |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
187 (integer :tag "Wednesday") |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
188 (integer :tag "Thursday") |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
189 (integer :tag "Friday") |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
190 (integer :tag "Saturday"))) |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
191 :group 'diary) |
628 | 192 |
957 | 193 ;;;###autoload |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
194 (defcustom mark-diary-entries-in-calendar nil |
6737 | 195 "*Non-nil means mark dates with diary entries, in the calendar window. |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
196 The marking symbol is specified by the variable `diary-entry-marker'." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
197 :type 'boolean |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
198 :group 'diary) |
628 | 199 |
26427
3b6cf16f3633
* calendar/calendar.el (calendar-remove-frame-by-deleting):
Sam Steingold <sds@gnu.org>
parents:
26329
diff
changeset
|
200 ;;;###autoload |
3b6cf16f3633
* calendar/calendar.el (calendar-remove-frame-by-deleting):
Sam Steingold <sds@gnu.org>
parents:
26329
diff
changeset
|
201 (defcustom calendar-remove-frame-by-deleting nil |
3b6cf16f3633
* calendar/calendar.el (calendar-remove-frame-by-deleting):
Sam Steingold <sds@gnu.org>
parents:
26329
diff
changeset
|
202 "*Determine how the calendar mode removes a frame no longer needed. |
3b6cf16f3633
* calendar/calendar.el (calendar-remove-frame-by-deleting):
Sam Steingold <sds@gnu.org>
parents:
26329
diff
changeset
|
203 If nil, make an icon of the frame. If non-nil, delete the frame." |
3b6cf16f3633
* calendar/calendar.el (calendar-remove-frame-by-deleting):
Sam Steingold <sds@gnu.org>
parents:
26329
diff
changeset
|
204 :type 'boolean |
3b6cf16f3633
* calendar/calendar.el (calendar-remove-frame-by-deleting):
Sam Steingold <sds@gnu.org>
parents:
26329
diff
changeset
|
205 :group 'view) |
3b6cf16f3633
* calendar/calendar.el (calendar-remove-frame-by-deleting):
Sam Steingold <sds@gnu.org>
parents:
26329
diff
changeset
|
206 |
48366
9dad713d153a
Patch of Alan Shutko <ats@acm.org> by way of rms.
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47333
diff
changeset
|
207 (defvar diary-face 'diary-face |
9dad713d153a
Patch of Alan Shutko <ats@acm.org> by way of rms.
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47333
diff
changeset
|
208 "Face name to use for diary entries.") |
33160
8006eaf2db42
(diary-face, calendar-today-face, holiday-face):
Miles Bader <miles@gnu.org>
parents:
33114
diff
changeset
|
209 (defface diary-face |
8006eaf2db42
(diary-face, calendar-today-face, holiday-face):
Miles Bader <miles@gnu.org>
parents:
33114
diff
changeset
|
210 '((((class color) (background light)) |
33208 | 211 :foreground "red") |
33160
8006eaf2db42
(diary-face, calendar-today-face, holiday-face):
Miles Bader <miles@gnu.org>
parents:
33114
diff
changeset
|
212 (((class color) (background dark)) |
33208 | 213 :foreground "yellow") |
33160
8006eaf2db42
(diary-face, calendar-today-face, holiday-face):
Miles Bader <miles@gnu.org>
parents:
33114
diff
changeset
|
214 (t |
42456
8a4077ab418c
(various face definitions): Use :weight, not :bold.
Richard M. Stallman <rms@gnu.org>
parents:
41577
diff
changeset
|
215 :weight bold)) |
33160
8006eaf2db42
(diary-face, calendar-today-face, holiday-face):
Miles Bader <miles@gnu.org>
parents:
33114
diff
changeset
|
216 "Face for highlighting diary entries." |
8006eaf2db42
(diary-face, calendar-today-face, holiday-face):
Miles Bader <miles@gnu.org>
parents:
33114
diff
changeset
|
217 :group 'diary) |
19059
06cb7a02a079
(diary-face, calendar-today-face, holiday-face):
Richard M. Stallman <rms@gnu.org>
parents:
18940
diff
changeset
|
218 |
33160
8006eaf2db42
(diary-face, calendar-today-face, holiday-face):
Miles Bader <miles@gnu.org>
parents:
33114
diff
changeset
|
219 (defface calendar-today-face |
8006eaf2db42
(diary-face, calendar-today-face, holiday-face):
Miles Bader <miles@gnu.org>
parents:
33114
diff
changeset
|
220 '((t (:underline t))) |
8006eaf2db42
(diary-face, calendar-today-face, holiday-face):
Miles Bader <miles@gnu.org>
parents:
33114
diff
changeset
|
221 "Face for indicating today's date." |
8006eaf2db42
(diary-face, calendar-today-face, holiday-face):
Miles Bader <miles@gnu.org>
parents:
33114
diff
changeset
|
222 :group 'diary) |
19059
06cb7a02a079
(diary-face, calendar-today-face, holiday-face):
Richard M. Stallman <rms@gnu.org>
parents:
18940
diff
changeset
|
223 |
33160
8006eaf2db42
(diary-face, calendar-today-face, holiday-face):
Miles Bader <miles@gnu.org>
parents:
33114
diff
changeset
|
224 (defface holiday-face |
8006eaf2db42
(diary-face, calendar-today-face, holiday-face):
Miles Bader <miles@gnu.org>
parents:
33114
diff
changeset
|
225 '((((class color) (background light)) |
33208 | 226 :background "pink") |
33160
8006eaf2db42
(diary-face, calendar-today-face, holiday-face):
Miles Bader <miles@gnu.org>
parents:
33114
diff
changeset
|
227 (((class color) (background dark)) |
33208 | 228 :background "chocolate4") |
33160
8006eaf2db42
(diary-face, calendar-today-face, holiday-face):
Miles Bader <miles@gnu.org>
parents:
33114
diff
changeset
|
229 (t |
33208 | 230 :inverse-video t)) |
33160
8006eaf2db42
(diary-face, calendar-today-face, holiday-face):
Miles Bader <miles@gnu.org>
parents:
33114
diff
changeset
|
231 "Face for indicating dates that have holidays." |
8006eaf2db42
(diary-face, calendar-today-face, holiday-face):
Miles Bader <miles@gnu.org>
parents:
33114
diff
changeset
|
232 :group 'diary) |
19059
06cb7a02a079
(diary-face, calendar-today-face, holiday-face):
Richard M. Stallman <rms@gnu.org>
parents:
18940
diff
changeset
|
233 |
48683
ead34b521994
(facemenu-unlisted-faces): Only update after facemenu was loaded.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
48366
diff
changeset
|
234 (eval-after-load "facemenu" |
ead34b521994
(facemenu-unlisted-faces): Only update after facemenu was loaded.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
48366
diff
changeset
|
235 '(progn |
ead34b521994
(facemenu-unlisted-faces): Only update after facemenu was loaded.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
48366
diff
changeset
|
236 (add-to-list 'facemenu-unlisted-faces 'diary-face) |
ead34b521994
(facemenu-unlisted-faces): Only update after facemenu was loaded.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
48366
diff
changeset
|
237 (add-to-list 'facemenu-unlisted-faces 'calendar-today-face) |
ead34b521994
(facemenu-unlisted-faces): Only update after facemenu was loaded.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
48366
diff
changeset
|
238 (add-to-list 'facemenu-unlisted-faces 'holiday-face))) |
ead34b521994
(facemenu-unlisted-faces): Only update after facemenu was loaded.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
48366
diff
changeset
|
239 |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
240 (defcustom diary-entry-marker |
37430
a0e805e3a7f1
(diary-entry-marker, calendar-today-marker, calendar-holiday-marker): Use
Eli Zaretskii <eliz@gnu.org>
parents:
37001
diff
changeset
|
241 (if (not (display-color-p)) |
5694
69471d331d0c
(calendar-version): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5272
diff
changeset
|
242 "+" |
69471d331d0c
(calendar-version): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5272
diff
changeset
|
243 'diary-face) |
19059
06cb7a02a079
(diary-face, calendar-today-face, holiday-face):
Richard M. Stallman <rms@gnu.org>
parents:
18940
diff
changeset
|
244 "*How to mark dates that have diary entries. |
06cb7a02a079
(diary-face, calendar-today-face, holiday-face):
Richard M. Stallman <rms@gnu.org>
parents:
18940
diff
changeset
|
245 The value can be either a single-character string or a face." |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
246 :type '(choice string face) |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
247 :group 'diary) |
5694
69471d331d0c
(calendar-version): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5272
diff
changeset
|
248 |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
249 (defcustom calendar-today-marker |
37430
a0e805e3a7f1
(diary-entry-marker, calendar-today-marker, calendar-holiday-marker): Use
Eli Zaretskii <eliz@gnu.org>
parents:
37001
diff
changeset
|
250 (if (not (display-color-p)) |
5694
69471d331d0c
(calendar-version): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5272
diff
changeset
|
251 "=" |
69471d331d0c
(calendar-version): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5272
diff
changeset
|
252 'calendar-today-face) |
19059
06cb7a02a079
(diary-face, calendar-today-face, holiday-face):
Richard M. Stallman <rms@gnu.org>
parents:
18940
diff
changeset
|
253 "*How to mark today's date in the calendar. |
06cb7a02a079
(diary-face, calendar-today-face, holiday-face):
Richard M. Stallman <rms@gnu.org>
parents:
18940
diff
changeset
|
254 The value can be either a single-character string or a face. |
06cb7a02a079
(diary-face, calendar-today-face, holiday-face):
Richard M. Stallman <rms@gnu.org>
parents:
18940
diff
changeset
|
255 Marking today's date is done only if you set up `today-visible-calendar-hook' |
06cb7a02a079
(diary-face, calendar-today-face, holiday-face):
Richard M. Stallman <rms@gnu.org>
parents:
18940
diff
changeset
|
256 to request that." |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
257 :type '(choice string face) |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
258 :group 'calendar) |
5694
69471d331d0c
(calendar-version): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5272
diff
changeset
|
259 |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
260 (defcustom calendar-holiday-marker |
37430
a0e805e3a7f1
(diary-entry-marker, calendar-today-marker, calendar-holiday-marker): Use
Eli Zaretskii <eliz@gnu.org>
parents:
37001
diff
changeset
|
261 (if (not (display-color-p)) |
5694
69471d331d0c
(calendar-version): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5272
diff
changeset
|
262 "*" |
69471d331d0c
(calendar-version): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5272
diff
changeset
|
263 'holiday-face) |
19059
06cb7a02a079
(diary-face, calendar-today-face, holiday-face):
Richard M. Stallman <rms@gnu.org>
parents:
18940
diff
changeset
|
264 "*How to mark notable dates in the calendar. |
06cb7a02a079
(diary-face, calendar-today-face, holiday-face):
Richard M. Stallman <rms@gnu.org>
parents:
18940
diff
changeset
|
265 The value can be either a single-character string or a face." |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
266 :type '(choice string face) |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
267 :group 'calendar) |
628 | 268 |
957 | 269 ;;;###autoload |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
270 (defcustom view-calendar-holidays-initially nil |
6737 | 271 "*Non-nil means display holidays for current three month period on entry. |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
272 The holidays are displayed in another window when the calendar is first |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
273 displayed." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
274 :type 'boolean |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
275 :group 'holidays) |
628 | 276 |
732 | 277 ;;;###autoload |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
278 (defcustom mark-holidays-in-calendar nil |
6737 | 279 "*Non-nil means mark dates of holidays in the calendar window. |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
280 The marking symbol is specified by the variable `calendar-holiday-marker'." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
281 :type 'boolean |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
282 :group 'holidays) |
628 | 283 |
957 | 284 ;;;###autoload |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
285 (defcustom all-hebrew-calendar-holidays nil |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
286 "*If nil, show only major holidays from the Hebrew calendar. |
6737 | 287 This means only those Jewish holidays that appear on secular calendars. |
288 | |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
289 If t, show all the holidays that would appear in a complete Hebrew calendar." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
290 :type 'boolean |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
291 :group 'holidays) |
628 | 292 |
732 | 293 ;;;###autoload |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
294 (defcustom all-christian-calendar-holidays nil |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
295 "*If nil, show only major holidays from the Christian calendar. |
6737 | 296 This means only those Christian holidays that appear on secular calendars. |
297 | |
298 If t, show all the holidays that would appear in a complete Christian | |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
299 calendar." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
300 :type 'boolean |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
301 :group 'holidays) |
628 | 302 |
732 | 303 ;;;###autoload |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
304 (defcustom all-islamic-calendar-holidays nil |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
305 "*If nil, show only major holidays from the Islamic calendar. |
6737 | 306 This means only those Islamic holidays that appear on secular calendars. |
307 | |
308 If t, show all the holidays that would appear in a complete Islamic | |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
309 calendar." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
310 :type 'boolean |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
311 :group 'holidays) |
628 | 312 |
49736
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
313 (defcustom diary-file-name-prefix-function (function (lambda (str) str)) |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
314 "*The function that will take a diary file name and return the desired prefix." |
49828
88148dcfdd3a
(diary-file-name-prefix-function): Fix custom type.
Markus Rost <rost@math.uni-bielefeld.de>
parents:
49736
diff
changeset
|
315 :type 'function |
49736
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
316 :group 'diary) |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
317 |
957 | 318 ;;;###autoload |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
319 (defcustom calendar-load-hook nil |
957 | 320 "*List of functions to be called after the calendar is first loaded. |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
321 This is the place to add key bindings to `calendar-mode-map'." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
322 :type 'hook |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
323 :group 'calendar-hooks) |
957 | 324 |
325 ;;;###autoload | |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
326 (defcustom initial-calendar-window-hook nil |
628 | 327 "*List of functions to be called when the calendar window is first opened. |
328 The functions invoked are called after the calendar window is opened, but | |
329 once opened is never called again. Leaving the calendar with the `q' command | |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
330 and reentering it will cause these functions to be called again." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
331 :type 'hook |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
332 :group 'calendar-hooks) |
628 | 333 |
957 | 334 ;;;###autoload |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
335 (defcustom today-visible-calendar-hook nil |
628 | 336 "*List of functions called whenever the current date is visible. |
337 This can be used, for example, to replace today's date with asterisks; a | |
338 function `calendar-star-date' is included for this purpose: | |
339 (setq today-visible-calendar-hook 'calendar-star-date) | |
7404 | 340 It can also be used to mark the current date with `calendar-today-marker'; |
5694
69471d331d0c
(calendar-version): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5272
diff
changeset
|
341 a function is also provided for this: |
628 | 342 (setq today-visible-calendar-hook 'calendar-mark-today) |
343 | |
344 The corresponding variable `today-invisible-calendar-hook' is the list of | |
345 functions called when the calendar function was called when the current | |
346 date is not visible in the window. | |
347 | |
348 Other than the use of the provided functions, the changing of any | |
349 characters in the calendar buffer by the hooks may cause the failure of the | |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
350 functions that move by days and weeks." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
351 :type 'hook |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
352 :group 'calendar-hooks) |
628 | 353 |
957 | 354 ;;;###autoload |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
355 (defcustom today-invisible-calendar-hook nil |
628 | 356 "*List of functions called whenever the current date is not visible. |
357 | |
358 The corresponding variable `today-visible-calendar-hook' is the list of | |
359 functions called when the calendar function was called when the current | |
360 date is visible in the window. | |
361 | |
362 Other than the use of the provided functions, the changing of any | |
363 characters in the calendar buffer by the hooks may cause the failure of the | |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
364 functions that move by days and weeks." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
365 :type 'hook |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
366 :group 'calendar-hooks) |
628 | 367 |
957 | 368 ;;;###autoload |
25410
3ab4413f7549
(calendar-move-hook): New hook.
Richard M. Stallman <rms@gnu.org>
parents:
25154
diff
changeset
|
369 (defcustom calendar-move-hook nil |
3ab4413f7549
(calendar-move-hook): New hook.
Richard M. Stallman <rms@gnu.org>
parents:
25154
diff
changeset
|
370 "*List of functions called whenever the cursor moves in the calendar. |
3ab4413f7549
(calendar-move-hook): New hook.
Richard M. Stallman <rms@gnu.org>
parents:
25154
diff
changeset
|
371 |
26427
3b6cf16f3633
* calendar/calendar.el (calendar-remove-frame-by-deleting):
Sam Steingold <sds@gnu.org>
parents:
26329
diff
changeset
|
372 For example, |
25410
3ab4413f7549
(calendar-move-hook): New hook.
Richard M. Stallman <rms@gnu.org>
parents:
25154
diff
changeset
|
373 |
3ab4413f7549
(calendar-move-hook): New hook.
Richard M. Stallman <rms@gnu.org>
parents:
25154
diff
changeset
|
374 (add-hook 'calendar-move-hook (lambda () (view-diary-entries 1))) |
3ab4413f7549
(calendar-move-hook): New hook.
Richard M. Stallman <rms@gnu.org>
parents:
25154
diff
changeset
|
375 |
3ab4413f7549
(calendar-move-hook): New hook.
Richard M. Stallman <rms@gnu.org>
parents:
25154
diff
changeset
|
376 redisplays the diary for whatever date the cursor is moved to." |
3ab4413f7549
(calendar-move-hook): New hook.
Richard M. Stallman <rms@gnu.org>
parents:
25154
diff
changeset
|
377 :type 'hook |
3ab4413f7549
(calendar-move-hook): New hook.
Richard M. Stallman <rms@gnu.org>
parents:
25154
diff
changeset
|
378 :group 'calendar-hooks) |
3ab4413f7549
(calendar-move-hook): New hook.
Richard M. Stallman <rms@gnu.org>
parents:
25154
diff
changeset
|
379 |
3ab4413f7549
(calendar-move-hook): New hook.
Richard M. Stallman <rms@gnu.org>
parents:
25154
diff
changeset
|
380 ;;;###autoload |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
381 (defcustom diary-file "~/diary" |
628 | 382 "*Name of the file in which one's personal diary of dates is kept. |
383 | |
384 The file's entries are lines in any of the forms | |
385 | |
386 MONTH/DAY | |
387 MONTH/DAY/YEAR | |
388 MONTHNAME DAY | |
389 MONTHNAME DAY, YEAR | |
390 DAYNAME | |
391 | |
392 at the beginning of the line; the remainder of the line is the diary entry | |
393 string for that date. MONTH and DAY are one or two digit numbers, YEAR is | |
394 a number and may be written in full or abbreviated to the final two digits. | |
395 If the date does not contain a year, it is generic and applies to any year. | |
396 DAYNAME entries apply to any date on which is on that day of the week. | |
397 MONTHNAME and DAYNAME can be spelled in full, abbreviated to three | |
398 characters (with or without a period), capitalized or not. Any of DAY, | |
399 MONTH, or MONTHNAME, YEAR can be `*' which matches any day, month, or year, | |
400 respectively. | |
401 | |
402 The European style (in which the day precedes the month) can be used | |
403 instead, if you execute `european-calendar' when in the calendar, or set | |
404 `european-calendar-style' to t in your .emacs file. The European forms are | |
405 | |
406 DAY/MONTH | |
407 DAY/MONTH/YEAR | |
408 DAY MONTHNAME | |
409 DAY MONTHNAME YEAR | |
410 DAYNAME | |
411 | |
412 To revert to the default American style from the European style, execute | |
413 `american-calendar' in the calendar. | |
414 | |
7404 | 415 A diary entry can be preceded by the character |
416 `diary-nonmarking-symbol' (ordinarily `&') to make that entry | |
417 nonmarking--that is, it will not be marked on dates in the calendar | |
418 window but will appear in a diary window. | |
628 | 419 |
420 Multiline diary entries are made by indenting lines after the first with | |
421 either a TAB or one or more spaces. | |
422 | |
423 Lines not in one the above formats are ignored. Here are some sample diary | |
424 entries (in the default American style): | |
425 | |
426 12/22/1988 Twentieth wedding anniversary!! | |
427 &1/1. Happy New Year! | |
428 10/22 Ruth's birthday. | |
429 21: Payday | |
430 Tuesday--weekly meeting with grad students at 10am | |
431 Supowit, Shen, Bitner, and Kapoor to attend. | |
432 1/13/89 Friday the thirteenth!! | |
433 &thu 4pm squash game with Lloyd. | |
434 mar 16 Dad's birthday | |
435 April 15, 1989 Income tax due. | |
436 &* 15 time cards due. | |
437 | |
438 If the first line of a diary entry consists only of the date or day name with | |
6737 | 439 no trailing blanks or punctuation, then that line is not displayed in the |
440 diary window; only the continuation lines is shown. For example, the | |
628 | 441 single diary entry |
442 | |
443 02/11/1989 | |
444 Bill Blattner visits Princeton today | |
445 2pm Cognitive Studies Committee meeting | |
446 2:30-5:30 Lizzie at Lawrenceville for `Group Initiative' | |
447 4:00pm Jamie Tappenden | |
448 7:30pm Dinner at George and Ed's for Alan Ryan | |
449 7:30-10:00pm dance at Stewart Country Day School | |
450 | |
451 will appear in the diary window without the date line at the beginning. This | |
452 facility allows the diary window to look neater, but can cause confusion if | |
453 used with more than one day's entries displayed. | |
454 | |
455 Diary entries can be based on Lisp sexps. For example, the diary entry | |
456 | |
457 %%(diary-block 11 1 1990 11 10 1990) Vacation | |
458 | |
37001
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
459 causes the diary entry \"Vacation\" to appear from November 1 through November |
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
460 10, 1990. Other functions available are `diary-float', `diary-anniversary', |
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
461 `diary-cyclic', `diary-day-of-year', `diary-iso-date', `diary-french-date', |
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
462 `diary-hebrew-date', `diary-islamic-date', `diary-mayan-date', |
13042
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
463 `diary-chinese-date', `diary-coptic-date', `diary-ethiopic-date', |
14915
5a4b28f19b75
Add references to Persian calendar.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
14687
diff
changeset
|
464 `diary-persian-date', `diary-yahrzeit', `diary-sunrise-sunset', |
37001
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
465 `diary-phases-of-moon', `diary-parasha', `diary-omer', `diary-rosh-hodesh', |
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
466 and `diary-sabbath-candles'. See the documentation for the function |
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
467 `list-sexp-diary-entries' for more details. |
36906 | 468 |
37001
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
469 Diary entries based on the Hebrew and/or the Islamic calendar are also |
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
470 possible, but because these are somewhat slow, they are ignored |
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
471 unless you set the `nongregorian-diary-listing-hook' and the |
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
472 `nongregorian-diary-marking-hook' appropriately. See the documentation |
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
473 for these functions for details. |
628 | 474 |
475 Diary files can contain directives to include the contents of other files; for | |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
476 details, see the documentation for the variable `list-diary-entries-hook'." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
477 :type 'file |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
478 :group 'diary) |
628 | 479 |
957 | 480 ;;;###autoload |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
481 (defcustom diary-nonmarking-symbol "&" |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
482 "*Symbol indicating that a diary entry is not to be marked in the calendar." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
483 :type 'string |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
484 :group 'diary) |
628 | 485 |
957 | 486 ;;;###autoload |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
487 (defcustom hebrew-diary-entry-symbol "H" |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
488 "*Symbol indicating a diary entry according to the Hebrew calendar." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
489 :type 'string |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
490 :group 'diary) |
628 | 491 |
957 | 492 ;;;###autoload |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
493 (defcustom islamic-diary-entry-symbol "I" |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
494 "*Symbol indicating a diary entry according to the Islamic calendar." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
495 :type 'string |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
496 :group 'diary) |
628 | 497 |
957 | 498 ;;;###autoload |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
499 (defcustom diary-include-string "#include" |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
500 "*The string indicating inclusion of another file of diary entries. |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
501 See the documentation for the function `include-other-diary-files'." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
502 :type 'string |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
503 :group 'diary) |
628 | 504 |
49736
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
505 (defcustom diary-glob-file-regexp-prefix "^\\#" |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
506 "*The regular expression that gets pre-pended to each of the attribute-regexp's for file-wide specifiers." |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
507 :type 'regexp |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
508 :group 'diary) |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
509 |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
510 (defcustom diary-face-attrs '( |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
511 (" *\\[foreground:\\([-a-z]+\\)\\]$" 1 :foreground string) |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
512 (" *\\[background:\\([-a-z]+\\)\\]$" 1 :background string) |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
513 (" *\\[width:\\([-a-z]+\\)\\]$" 1 :width symbol) |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
514 (" *\\[height:\\([-0-9a-z]+\\)\\]$" 1 :height int) |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
515 (" *\\[weight:\\([-a-z]+\\)\\]$" 1 :weight symbol) |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
516 (" *\\[slant:\\([-a-z]+\\)\\]$" 1 :slant symbol) |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
517 (" *\\[underline:\\([-a-z]+\\)\\]$" 1 :underline stringtnil) |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
518 (" *\\[overline:\\([-a-z]+\\)\\]$" 1 :overline stringtnil) |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
519 (" *\\[strike-through:\\([-a-z]+\\)\\]$" 1 :strike-through stringtnil) |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
520 (" *\\[inverse-video:\\([-a-z]+\\)\\]$" 1 :inverse-video tnil) |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
521 (" *\\[face:\\([-0-9a-z]+\\)\\]$" 1 :face string) |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
522 (" *\\[font:\\([-a-z0-9]+\\)\\]$" 1 :font string) |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
523 ;Unsupported (" *\\[box:\\([-a-z]+\\)\\]$" 1 :box) |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
524 ;Unsupported (" *\\[stipple:\\([-a-z]+\\)\\]$" 1 :stipple) |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
525 ) |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
526 "*A list of (regexp regnum attr attrtype) lists where the regexp says how to find the tag, the regnum says which parenthetical sub-regexp this regexp looks for, and the attr says which attribute of the face (or that this _is_ a face) is being modified." |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
527 :type 'sexp |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
528 :group 'diary) |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
529 |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
530 (defcustom diary-file-name-prefix nil |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
531 "If non-nil then each entry in the diary list will be prefixed with the name of the file in which it was defined." |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
532 :type 'boolean |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
533 :group 'diary) |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
534 |
957 | 535 ;;;###autoload |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
536 (defcustom sexp-diary-entry-symbol "%%" |
31730
719a230f8091
Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31671
diff
changeset
|
537 "*The string used to indicate a sexp diary entry in `diary-file'. |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
538 See the documentation for the function `list-sexp-diary-entries'." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
539 :type 'string |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
540 :group 'diary) |
628 | 541 |
957 | 542 ;;;###autoload |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
543 (defcustom abbreviated-calendar-year t |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
544 "*Interpret a two-digit year DD in a diary entry as either 19DD or 20DD. |
37001
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
545 For the Gregorian calendar; similarly for the Hebrew and Islamic calendars. |
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
546 If this variable is nil, years must be written in full." |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
547 :type 'boolean |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
548 :group 'diary) |
628 | 549 |
957 | 550 ;;;###autoload |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
551 (defcustom european-calendar-style nil |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
552 "*Use the European style of dates in the diary and in any displays. |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
553 If this variable is t, a date 1/2/1990 would be interpreted as February 1, |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
554 1990. The accepted European date styles are |
628 | 555 |
556 DAY/MONTH | |
557 DAY/MONTH/YEAR | |
558 DAY MONTHNAME | |
559 DAY MONTHNAME YEAR | |
560 DAYNAME | |
561 | |
562 Names can be capitalized or not, written in full, or abbreviated to three | |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
563 characters with or without a period." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
564 :type 'boolean |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
565 :group 'diary) |
628 | 566 |
957 | 567 ;;;###autoload |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
568 (defcustom american-date-diary-pattern |
628 | 569 '((month "/" day "[^/0-9]") |
570 (month "/" day "/" year "[^0-9]") | |
571 (monthname " *" day "[^,0-9]") | |
572 (monthname " *" day ", *" year "[^0-9]") | |
573 (dayname "\\W")) | |
574 "*List of pseudo-patterns describing the American patterns of date used. | |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
575 See the documentation of `diary-date-forms' for an explanation." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
576 :type '(repeat (choice (cons :tag "Backup" |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
577 :value (backup . nil) |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
578 (const backup) |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
579 (repeat (list :inline t :format "%v" |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
580 (symbol :tag "Keyword") |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
581 (choice symbol regexp)))) |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
582 (repeat (list :inline t :format "%v" |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
583 (symbol :tag "Keyword") |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
584 (choice symbol regexp))))) |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
585 :group 'diary) |
628 | 586 |
957 | 587 ;;;###autoload |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
588 (defcustom european-date-diary-pattern |
628 | 589 '((day "/" month "[^/0-9]") |
590 (day "/" month "/" year "[^0-9]") | |
25154
4c873bb645d8
(european-date-diary-pattern): Fix pattern so it
Richard M. Stallman <rms@gnu.org>
parents:
24891
diff
changeset
|
591 (backup day " *" monthname "\\W+\\<\\([^*0-9]\\|\\([0-9]+[:aApP]\\)\\)") |
628 | 592 (day " *" monthname " *" year "[^0-9]") |
593 (dayname "\\W")) | |
594 "*List of pseudo-patterns describing the European patterns of date used. | |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
595 See the documentation of `diary-date-forms' for an explanation." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
596 :type '(repeat (choice (cons :tag "Backup" |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
597 :value (backup . nil) |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
598 (const backup) |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
599 (repeat (list :inline t :format "%v" |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
600 (symbol :tag "Keyword") |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
601 (choice symbol regexp)))) |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
602 (repeat (list :inline t :format "%v" |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
603 (symbol :tag "Keyword") |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
604 (choice symbol regexp))))) |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
605 :group 'diary) |
628 | 606 |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
607 (defcustom diary-date-forms |
628 | 608 (if european-calendar-style |
609 european-date-diary-pattern | |
610 american-date-diary-pattern) | |
611 "*List of pseudo-patterns describing the forms of date used in the diary. | |
44371 | 612 The patterns on the list must be MUTUALLY EXCLUSIVE and should not match |
628 | 613 any portion of the diary entry itself, just the date component. |
614 | |
615 A pseudo-pattern is a list of regular expressions and the keywords `month', | |
616 `day', `year', `monthname', and `dayname'. The keyword `monthname' will | |
617 match the name of the month, capitalized or not, or its three-letter | |
618 abbreviation, followed by a period or not; it will also match `*'. | |
619 Similarly, `dayname' will match the name of the day, capitalized or not, or | |
620 its three-letter abbreviation, followed by a period or not. The keywords | |
621 `month', `day', and `year' will match those numerical values, preceded by | |
622 arbitrarily many zeros; they will also match `*'. | |
623 | |
624 The matching of the diary entries with the date forms is done with the | |
625 standard syntax table from Fundamental mode, but with the `*' changed so | |
626 that it is a word constituent. | |
627 | |
628 If, to be mutually exclusive, a pseudo-pattern must match a portion of the | |
629 diary entry itself, the first element of the pattern MUST be `backup'. This | |
957 | 630 directive causes the date recognizer to back up to the beginning of the |
631 current word of the diary entry, so in no case can the pattern match more than | |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
632 a portion of the first word of the diary entry." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
633 :type '(repeat (choice (cons :tag "Backup" |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
634 :value (backup . nil) |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
635 (const backup) |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
636 (repeat (list :inline t :format "%v" |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
637 (symbol :tag "Keyword") |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
638 (choice symbol regexp)))) |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
639 (repeat (list :inline t :format "%v" |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
640 (symbol :tag "Keyword") |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
641 (choice symbol regexp))))) |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
642 :group 'diary) |
957 | 643 |
644 ;;;###autoload | |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
645 (defcustom european-calendar-display-form |
957 | 646 '((if dayname (concat dayname ", ")) day " " monthname " " year) |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
647 "*Pseudo-pattern governing the way a date appears in the European style. |
48366
9dad713d153a
Patch of Alan Shutko <ats@acm.org> by way of rms.
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47333
diff
changeset
|
648 See the documentation of `calendar-date-display-form' for an explanation." |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
649 :type 'sexp |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
650 :group 'calendar) |
628 | 651 |
957 | 652 ;;;###autoload |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
653 (defcustom american-calendar-display-form |
957 | 654 '((if dayname (concat dayname ", ")) monthname " " day ", " year) |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
655 "*Pseudo-pattern governing the way a date appears in the American style. |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
656 See the documentation of `calendar-date-display-form' for an explanation." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
657 :type 'sexp |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
658 :group 'calendar) |
628 | 659 |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
660 (defcustom calendar-date-display-form |
628 | 661 (if european-calendar-style |
662 european-calendar-display-form | |
663 american-calendar-display-form) | |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
664 "*Pseudo-pattern governing the way a date appears. |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
665 |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
666 Used by the function `calendar-date-string', a pseudo-pattern is a list of |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
667 expressions that can involve the keywords `month', `day', and `year', all |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
668 numbers in string form, and `monthname' and `dayname', both alphabetic |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
669 strings. For example, the ISO standard would use the pseudo- pattern |
628 | 670 |
671 '(year \"-\" month \"-\" day) | |
672 | |
673 while a typical American form would be | |
674 | |
675 '(month \"/\" day \"/\" (substring year -2)) | |
676 | |
677 and | |
678 | |
679 '((format \"%9s, %9s %2s, %4s\" dayname monthname day year)) | |
680 | |
681 would give the usual American style in fixed-length fields. | |
682 | |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
683 See the documentation of the function `calendar-date-string'." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
684 :type 'sexp |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
685 :group 'calendar) |
628 | 686 |
687 (defun european-calendar () | |
688 "Set the interpretation and display of dates to the European style." | |
689 (interactive) | |
690 (setq european-calendar-style t) | |
691 (setq calendar-date-display-form european-calendar-display-form) | |
692 (setq diary-date-forms european-date-diary-pattern) | |
693 (update-calendar-mode-line)) | |
694 | |
695 (defun american-calendar () | |
696 "Set the interpretation and display of dates to the American style." | |
697 (interactive) | |
698 (setq european-calendar-style nil) | |
699 (setq calendar-date-display-form american-calendar-display-form) | |
700 (setq diary-date-forms american-date-diary-pattern) | |
701 (update-calendar-mode-line)) | |
702 | |
957 | 703 ;;;###autoload |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
704 (defcustom print-diary-entries-hook 'lpr-buffer |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
705 "*List of functions called after a temporary diary buffer is prepared. |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
706 The buffer shows only the diary entries currently visible in the diary |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
707 buffer. The default just does the printing. Other uses might include, for |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
708 example, rearranging the lines into order by day and time, saving the buffer |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
709 instead of deleting it, or changing the function used to do the printing." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
710 :type 'hook |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
711 :group 'diary) |
628 | 712 |
732 | 713 ;;;###autoload |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
714 (defcustom list-diary-entries-hook nil |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
715 "*List of functions called after diary file is culled for relevant entries. |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
716 It is to be used for diary entries that are not found in the diary file. |
628 | 717 |
718 A function `include-other-diary-files' is provided for use as the value of | |
719 this hook. This function enables you to use shared diary files together | |
7404 | 720 with your own. The files included are specified in the diary file by lines |
628 | 721 of the form |
722 | |
723 #include \"filename\" | |
724 | |
725 This is recursive; that is, #include directives in files thus included are | |
726 obeyed. You can change the \"#include\" to some other string by changing | |
727 the variable `diary-include-string'. When you use `include-other-diary-files' | |
728 as part of the list-diary-entries-hook, you will probably also want to use the | |
7404 | 729 function `mark-included-diary-files' as part of `mark-diary-entries-hook'. |
628 | 730 |
731 For example, you could use | |
732 | |
733 (setq list-diary-entries-hook | |
957 | 734 '(include-other-diary-files sort-diary-entries)) |
628 | 735 (setq diary-display-hook 'fancy-diary-display) |
736 | |
7404 | 737 in your `.emacs' file to cause the fancy diary buffer to be displayed with |
628 | 738 diary entries from various included files, each day's entries sorted into |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
739 lexicographic order." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
740 :type 'hook |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
741 :group 'diary) |
628 | 742 |
732 | 743 ;;;###autoload |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
744 (defcustom diary-hook nil |
4453
7f41b3648380
(diary-display-hook): Change default and fix doc string.
Richard M. Stallman <rms@gnu.org>
parents:
4339
diff
changeset
|
745 "*List of functions called after the display of the diary. |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
746 Can be used for appointment notification." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
747 :type 'hook |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
748 :group 'diary) |
4453
7f41b3648380
(diary-display-hook): Change default and fix doc string.
Richard M. Stallman <rms@gnu.org>
parents:
4339
diff
changeset
|
749 |
7f41b3648380
(diary-display-hook): Change default and fix doc string.
Richard M. Stallman <rms@gnu.org>
parents:
4339
diff
changeset
|
750 ;;;###autoload |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
751 (defcustom diary-display-hook nil |
628 | 752 "*List of functions that handle the display of the diary. |
6737 | 753 If nil (the default), `simple-diary-display' is used. Use `ignore' for no |
4453
7f41b3648380
(diary-display-hook): Change default and fix doc string.
Richard M. Stallman <rms@gnu.org>
parents:
4339
diff
changeset
|
754 diary display. |
628 | 755 |
756 Ordinarily, this just displays the diary buffer (with holidays indicated in | |
757 the mode line), if there are any relevant entries. At the time these | |
758 functions are called, the variable `diary-entries-list' is a list, in order | |
759 by date, of all relevant diary entries in the form of ((MONTH DAY YEAR) | |
760 STRING), where string is the diary entry for the given date. This can be | |
4453
7f41b3648380
(diary-display-hook): Change default and fix doc string.
Richard M. Stallman <rms@gnu.org>
parents:
4339
diff
changeset
|
761 used, for example, a different buffer for display (perhaps combined with |
7f41b3648380
(diary-display-hook): Change default and fix doc string.
Richard M. Stallman <rms@gnu.org>
parents:
4339
diff
changeset
|
762 holidays), or produce hard copy output. |
628 | 763 |
764 A function `fancy-diary-display' is provided as an alternative | |
765 choice for this hook; this function prepares a special noneditable diary | |
766 buffer with the relevant diary entries that has neat day-by-day arrangement | |
767 with headings. The fancy diary buffer will show the holidays unless the | |
768 variable `holidays-in-diary-buffer' is set to nil. Ordinarily, the fancy | |
769 diary buffer will not show days for which there are no diary entries, even | |
770 if that day is a holiday; if you want such days to be shown in the fancy | |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
771 diary buffer, set the variable `diary-list-include-blanks' to t." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
772 :type 'hook |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
773 :group 'diary) |
628 | 774 |
732 | 775 ;;;###autoload |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
776 (defcustom nongregorian-diary-listing-hook nil |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
777 "*List of functions called for listing diary file and included files. |
37001
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
778 As the files are processed for diary entries, these functions are used to cull |
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
779 relevant entries. You can use either or both of `list-hebrew-diary-entries' |
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
780 and `list-islamic-diary-entries'. The documentation for these functions |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
781 describes the style of such diary entries." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
782 :type 'hook |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
783 :group 'diary) |
957 | 784 |
785 ;;;###autoload | |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
786 (defcustom mark-diary-entries-hook nil |
628 | 787 "*List of functions called after marking diary entries in the calendar. |
788 | |
789 A function `mark-included-diary-files' is also provided for use as the | |
31730
719a230f8091
Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31671
diff
changeset
|
790 `mark-diary-entries-hook'; it enables you to use shared diary files together |
7404 | 791 with your own. The files included are specified in the diary file by lines |
628 | 792 of the form |
793 #include \"filename\" | |
794 This is recursive; that is, #include directives in files thus included are | |
795 obeyed. You can change the \"#include\" to some other string by changing the | |
796 variable `diary-include-string'. When you use `mark-included-diary-files' as | |
797 part of the mark-diary-entries-hook, you will probably also want to use the | |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
798 function `include-other-diary-files' as part of `list-diary-entries-hook'." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
799 :type 'hook |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
800 :group 'diary) |
628 | 801 |
732 | 802 ;;;###autoload |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
803 (defcustom nongregorian-diary-marking-hook nil |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
804 "*List of functions called for marking diary file and included files. |
37001
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
805 As the files are processed for diary entries, these functions are used to cull |
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
806 relevant entries. You can use either or both of `mark-hebrew-diary-entries' |
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
807 and `mark-islamic-diary-entries'. The documentation for these functions |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
808 describes the style of such diary entries." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
809 :type 'hook |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
810 :group 'diary) |
628 | 811 |
732 | 812 ;;;###autoload |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
813 (defcustom diary-list-include-blanks nil |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
814 "*If nil, do not include days with no diary entry in the list of diary entries. |
23121
1e4f226ada30
(diary-list-include-blanks): Doc fix..
Karl Heuer <kwzh@gnu.org>
parents:
22270
diff
changeset
|
815 Such days will then not be shown in the fancy diary buffer, even if they |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
816 are holidays." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
817 :type 'boolean |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
818 :group 'diary) |
628 | 819 |
957 | 820 ;;;###autoload |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
821 (defcustom holidays-in-diary-buffer t |
6737 | 822 "*Non-nil means include holidays in the diary display. |
823 The holidays appear in the mode line of the diary buffer, or in the | |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
824 fancy diary buffer next to the date. This slows down the diary functions |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
825 somewhat; setting it to nil makes the diary display faster." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
826 :type 'boolean |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
827 :group 'holidays) |
628 | 828 |
3448
b7d345eaae47
(calendar-mode): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
2997
diff
changeset
|
829 (defvar calendar-mark-ring nil) |
b7d345eaae47
(calendar-mode): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
2997
diff
changeset
|
830 |
957 | 831 ;;;###autoload |
6737 | 832 (put 'general-holidays 'risky-local-variable t) |
833 ;;;###autoload | |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
834 (defcustom general-holidays |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
835 '((holiday-fixed 1 1 "New Year's Day") |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
836 (holiday-float 1 1 3 "Martin Luther King Day") |
20821
18188475b33b
Fix mispelling.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
20638
diff
changeset
|
837 (holiday-fixed 2 2 "Groundhog Day") |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
838 (holiday-fixed 2 14 "Valentine's Day") |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
839 (holiday-float 2 1 3 "President's Day") |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
840 (holiday-fixed 3 17 "St. Patrick's Day") |
14937
a2cc3eb1633b
Spelling fix.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
14915
diff
changeset
|
841 (holiday-fixed 4 1 "April Fools' Day") |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
842 (holiday-float 5 0 2 "Mother's Day") |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
843 (holiday-float 5 1 -1 "Memorial Day") |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
844 (holiday-fixed 6 14 "Flag Day") |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
845 (holiday-float 6 0 3 "Father's Day") |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
846 (holiday-fixed 7 4 "Independence Day") |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
847 (holiday-float 9 1 1 "Labor Day") |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
848 (holiday-float 10 1 2 "Columbus Day") |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
849 (holiday-fixed 10 31 "Halloween") |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
850 (holiday-fixed 11 11 "Veteran's Day") |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
851 (holiday-float 11 4 4 "Thanksgiving")) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
852 "*General holidays. Default value is for the United States. |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
853 See the documentation for `calendar-holidays' for details." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
854 :type 'sexp |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
855 :group 'holidays) |
957 | 856 |
857 ;;;###autoload | |
13042
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
858 (put 'oriental-holidays 'risky-local-variable t) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
859 ;;;###autoload |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
860 (defcustom oriental-holidays |
13042
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
861 '((if (fboundp 'atan) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
862 (holiday-chinese-new-year))) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
863 "*Oriental holidays. |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
864 See the documentation for `calendar-holidays' for details." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
865 :type 'sexp |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
866 :group 'holidays) |
13042
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
867 |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
868 ;;;###autoload |
6737 | 869 (put 'local-holidays 'risky-local-variable t) |
870 ;;;###autoload | |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
871 (defcustom local-holidays nil |
957 | 872 "*Local holidays. |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
873 See the documentation for `calendar-holidays' for details." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
874 :type 'sexp |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
875 :group 'holidays) |
957 | 876 |
877 ;;;###autoload | |
6737 | 878 (put 'other-holidays 'risky-local-variable t) |
879 ;;;###autoload | |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
880 (defcustom other-holidays nil |
957 | 881 "*User defined holidays. |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
882 See the documentation for `calendar-holidays' for details." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
883 :type 'sexp |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
884 :group 'holidays) |
957 | 885 |
886 ;;;###autoload | |
6737 | 887 (put 'hebrew-holidays-1 'risky-local-variable t) |
888 ;;;###autoload | |
4161
8e236d4ce64b
(hebrew-holidays): Split into 4 sub-variables.
Richard M. Stallman <rms@gnu.org>
parents:
4086
diff
changeset
|
889 (defvar hebrew-holidays-1 |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
890 '((holiday-rosh-hashanah-etc) |
628 | 891 (if all-hebrew-calendar-holidays |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
892 (holiday-julian |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
893 11 |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
894 (let* ((m displayed-month) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
895 (y displayed-year) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
896 (year)) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
897 (increment-calendar-month m y -1) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
898 (let ((year (extract-calendar-year |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
899 (calendar-julian-from-absolute |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
900 (calendar-absolute-from-gregorian |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
901 (list m 1 y)))))) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
902 (if (zerop (% (1+ year) 4)) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
903 22 |
4161
8e236d4ce64b
(hebrew-holidays): Split into 4 sub-variables.
Richard M. Stallman <rms@gnu.org>
parents:
4086
diff
changeset
|
904 21))) "\"Tal Umatar\" (evening)")))) |
8e236d4ce64b
(hebrew-holidays): Split into 4 sub-variables.
Richard M. Stallman <rms@gnu.org>
parents:
4086
diff
changeset
|
905 |
8e236d4ce64b
(hebrew-holidays): Split into 4 sub-variables.
Richard M. Stallman <rms@gnu.org>
parents:
4086
diff
changeset
|
906 ;;;###autoload |
6737 | 907 (put 'hebrew-holidays-2 'risky-local-variable t) |
908 ;;;###autoload | |
4161
8e236d4ce64b
(hebrew-holidays): Split into 4 sub-variables.
Richard M. Stallman <rms@gnu.org>
parents:
4086
diff
changeset
|
909 (defvar hebrew-holidays-2 |
8e236d4ce64b
(hebrew-holidays): Split into 4 sub-variables.
Richard M. Stallman <rms@gnu.org>
parents:
4086
diff
changeset
|
910 '((if all-hebrew-calendar-holidays |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
911 (holiday-hanukkah) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
912 (holiday-hebrew 9 25 "Hanukkah")) |
628 | 913 (if all-hebrew-calendar-holidays |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
914 (holiday-hebrew |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
915 10 |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
916 (let ((h-year (extract-calendar-year |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
917 (calendar-hebrew-from-absolute |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
918 (calendar-absolute-from-gregorian |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
919 (list displayed-month 28 displayed-year)))))) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
920 (if (= (% (calendar-absolute-from-hebrew (list 10 10 h-year)) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
921 7) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
922 6) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
923 11 10)) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
924 "Tzom Teveth")) |
628 | 925 (if all-hebrew-calendar-holidays |
4161
8e236d4ce64b
(hebrew-holidays): Split into 4 sub-variables.
Richard M. Stallman <rms@gnu.org>
parents:
4086
diff
changeset
|
926 (holiday-hebrew 11 15 "Tu B'Shevat")))) |
8e236d4ce64b
(hebrew-holidays): Split into 4 sub-variables.
Richard M. Stallman <rms@gnu.org>
parents:
4086
diff
changeset
|
927 |
8e236d4ce64b
(hebrew-holidays): Split into 4 sub-variables.
Richard M. Stallman <rms@gnu.org>
parents:
4086
diff
changeset
|
928 ;;;###autoload |
6737 | 929 (put 'hebrew-holidays-3 'risky-local-variable t) |
930 ;;;###autoload | |
4530
c14a75fce9c9
(hebrew-holidays-3): Fix misspelling in var name.
Richard M. Stallman <rms@gnu.org>
parents:
4453
diff
changeset
|
931 (defvar hebrew-holidays-3 |
4161
8e236d4ce64b
(hebrew-holidays): Split into 4 sub-variables.
Richard M. Stallman <rms@gnu.org>
parents:
4086
diff
changeset
|
932 '((if all-hebrew-calendar-holidays |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
933 (holiday-hebrew |
628 | 934 11 |
935 (let ((m displayed-month) | |
936 (y displayed-year)) | |
937 (increment-calendar-month m y 1) | |
938 (let* ((h-year (extract-calendar-year | |
939 (calendar-hebrew-from-absolute | |
940 (calendar-absolute-from-gregorian | |
941 (list m | |
942 (calendar-last-day-of-month m y) | |
943 y))))) | |
944 (s-s | |
945 (calendar-hebrew-from-absolute | |
946 (if (= | |
947 (% (calendar-absolute-from-hebrew | |
948 (list 7 1 h-year)) | |
949 7) | |
950 6) | |
951 (calendar-dayname-on-or-before | |
952 6 (calendar-absolute-from-hebrew | |
953 (list 11 17 h-year))) | |
954 (calendar-dayname-on-or-before | |
955 6 (calendar-absolute-from-hebrew | |
956 (list 11 16 h-year)))))) | |
957 (day (extract-calendar-day s-s))) | |
958 day)) | |
4161
8e236d4ce64b
(hebrew-holidays): Split into 4 sub-variables.
Richard M. Stallman <rms@gnu.org>
parents:
4086
diff
changeset
|
959 "Shabbat Shirah")))) |
8e236d4ce64b
(hebrew-holidays): Split into 4 sub-variables.
Richard M. Stallman <rms@gnu.org>
parents:
4086
diff
changeset
|
960 |
8e236d4ce64b
(hebrew-holidays): Split into 4 sub-variables.
Richard M. Stallman <rms@gnu.org>
parents:
4086
diff
changeset
|
961 ;;;###autoload |
6737 | 962 (put 'hebrew-holidays-4 'risky-local-variable t) |
963 ;;;###autoload | |
4161
8e236d4ce64b
(hebrew-holidays): Split into 4 sub-variables.
Richard M. Stallman <rms@gnu.org>
parents:
4086
diff
changeset
|
964 (defvar hebrew-holidays-4 |
8e236d4ce64b
(hebrew-holidays): Split into 4 sub-variables.
Richard M. Stallman <rms@gnu.org>
parents:
4086
diff
changeset
|
965 '((holiday-passover-etc) |
628 | 966 (if (and all-hebrew-calendar-holidays |
967 (let* ((m displayed-month) | |
968 (y displayed-year) | |
969 (year)) | |
970 (increment-calendar-month m y -1) | |
971 (let ((year (extract-calendar-year | |
972 (calendar-julian-from-absolute | |
973 (calendar-absolute-from-gregorian | |
974 (list m 1 y)))))) | |
975 (= 21 (% year 28))))) | |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
976 (holiday-julian 3 26 "Kiddush HaHamah")) |
628 | 977 (if all-hebrew-calendar-holidays |
4161
8e236d4ce64b
(hebrew-holidays): Split into 4 sub-variables.
Richard M. Stallman <rms@gnu.org>
parents:
4086
diff
changeset
|
978 (holiday-tisha-b-av-etc)))) |
8e236d4ce64b
(hebrew-holidays): Split into 4 sub-variables.
Richard M. Stallman <rms@gnu.org>
parents:
4086
diff
changeset
|
979 |
8e236d4ce64b
(hebrew-holidays): Split into 4 sub-variables.
Richard M. Stallman <rms@gnu.org>
parents:
4086
diff
changeset
|
980 ;;;###autoload |
6737 | 981 (put 'hebrew-holidays 'risky-local-variable t) |
982 ;;;###autoload | |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
983 (defcustom hebrew-holidays (append hebrew-holidays-1 hebrew-holidays-2 |
4161
8e236d4ce64b
(hebrew-holidays): Split into 4 sub-variables.
Richard M. Stallman <rms@gnu.org>
parents:
4086
diff
changeset
|
984 hebrew-holidays-3 hebrew-holidays-4) |
957 | 985 "*Jewish holidays. |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
986 See the documentation for `calendar-holidays' for details." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
987 :type 'sexp |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
988 :group 'holidays) |
957 | 989 |
990 ;;;###autoload | |
6737 | 991 (put 'christian-holidays 'risky-local-variable t) |
992 ;;;###autoload | |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
993 (defcustom christian-holidays |
957 | 994 '((if all-christian-calendar-holidays |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
995 (holiday-fixed 1 6 "Epiphany")) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
996 (holiday-easter-etc) |
957 | 997 (if all-christian-calendar-holidays |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
998 (holiday-greek-orthodox-easter)) |
957 | 999 (if all-christian-calendar-holidays |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1000 (holiday-fixed 8 15 "Assumption")) |
957 | 1001 (if all-christian-calendar-holidays |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1002 (holiday-advent)) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1003 (holiday-fixed 12 25 "Christmas") |
957 | 1004 (if all-christian-calendar-holidays |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1005 (holiday-julian 12 25 "Eastern Orthodox Christmas"))) |
957 | 1006 "*Christian holidays. |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
1007 See the documentation for `calendar-holidays' for details." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
1008 :type 'sexp |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
1009 :group 'holidays) |
957 | 1010 |
1011 ;;;###autoload | |
6737 | 1012 (put 'islamic-holidays 'risky-local-variable t) |
1013 ;;;###autoload | |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
1014 (defcustom islamic-holidays |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1015 '((holiday-islamic |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1016 1 1 |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1017 (format "Islamic New Year %d" |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1018 (let ((m displayed-month) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1019 (y displayed-year)) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1020 (increment-calendar-month m y 1) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1021 (extract-calendar-year |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1022 (calendar-islamic-from-absolute |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1023 (calendar-absolute-from-gregorian |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1024 (list |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1025 m (calendar-last-day-of-month m y) y))))))) |
628 | 1026 (if all-islamic-calendar-holidays |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1027 (holiday-islamic 1 10 "Ashura")) |
628 | 1028 (if all-islamic-calendar-holidays |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1029 (holiday-islamic 3 12 "Mulad-al-Nabi")) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1030 (if all-islamic-calendar-holidays |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1031 (holiday-islamic 7 26 "Shab-e-Mi'raj")) |
628 | 1032 (if all-islamic-calendar-holidays |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1033 (holiday-islamic 8 15 "Shab-e-Bara't")) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1034 (holiday-islamic 9 1 "Ramadan Begins") |
628 | 1035 (if all-islamic-calendar-holidays |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1036 (holiday-islamic 9 27 "Shab-e Qadr")) |
628 | 1037 (if all-islamic-calendar-holidays |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1038 (holiday-islamic 10 1 "Id-al-Fitr")) |
628 | 1039 (if all-islamic-calendar-holidays |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1040 (holiday-islamic 12 10 "Id-al-Adha"))) |
957 | 1041 "*Islamic holidays. |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
1042 See the documentation for `calendar-holidays' for details." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
1043 :type 'sexp |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
1044 :group 'holidays) |
957 | 1045 |
1046 ;;;###autoload | |
6737 | 1047 (put 'solar-holidays 'risky-local-variable t) |
1048 ;;;###autoload | |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
1049 (defcustom solar-holidays |
957 | 1050 '((if (fboundp 'atan) |
1051 (solar-equinoxes-solstices)) | |
5009
bf77303bd714
(solar-holidays): Change top-level progn to an if.
Richard M. Stallman <rms@gnu.org>
parents:
4861
diff
changeset
|
1052 (if (progn |
bf77303bd714
(solar-holidays): Change top-level progn to an if.
Richard M. Stallman <rms@gnu.org>
parents:
4861
diff
changeset
|
1053 (require 'cal-dst) |
bf77303bd714
(solar-holidays): Change top-level progn to an if.
Richard M. Stallman <rms@gnu.org>
parents:
4861
diff
changeset
|
1054 t) |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1055 (funcall |
5009
bf77303bd714
(solar-holidays): Change top-level progn to an if.
Richard M. Stallman <rms@gnu.org>
parents:
4861
diff
changeset
|
1056 'holiday-sexp |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1057 calendar-daylight-savings-starts |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1058 '(format "Daylight Savings Time Begins %s" |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1059 (if (fboundp 'atan) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1060 (solar-time-string |
7779
866b98279551
(solar-holidays): Revised to use the rewritten and new fcns.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
7760
diff
changeset
|
1061 (/ calendar-daylight-savings-starts-time (float 60)) |
866b98279551
(solar-holidays): Revised to use the rewritten and new fcns.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
7760
diff
changeset
|
1062 calendar-standard-time-zone-name) |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1063 "")))) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1064 (funcall |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1065 'holiday-sexp |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1066 calendar-daylight-savings-ends |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1067 '(format "Daylight Savings Time Ends %s" |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1068 (if (fboundp 'atan) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1069 (solar-time-string |
7779
866b98279551
(solar-holidays): Revised to use the rewritten and new fcns.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
7760
diff
changeset
|
1070 (/ calendar-daylight-savings-ends-time (float 60)) |
866b98279551
(solar-holidays): Revised to use the rewritten and new fcns.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
7760
diff
changeset
|
1071 calendar-daylight-time-zone-name) |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1072 "")))) |
957 | 1073 "*Sun-related holidays. |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
1074 See the documentation for `calendar-holidays' for details." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
1075 :type 'sexp |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
1076 :group 'holidays) |
957 | 1077 |
6737 | 1078 ;;;###autoload |
1079 (put 'calendar-holidays 'risky-local-variable t) | |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
1080 (defcustom calendar-holidays |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1081 (append general-holidays local-holidays other-holidays |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1082 christian-holidays hebrew-holidays islamic-holidays |
37001
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
1083 oriental-holidays solar-holidays) |
31730
719a230f8091
Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31671
diff
changeset
|
1084 "*List of notable days for the command \\[holidays]. |
957 | 1085 |
37001
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
1086 Additional holidays are easy to add to the list, just put them in the list |
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
1087 `other-holidays' in your .emacs file. Similarly, by setting any of |
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
1088 `general-holidays', `local-holidays' `christian-holidays', `hebrew-holidays', |
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
1089 `islamic-holidays', `oriental-holidays', or `solar-holidays' to nil in your |
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
1090 .emacs file, you can eliminate unwanted categories of holidays. The intention |
69ed032fdcce
Undo changes made by John Wiegley in previous revision.
Gerd Moellmann <gerd@gnu.org>
parents:
36906
diff
changeset
|
1091 is that (in the US) `local-holidays' be set in site-init.el and |
13042
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1092 `other-holidays' be set by the user. |
957 | 1093 |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1094 Entries on the list are expressions that return (possibly empty) lists of |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1095 items of the form ((month day year) string) of a holiday in the in the |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1096 three-month period centered around `displayed-month' of `displayed-year'. |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1097 Several basic functions are provided for this purpose: |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1098 |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1099 (holiday-fixed MONTH DAY STRING) is a fixed date on the Gregorian calendar |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1100 (holiday-float MONTH DAYNAME K STRING &optional day) is the Kth DAYNAME in |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1101 MONTH on the Gregorian calendar (0 for Sunday, |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1102 etc.); K<0 means count back from the end of the |
31730
719a230f8091
Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31671
diff
changeset
|
1103 month. An optional parameter DAY means the Kth |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1104 DAYNAME after/before MONTH DAY. |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1105 (holiday-hebrew MONTH DAY STRING) a fixed date on the Hebrew calendar |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1106 (holiday-islamic MONTH DAY STRING) a fixed date on the Islamic calendar |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1107 (holiday-julian MONTH DAY STRING) a fixed date on the Julian calendar |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1108 (holiday-sexp SEXP STRING) SEXP is a Gregorian-date-valued expression |
957 | 1109 in the variable `year'; if it evaluates to |
1110 a visible date, that's the holiday; if it | |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1111 evaluates to nil, there's no holiday. STRING |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1112 is an expression in the variable `date'. |
628 | 1113 |
1114 For example, to add Bastille Day, celebrated in France on July 14, add | |
1115 | |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1116 (holiday-fixed 7 14 \"Bastille Day\") |
628 | 1117 |
1118 to the list. To add Hurricane Supplication Day, celebrated in the Virgin | |
1119 Islands on the fourth Monday in August, add | |
1120 | |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1121 (holiday-float 8 1 4 \"Hurricane Supplication Day\") |
628 | 1122 |
1123 to the list (the last Monday would be specified with `-1' instead of `4'). | |
957 | 1124 To add the last day of Hanukkah to the list, use |
1125 | |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1126 (holiday-hebrew 10 2 \"Last day of Hanukkah\") |
628 | 1127 |
1128 since the Hebrew months are numbered with 1 starting from Nisan, while to | |
1129 add the Islamic feast celebrating Mohammed's birthday use | |
1130 | |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1131 (holiday-islamic 3 12 \"Mohammed's Birthday\") |
628 | 1132 |
1133 since the Islamic months are numbered from 1 starting with Muharram. To | |
1134 add Thomas Jefferson's birthday, April 2, 1743 (Julian), use | |
1135 | |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1136 (holiday-julian 4 2 \"Jefferson's Birthday\") |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1137 |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1138 To include a holiday conditionally, use the sexp form or a conditional. For |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1139 example, to include American presidential elections, which occur on the first |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1140 Tuesday after the first Monday in November of years divisible by 4, add |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1141 |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1142 (holiday-sexp |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1143 (if (zerop (% year 4)) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1144 (calendar-gregorian-from-absolute |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1145 (1+ (calendar-dayname-on-or-before |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1146 1 (+ 6 (calendar-absolute-from-gregorian |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1147 (list 11 1 year))))))) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1148 \"US Presidential Election\") |
957 | 1149 |
1150 or | |
1151 | |
628 | 1152 (if (zerop (% displayed-year 4)) |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1153 (holiday-fixed 11 |
628 | 1154 (extract-calendar-day |
1155 (calendar-gregorian-from-absolute | |
1156 (1+ (calendar-dayname-on-or-before | |
1157 1 (+ 6 (calendar-absolute-from-gregorian | |
1158 (list 11 1 displayed-year))))))) | |
1159 \"US Presidential Election\")) | |
1160 | |
1161 to the list. To include the phases of the moon, add | |
1162 | |
1163 (lunar-phases) | |
1164 | |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1165 to the holiday list, where `lunar-phases' is an Emacs-Lisp function that |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1166 you've written to return a (possibly empty) list of the relevant VISIBLE dates |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1167 with descriptive strings such as |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1168 |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
1169 (((2 6 1989) \"New Moon\") ((2 12 1989) \"First Quarter Moon\") ... )." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
1170 :type 'sexp |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
1171 :group 'holidays) |
628 | 1172 |
1173 (defconst calendar-buffer "*Calendar*" | |
1174 "Name of the buffer used for the calendar.") | |
1175 | |
1176 (defconst holiday-buffer "*Holidays*" | |
1177 "Name of the buffer used for the displaying the holidays.") | |
1178 | |
1179 (defconst fancy-diary-buffer "*Fancy Diary Entries*" | |
1180 "Name of the buffer used for the optional fancy display of the diary.") | |
1181 | |
22261
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
1182 (defconst other-calendars-buffer "*Other Calendars*" |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
1183 "Name of the buffer used for the display of date on other calendars.") |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
1184 |
9709
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1185 (defconst lunar-phases-buffer "*Phases of Moon*" |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1186 "Name of the buffer used for the lunar phases.") |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1187 |
628 | 1188 (defmacro increment-calendar-month (mon yr n) |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1189 "Move the variables MON and YR to the month and year by N months. |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1190 Forward if N is positive or backward if N is negative." |
26427
3b6cf16f3633
* calendar/calendar.el (calendar-remove-frame-by-deleting):
Sam Steingold <sds@gnu.org>
parents:
26329
diff
changeset
|
1191 `(let ((macro-y (+ (* ,yr 12) ,mon -1 ,n))) |
3b6cf16f3633
* calendar/calendar.el (calendar-remove-frame-by-deleting):
Sam Steingold <sds@gnu.org>
parents:
26329
diff
changeset
|
1192 (setq ,mon (1+ (% macro-y 12))) |
3b6cf16f3633
* calendar/calendar.el (calendar-remove-frame-by-deleting):
Sam Steingold <sds@gnu.org>
parents:
26329
diff
changeset
|
1193 (setq ,yr (/ macro-y 12)))) |
628 | 1194 |
1195 (defmacro calendar-for-loop (var from init to final do &rest body) | |
1196 "Execute a for loop." | |
26427
3b6cf16f3633
* calendar/calendar.el (calendar-remove-frame-by-deleting):
Sam Steingold <sds@gnu.org>
parents:
26329
diff
changeset
|
1197 `(let ((,var (1- ,init))) |
3b6cf16f3633
* calendar/calendar.el (calendar-remove-frame-by-deleting):
Sam Steingold <sds@gnu.org>
parents:
26329
diff
changeset
|
1198 (while (>= ,final (setq ,var (1+ ,var))) |
3b6cf16f3633
* calendar/calendar.el (calendar-remove-frame-by-deleting):
Sam Steingold <sds@gnu.org>
parents:
26329
diff
changeset
|
1199 ,@body))) |
628 | 1200 |
1201 (defmacro calendar-sum (index initial condition expression) | |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1202 "For INDEX = INITIAL et seq, as long as CONDITION holds, sum EXPRESSION." |
26427
3b6cf16f3633
* calendar/calendar.el (calendar-remove-frame-by-deleting):
Sam Steingold <sds@gnu.org>
parents:
26329
diff
changeset
|
1203 `(let ((,index ,initial) |
3b6cf16f3633
* calendar/calendar.el (calendar-remove-frame-by-deleting):
Sam Steingold <sds@gnu.org>
parents:
26329
diff
changeset
|
1204 (sum 0)) |
3b6cf16f3633
* calendar/calendar.el (calendar-remove-frame-by-deleting):
Sam Steingold <sds@gnu.org>
parents:
26329
diff
changeset
|
1205 (while ,condition |
3b6cf16f3633
* calendar/calendar.el (calendar-remove-frame-by-deleting):
Sam Steingold <sds@gnu.org>
parents:
26329
diff
changeset
|
1206 (setq sum (+ sum ,expression)) |
3b6cf16f3633
* calendar/calendar.el (calendar-remove-frame-by-deleting):
Sam Steingold <sds@gnu.org>
parents:
26329
diff
changeset
|
1207 (setq ,index (1+ ,index))) |
3b6cf16f3633
* calendar/calendar.el (calendar-remove-frame-by-deleting):
Sam Steingold <sds@gnu.org>
parents:
26329
diff
changeset
|
1208 sum)) |
628 | 1209 |
9709
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1210 ;; The following are in-line for speed; they can be called thousands of times |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1211 ;; when looking up holidays or processing the diary. Here, for example, are |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1212 ;; the numbers of calls to calendar/diary/holiday functions in preparing the |
732 | 1213 ;; fancy diary display, for a moderately complex diary file, with functions |
1214 ;; used instead of macros. There were a total of 10000 such calls: | |
1215 ;; | |
1216 ;; 1934 extract-calendar-month | |
1217 ;; 1852 extract-calendar-year | |
1218 ;; 1819 extract-calendar-day | |
1219 ;; 845 calendar-leap-year-p | |
1220 ;; 837 calendar-day-number | |
1221 ;; 775 calendar-absolute-from-gregorian | |
1222 ;; 346 calendar-last-day-of-month | |
1223 ;; 286 hebrew-calendar-last-day-of-month | |
1224 ;; 188 hebrew-calendar-leap-year-p | |
1225 ;; 180 hebrew-calendar-elapsed-days | |
1226 ;; 163 hebrew-calendar-last-month-of-year | |
1227 ;; 66 calendar-date-compare | |
1228 ;; 65 hebrew-calendar-days-in-year | |
1229 ;; 60 calendar-absolute-from-julian | |
1230 ;; 50 calendar-absolute-from-hebrew | |
1231 ;; 43 calendar-date-equal | |
1232 ;; 38 calendar-gregorian-from-absolute | |
1233 ;; . | |
1234 ;; . | |
1235 ;; . | |
1236 ;; | |
1237 ;; The use of these seven macros eliminates the overhead of 92% of the function | |
9709
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1238 ;; calls; it's faster this way. |
732 | 1239 |
9709
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1240 (defsubst extract-calendar-month (date) |
628 | 1241 "Extract the month part of DATE which has the form (month day year)." |
9709
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1242 (car date)) |
628 | 1243 |
9709
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1244 (defsubst extract-calendar-day (date) |
628 | 1245 "Extract the day part of DATE which has the form (month day year)." |
9709
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1246 (car (cdr date))) |
628 | 1247 |
9709
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1248 (defsubst extract-calendar-year (date) |
628 | 1249 "Extract the year part of DATE which has the form (month day year)." |
9709
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1250 (car (cdr (cdr date)))) |
628 | 1251 |
9709
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1252 (defsubst calendar-leap-year-p (year) |
31730
719a230f8091
Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31671
diff
changeset
|
1253 "Return t if YEAR is a Gregorian leap year." |
9709
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1254 (and (zerop (% year 4)) |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1255 (or (not (zerop (% year 100))) |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1256 (zerop (% year 400))))) |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1257 |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1258 ;; The foregoing is a bit faster, but not as clear as the following: |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1259 ;; |
9709
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1260 ;;(defsubst calendar-leap-year-p (year) |
957 | 1261 ;; "Returns t if YEAR is a Gregorian leap year." |
1262 ;; (or | |
1263 ;; (and (= (% year 4) 0) | |
1264 ;; (/= (% year 100) 0)) | |
1265 ;; (= (% year 400) 0))) | |
732 | 1266 |
9709
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1267 (defsubst calendar-last-day-of-month (month year) |
732 | 1268 "The last day in MONTH during YEAR." |
9709
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1269 (if (and (= month 2) (calendar-leap-year-p year)) |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1270 29 |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1271 (aref [31 28 31 30 31 30 31 31 30 31 30 31] (1- month)))) |
732 | 1272 |
9709
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1273 ;; An explanation of the calculation can be found in PascAlgorithms by |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1274 ;; Edward and Ruth Reingold, Scott-Foresman/Little, Brown, 1988. |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1275 |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1276 (defsubst calendar-day-number (date) |
732 | 1277 "Return the day number within the year of the date DATE. |
1278 For example, (calendar-day-number '(1 1 1987)) returns the value 1, | |
1279 while (calendar-day-number '(12 31 1980)) returns 366." | |
9709
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1280 (let* ((month (extract-calendar-month date)) |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1281 (day (extract-calendar-day date)) |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1282 (year (extract-calendar-year date)) |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1283 (day-of-year (+ day (* 31 (1- month))))) |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1284 (if (> month 2) |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1285 (progn |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1286 (setq day-of-year (- day-of-year (/ (+ 23 (* 4 month)) 10))) |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1287 (if (calendar-leap-year-p year) |
732 | 1288 (setq day-of-year (1+ day-of-year))))) |
9709
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1289 day-of-year)) |
732 | 1290 |
9709
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1291 (defsubst calendar-absolute-from-gregorian (date) |
732 | 1292 "The number of days elapsed between the Gregorian date 12/31/1 BC and DATE. |
1293 The Gregorian date Sunday, December 31, 1 BC is imaginary." | |
9709
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1294 (let ((prior-years (1- (extract-calendar-year date)))) |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1295 (+ (calendar-day-number date);; Days this year |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1296 (* 365 prior-years);; + Days in prior years |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1297 (/ prior-years 4);; + Julian leap years |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1298 (- (/ prior-years 100));; - century years |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1299 (/ prior-years 400))));; + Gregorian leap years |
732 | 1300 |
13042
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1301 (autoload 'calendar-goto-today "cal-move" |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1302 "Reposition the calendar window so the current date is visible." |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1303 t) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1304 |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1305 (autoload 'calendar-forward-month "cal-move" |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1306 "Move the cursor forward ARG months." |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1307 t) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1308 |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1309 (autoload 'calendar-forward-year "cal-move" |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1310 "Move the cursor forward by ARG years." |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1311 t) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1312 |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1313 (autoload 'calendar-backward-month "cal-move" |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1314 "Move the cursor backward by ARG months." |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1315 t) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1316 |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1317 (autoload 'calendar-backward-year "cal-move" |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1318 "Move the cursor backward ARG years." |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1319 t) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1320 |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1321 (autoload 'scroll-calendar-left "cal-move" |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1322 "Scroll the displayed calendar left by ARG months." |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1323 t) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1324 |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1325 (autoload 'scroll-calendar-right "cal-move" |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1326 "Scroll the displayed calendar window right by ARG months." |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1327 t) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1328 |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1329 (autoload 'scroll-calendar-left-three-months "cal-move" |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1330 "Scroll the displayed calendar window left by 3*ARG months." |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1331 t) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1332 |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1333 (autoload 'scroll-calendar-right-three-months "cal-move" |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1334 "Scroll the displayed calendar window right by 3*ARG months." |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1335 t) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1336 |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1337 (autoload 'calendar-cursor-to-nearest-date "cal-move" |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1338 "Move the cursor to the closest date." |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1339 t) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1340 |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1341 (autoload 'calendar-forward-day "cal-move" |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1342 "Move the cursor forward ARG days." |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1343 t) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1344 |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1345 (autoload 'calendar-backward-day "cal-move" |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1346 "Move the cursor back ARG days." |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1347 t) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1348 |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1349 (autoload 'calendar-forward-week "cal-move" |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1350 "Move the cursor forward ARG weeks." |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1351 t) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1352 |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1353 (autoload 'calendar-backward-week "cal-move" |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1354 "Move the cursor back ARG weeks." |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1355 t) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1356 |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1357 (autoload 'calendar-beginning-of-week "cal-move" |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1358 "Move the cursor back ARG calendar-week-start-day's." |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1359 t) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1360 |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1361 (autoload 'calendar-end-of-week "cal-move" |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1362 "Move the cursor forward ARG calendar-week-start-day+6's." |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1363 t) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1364 |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1365 (autoload 'calendar-beginning-of-month "cal-move" |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1366 "Move the cursor backward ARG month beginnings." |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1367 t) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1368 |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1369 (autoload 'calendar-end-of-month "cal-move" |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1370 "Move the cursor forward ARG month ends." |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1371 t) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1372 |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1373 (autoload 'calendar-beginning-of-year "cal-move" |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1374 "Move the cursor backward ARG year beginnings." |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1375 t) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1376 |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1377 (autoload 'calendar-end-of-year "cal-move" |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1378 "Move the cursor forward ARG year beginnings." |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1379 t) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1380 |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1381 (autoload 'calendar-cursor-to-visible-date "cal-move" |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1382 "Move the cursor to DATE that is on the screen." |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1383 t) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1384 |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1385 (autoload 'calendar-goto-date "cal-move" |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1386 "Move cursor to DATE." |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1387 t) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1388 |
49350
c4611ea3a05d
(calendar-only-one-frame-setup): Add autoload.
Glenn Morris <rgm@gnu.org>
parents:
48717
diff
changeset
|
1389 (autoload 'calendar-only-one-frame-setup "cal-x" |
c4611ea3a05d
(calendar-only-one-frame-setup): Add autoload.
Glenn Morris <rgm@gnu.org>
parents:
48717
diff
changeset
|
1390 "Start calendar and display it in a dedicated frame.") |
c4611ea3a05d
(calendar-only-one-frame-setup): Add autoload.
Glenn Morris <rgm@gnu.org>
parents:
48717
diff
changeset
|
1391 |
13042
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1392 (autoload 'calendar-one-frame-setup "cal-x" |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1393 "Start calendar and display it in a dedicated frame together with the diary.") |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1394 |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1395 (autoload 'calendar-two-frame-setup "cal-x" |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1396 "Start calendar and diary in separate, dedicated frames.") |
26427
3b6cf16f3633
* calendar/calendar.el (calendar-remove-frame-by-deleting):
Sam Steingold <sds@gnu.org>
parents:
26329
diff
changeset
|
1397 |
13042
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1398 ;;;###autoload |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1399 (defvar calendar-setup nil |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1400 "The frame set up of the calendar. |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1401 The choices are `one-frame' (calendar and diary together in one separate, |
24891
85d8302a2e82
(calendar): Call calendar-only-one-frame-setup if requested.
Karl Heuer <kwzh@gnu.org>
parents:
24243
diff
changeset
|
1402 dedicated frame), `two-frames' (calendar and diary in separate, dedicated |
85d8302a2e82
(calendar): Call calendar-only-one-frame-setup if requested.
Karl Heuer <kwzh@gnu.org>
parents:
24243
diff
changeset
|
1403 frames), `calendar-only' (calendar in a separate, dedicated frame); with |
85d8302a2e82
(calendar): Call calendar-only-one-frame-setup if requested.
Karl Heuer <kwzh@gnu.org>
parents:
24243
diff
changeset
|
1404 any other value the current frame is used.") |
13042
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1405 |
675
85fd29f25c75
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
628
diff
changeset
|
1406 ;;;###autoload |
628 | 1407 (defun calendar (&optional arg) |
13042
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1408 "Choose between the one frame, two frame, or basic calendar displays. |
44084 | 1409 If called with an optional prefix argument, prompts for month and year. |
1410 | |
1411 The original function `calendar' has been renamed `calendar-basic-setup'. | |
1412 See the documentation of that function for more information." | |
13042
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1413 (interactive "P") |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1414 (cond ((equal calendar-setup 'one-frame) (calendar-one-frame-setup arg)) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1415 ((equal calendar-setup 'two-frames) (calendar-two-frame-setup arg)) |
24891
85d8302a2e82
(calendar): Call calendar-only-one-frame-setup if requested.
Karl Heuer <kwzh@gnu.org>
parents:
24243
diff
changeset
|
1416 ((equal calendar-setup 'calendar-only) |
85d8302a2e82
(calendar): Call calendar-only-one-frame-setup if requested.
Karl Heuer <kwzh@gnu.org>
parents:
24243
diff
changeset
|
1417 (calendar-only-one-frame-setup arg)) |
13042
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1418 (t (calendar-basic-setup arg)))) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1419 |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1420 (defun calendar-basic-setup (&optional arg) |
628 | 1421 "Display a three-month calendar in another window. |
1422 The three months appear side by side, with the current month in the middle | |
1423 surrounded by the previous and next months. The cursor is put on today's date. | |
1424 | |
957 | 1425 If called with an optional prefix argument, prompts for month and year. |
1426 | |
628 | 1427 This function is suitable for execution in a .emacs file; appropriate setting |
1428 of the variable `view-diary-entries-initially' will cause the diary entries for | |
1429 the current date to be displayed in another window. The value of the variable | |
1430 `number-of-diary-entries' controls the number of days of diary entries | |
1431 displayed upon initial display of the calendar. | |
1432 | |
1433 Once in the calendar window, future or past months can be moved into view. | |
1434 Arbitrary months can be displayed, or the calendar can be scrolled forward | |
1435 or backward. | |
1436 | |
1437 The cursor can be moved forward or backward by one day, one week, one month, | |
1438 or one year. All of these commands take prefix arguments which, when negative, | |
1439 cause movement in the opposite direction. For convenience, the digit keys | |
1440 and the minus sign are automatically prefixes. The window is replotted as | |
1441 necessary to display the desired date. | |
1442 | |
1443 Diary entries can be marked on the calendar or displayed in another window. | |
1444 | |
31730
719a230f8091
Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31671
diff
changeset
|
1445 Use \\[describe-mode] for details of the key bindings in the calendar window. |
628 | 1446 |
1447 The Gregorian calendar is assumed. | |
1448 | |
957 | 1449 After loading the calendar, the hooks given by the variable |
10436 | 1450 `calendar-load-hook' are run. This is the place to add key bindings to the |
957 | 1451 calendar-mode-map. |
1452 | |
628 | 1453 After preparing the calendar window initially, the hooks given by the variable |
1454 `initial-calendar-window-hook' are run. | |
1455 | |
1456 The hooks given by the variable `today-visible-calendar-hook' are run | |
13671
97293da2f27b
(calendar-setup, calendar-basic-setup, calendar-next-calendar-round-date,
Paul Eggert <eggert@twinsun.com>
parents:
13649
diff
changeset
|
1457 every time the calendar window gets scrolled, if the current date is visible |
628 | 1458 in the window. If it is not visible, the hooks given by the variable |
1459 `today-invisible-calendar-hook' are run. Thus, for example, setting | |
1460 `today-visible-calendar-hook' to 'calendar-star-date will cause today's date | |
1461 to be replaced by asterisks to highlight it whenever it is in the window." | |
1462 (interactive "P") | |
1463 (set-buffer (get-buffer-create calendar-buffer)) | |
1464 (calendar-mode) | |
9747
5586959f3393
Redo the noday option for calendar-read-date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9709
diff
changeset
|
1465 (let* ((pop-up-windows t) |
957 | 1466 (split-height-threshold 1000) |
9709
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1467 (date (if arg |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1468 (calendar-read-date t) |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1469 (calendar-current-date))) |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1470 (month (extract-calendar-month date)) |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1471 (year (extract-calendar-year date))) |
628 | 1472 (pop-to-buffer calendar-buffer) |
9709
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
1473 (increment-calendar-month month year (- calendar-offset)) |
957 | 1474 (generate-calendar-window month year) |
1475 (if (and view-diary-entries-initially (calendar-date-is-visible-p date)) | |
1476 (view-diary-entries | |
1477 (if (vectorp number-of-diary-entries) | |
1478 (aref number-of-diary-entries (calendar-day-of-week date)) | |
1479 number-of-diary-entries)))) | |
1480 (let* ((diary-buffer (get-file-buffer diary-file)) | |
1481 (diary-window (if diary-buffer (get-buffer-window diary-buffer))) | |
1482 (split-height-threshold (if diary-window 2 1000))) | |
1483 (if view-calendar-holidays-initially | |
1484 (list-calendar-holidays))) | |
628 | 1485 (run-hooks 'initial-calendar-window-hook)) |
1486 | |
13649
fb670bed6222
Use new file name diary-lib.
Richard M. Stallman <rms@gnu.org>
parents:
13597
diff
changeset
|
1487 (autoload 'view-diary-entries "diary-lib" |
628 | 1488 "Prepare and display a buffer with diary entries. |
7404 | 1489 Searches your diary file for entries that match ARG days starting with |
628 | 1490 the date indicated by the cursor position in the displayed three-month |
1491 calendar." | |
1492 t) | |
1493 | |
957 | 1494 (autoload 'calendar-sunrise-sunset "solar" |
1495 "Local time of sunrise and sunset for date under cursor." | |
1496 t) | |
1497 | |
1498 (autoload 'calendar-phases-of-moon "lunar" | |
1499 "Create a buffer of the phases of the moon for the current calendar window." | |
1500 t) | |
1501 | |
1502 (autoload 'calendar-print-french-date "cal-french" | |
5694
69471d331d0c
(calendar-version): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5272
diff
changeset
|
1503 "Show the French Revolutionary calendar equivalent of the date under the cursor." |
957 | 1504 t) |
1505 | |
1506 (autoload 'calendar-goto-french-date "cal-french" | |
1507 "Move cursor to French Revolutionary date." | |
1508 t) | |
1509 | |
5694
69471d331d0c
(calendar-version): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5272
diff
changeset
|
1510 (autoload 'calendar-french-date-string "cal-french" |
13042
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1511 "String of French Revolutionary date of Gregorian date." |
5694
69471d331d0c
(calendar-version): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5272
diff
changeset
|
1512 t) |
69471d331d0c
(calendar-version): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5272
diff
changeset
|
1513 |
69471d331d0c
(calendar-version): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5272
diff
changeset
|
1514 (autoload 'calendar-mayan-date-string "cal-mayan" |
13042
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1515 "String of Mayan date of Gregorian date." |
5694
69471d331d0c
(calendar-version): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5272
diff
changeset
|
1516 t) |
69471d331d0c
(calendar-version): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5272
diff
changeset
|
1517 |
957 | 1518 (autoload 'calendar-print-mayan-date "cal-mayan" |
5694
69471d331d0c
(calendar-version): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5272
diff
changeset
|
1519 "Show the Mayan long count, Tzolkin, and Haab equivalents of the date under the cursor." |
957 | 1520 t) |
1521 | |
1522 (autoload 'calendar-goto-mayan-long-count-date "cal-mayan" | |
1523 "Move cursor to Mayan long count date." | |
1524 t) | |
1525 | |
1526 (autoload 'calendar-next-haab-date "cal-mayan" | |
1527 "Move cursor to next instance of Mayan Haab date." | |
1528 t) | |
1529 | |
1530 (autoload 'calendar-previous-haab-date "cal-mayan" | |
1531 "Move cursor to previous instance of Mayan Haab date." | |
1532 t) | |
1533 | |
1534 (autoload 'calendar-next-tzolkin-date "cal-mayan" | |
1535 "Move cursor to next instance of Mayan Tzolkin date." | |
1536 t) | |
1537 | |
1538 (autoload 'calendar-previous-tzolkin-date "cal-mayan" | |
1539 "Move cursor to previous instance of Mayan Tzolkin date." | |
1540 t) | |
1541 | |
1542 (autoload 'calendar-next-calendar-round-date "cal-mayan" | |
13671
97293da2f27b
(calendar-setup, calendar-basic-setup, calendar-next-calendar-round-date,
Paul Eggert <eggert@twinsun.com>
parents:
13649
diff
changeset
|
1543 "Move cursor to next instance of Mayan Haab/Tzolkin combination." |
957 | 1544 t) |
1545 | |
1546 (autoload 'calendar-previous-calendar-round-date "cal-mayan" | |
13671
97293da2f27b
(calendar-setup, calendar-basic-setup, calendar-next-calendar-round-date,
Paul Eggert <eggert@twinsun.com>
parents:
13649
diff
changeset
|
1547 "Move cursor to previous instance of Mayan Haab/Tzolkin combination." |
957 | 1548 t) |
1549 | |
14687
0d4ff7e4d6a3
Use the new file names in autoloads.
Karl Heuer <kwzh@gnu.org>
parents:
14169
diff
changeset
|
1550 (autoload 'calendar-goto-chinese-date "cal-china" |
13875
96d81534d210
Fix autoloads.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13792
diff
changeset
|
1551 "Move cursor to Chinese date." |
13042
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1552 t) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1553 |
14687
0d4ff7e4d6a3
Use the new file names in autoloads.
Karl Heuer <kwzh@gnu.org>
parents:
14169
diff
changeset
|
1554 (autoload 'calendar-print-chinese-date "cal-china" |
13042
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1555 "Show the Chinese date equivalents of date." |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1556 t) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1557 |
14687
0d4ff7e4d6a3
Use the new file names in autoloads.
Karl Heuer <kwzh@gnu.org>
parents:
14169
diff
changeset
|
1558 (autoload 'calendar-chinese-date-string "cal-china" |
13042
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1559 "String of Chinese date of Gregorian date." |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1560 t) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1561 |
26530
82384d47a93d
Fix autoload for calendar-absolute-from-astro. Add autoload for
Gerd Moellmann <gerd@gnu.org>
parents:
26427
diff
changeset
|
1562 (autoload 'calendar-absolute-from-astro "cal-julian" |
13875
96d81534d210
Fix autoloads.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13792
diff
changeset
|
1563 "Absolute date of astronomical (Julian) day number D." |
26530
82384d47a93d
Fix autoload for calendar-absolute-from-astro. Add autoload for
Gerd Moellmann <gerd@gnu.org>
parents:
26427
diff
changeset
|
1564 t ) |
13875
96d81534d210
Fix autoloads.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13792
diff
changeset
|
1565 |
13792
a1776aba8124
(calendar-astro-from-absolute): Autoload it.
Karl Heuer <kwzh@gnu.org>
parents:
13671
diff
changeset
|
1566 (autoload 'calendar-astro-from-absolute "cal-julian" |
a1776aba8124
(calendar-astro-from-absolute): Autoload it.
Karl Heuer <kwzh@gnu.org>
parents:
13671
diff
changeset
|
1567 "Astronomical (Julian) day number of absolute date D.") |
a1776aba8124
(calendar-astro-from-absolute): Autoload it.
Karl Heuer <kwzh@gnu.org>
parents:
13671
diff
changeset
|
1568 |
13875
96d81534d210
Fix autoloads.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13792
diff
changeset
|
1569 (autoload 'calendar-astro-date-string "cal-julian" |
96d81534d210
Fix autoloads.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13792
diff
changeset
|
1570 "String of astronomical (Julian) day number of Gregorian date." |
96d81534d210
Fix autoloads.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13792
diff
changeset
|
1571 t) |
96d81534d210
Fix autoloads.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13792
diff
changeset
|
1572 |
25412
27c66621737f
(calendar-goto-astro-day-number): Autoload the right function name.
Richard M. Stallman <rms@gnu.org>
parents:
25410
diff
changeset
|
1573 (autoload 'calendar-goto-astro-day-number "cal-julian" |
13875
96d81534d210
Fix autoloads.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13792
diff
changeset
|
1574 "Move cursor to astronomical (Julian) day number." |
96d81534d210
Fix autoloads.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13792
diff
changeset
|
1575 t) |
96d81534d210
Fix autoloads.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13792
diff
changeset
|
1576 |
26530
82384d47a93d
Fix autoload for calendar-absolute-from-astro. Add autoload for
Gerd Moellmann <gerd@gnu.org>
parents:
26427
diff
changeset
|
1577 (autoload 'calendar-print-astro-day-number "cal-julian" |
82384d47a93d
Fix autoload for calendar-absolute-from-astro. Add autoload for
Gerd Moellmann <gerd@gnu.org>
parents:
26427
diff
changeset
|
1578 "Show the astro date equivalents of date." |
82384d47a93d
Fix autoload for calendar-absolute-from-astro. Add autoload for
Gerd Moellmann <gerd@gnu.org>
parents:
26427
diff
changeset
|
1579 t) |
82384d47a93d
Fix autoload for calendar-absolute-from-astro. Add autoload for
Gerd Moellmann <gerd@gnu.org>
parents:
26427
diff
changeset
|
1580 |
13546
b979fa5d0d0b
(calendar-julian-from-absolute): Autoload it.
Richard M. Stallman <rms@gnu.org>
parents:
13490
diff
changeset
|
1581 (autoload 'calendar-julian-from-absolute "cal-julian" |
b979fa5d0d0b
(calendar-julian-from-absolute): Autoload it.
Richard M. Stallman <rms@gnu.org>
parents:
13490
diff
changeset
|
1582 "Compute the Julian (month day year) corresponding to the absolute DATE. |
b979fa5d0d0b
(calendar-julian-from-absolute): Autoload it.
Richard M. Stallman <rms@gnu.org>
parents:
13490
diff
changeset
|
1583 The absolute date is the number of days elapsed since the (imaginary) |
b979fa5d0d0b
(calendar-julian-from-absolute): Autoload it.
Richard M. Stallman <rms@gnu.org>
parents:
13490
diff
changeset
|
1584 Gregorian date Sunday, December 31, 1 BC.") |
b979fa5d0d0b
(calendar-julian-from-absolute): Autoload it.
Richard M. Stallman <rms@gnu.org>
parents:
13490
diff
changeset
|
1585 |
13042
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1586 (autoload 'calendar-goto-julian-date "cal-julian" |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1587 "Move cursor to Julian DATE; echo Julian date unless NOECHO is t." |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1588 t) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1589 |
19422
d43fe749c103
Add an autoload form for calendar-print-julian-date.
Richard M. Stallman <rms@gnu.org>
parents:
19248
diff
changeset
|
1590 (autoload 'calendar-print-julian-date "cal-julian" |
d43fe749c103
Add an autoload form for calendar-print-julian-date.
Richard M. Stallman <rms@gnu.org>
parents:
19248
diff
changeset
|
1591 "Show the Julian calendar equivalent of the date under the cursor." |
d43fe749c103
Add an autoload form for calendar-print-julian-date.
Richard M. Stallman <rms@gnu.org>
parents:
19248
diff
changeset
|
1592 t) |
d43fe749c103
Add an autoload form for calendar-print-julian-date.
Richard M. Stallman <rms@gnu.org>
parents:
19248
diff
changeset
|
1593 |
13573
6fff4a5fc018
(calendar-julian-date-string): Autoload this.
Richard M. Stallman <rms@gnu.org>
parents:
13546
diff
changeset
|
1594 (autoload 'calendar-julian-date-string "cal-julian" |
6fff4a5fc018
(calendar-julian-date-string): Autoload this.
Richard M. Stallman <rms@gnu.org>
parents:
13546
diff
changeset
|
1595 "String of Julian date of Gregorian DATE. |
6fff4a5fc018
(calendar-julian-date-string): Autoload this.
Richard M. Stallman <rms@gnu.org>
parents:
13546
diff
changeset
|
1596 Defaults to today's date if DATE is not given. |
19438
3a3578e9593f
(calendar-julian-date-string): Mark not interactive.
Richard M. Stallman <rms@gnu.org>
parents:
19422
diff
changeset
|
1597 Driven by the variable `calendar-date-display-form'.") |
13573
6fff4a5fc018
(calendar-julian-date-string): Autoload this.
Richard M. Stallman <rms@gnu.org>
parents:
13546
diff
changeset
|
1598 |
13042
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1599 (autoload 'calendar-goto-iso-date "cal-iso" |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1600 "Move cursor to ISO date." |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1601 t) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1602 |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1603 (autoload 'calendar-print-iso-date "cal-iso" |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1604 "Show the ISO date equivalents of date." |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1605 t) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1606 |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1607 (autoload 'calendar-iso-date-string "cal-iso" |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1608 "String of ISO date of Gregorian date." |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1609 t) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1610 |
38448
911d5f6da3f7
(calendar-goto-islamic-date): Add
Gerd Moellmann <gerd@gnu.org>
parents:
38422
diff
changeset
|
1611 (autoload 'calendar-goto-islamic-date "cal-islam" |
911d5f6da3f7
(calendar-goto-islamic-date): Add
Gerd Moellmann <gerd@gnu.org>
parents:
38422
diff
changeset
|
1612 "Move cursor to Islamic date." |
911d5f6da3f7
(calendar-goto-islamic-date): Add
Gerd Moellmann <gerd@gnu.org>
parents:
38422
diff
changeset
|
1613 t) |
911d5f6da3f7
(calendar-goto-islamic-date): Add
Gerd Moellmann <gerd@gnu.org>
parents:
38422
diff
changeset
|
1614 |
14687
0d4ff7e4d6a3
Use the new file names in autoloads.
Karl Heuer <kwzh@gnu.org>
parents:
14169
diff
changeset
|
1615 (autoload 'calendar-print-islamic-date "cal-islam" |
13042
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1616 "Show the Islamic date equivalents of date." |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1617 t) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1618 |
14687
0d4ff7e4d6a3
Use the new file names in autoloads.
Karl Heuer <kwzh@gnu.org>
parents:
14169
diff
changeset
|
1619 (autoload 'calendar-islamic-date-string "cal-islam" |
13042
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1620 "String of Islamic date of Gregorian date." |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1621 t) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1622 |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1623 (autoload 'calendar-goto-hebrew-date "cal-hebrew" |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1624 "Move cursor to Hebrew date date." |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1625 t) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1626 |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1627 (autoload 'calendar-print-hebrew-date "cal-hebrew" |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1628 "Show the Hebrew date equivalents of date." |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1629 t) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1630 |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1631 (autoload 'calendar-hebrew-date-string "cal-hebrew" |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1632 "String of Hebrew date of Gregorian date." |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1633 t) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1634 |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1635 (autoload 'calendar-goto-coptic-date "cal-coptic" |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1636 "Move cursor to Coptic date date." |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1637 t) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1638 |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1639 (autoload 'calendar-print-coptic-date "cal-coptic" |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1640 "Show the Coptic date equivalents of date." |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1641 t) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1642 |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1643 (autoload 'calendar-coptic-date-string "cal-coptic" |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1644 "String of Coptic date of Gregorian date." |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1645 t) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1646 |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1647 (autoload 'calendar-goto-ethiopic-date "cal-coptic" |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1648 "Move cursor to Ethiopic date date." |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1649 t) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1650 |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1651 (autoload 'calendar-print-ethiopic-date "cal-coptic" |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1652 "Show the Ethiopic date equivalents of date." |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1653 t) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1654 |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1655 (autoload 'calendar-ethiopic-date-string "cal-coptic" |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1656 "String of Ethiopic date of Gregorian date." |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1657 t) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1658 |
15258
ab5975df6164
Change autoload references from cal-persian to cal-persia.
Karl Heuer <kwzh@gnu.org>
parents:
14937
diff
changeset
|
1659 (autoload 'calendar-goto-persian-date "cal-persia" |
14915
5a4b28f19b75
Add references to Persian calendar.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
14687
diff
changeset
|
1660 "Move cursor to Persian date date." |
5a4b28f19b75
Add references to Persian calendar.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
14687
diff
changeset
|
1661 t) |
5a4b28f19b75
Add references to Persian calendar.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
14687
diff
changeset
|
1662 |
15258
ab5975df6164
Change autoload references from cal-persian to cal-persia.
Karl Heuer <kwzh@gnu.org>
parents:
14937
diff
changeset
|
1663 (autoload 'calendar-print-persian-date "cal-persia" |
14915
5a4b28f19b75
Add references to Persian calendar.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
14687
diff
changeset
|
1664 "Show the Persian date equivalents of date." |
5a4b28f19b75
Add references to Persian calendar.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
14687
diff
changeset
|
1665 t) |
5a4b28f19b75
Add references to Persian calendar.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
14687
diff
changeset
|
1666 |
15258
ab5975df6164
Change autoload references from cal-persian to cal-persia.
Karl Heuer <kwzh@gnu.org>
parents:
14937
diff
changeset
|
1667 (autoload 'calendar-persian-date-string "cal-persia" |
14915
5a4b28f19b75
Add references to Persian calendar.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
14687
diff
changeset
|
1668 "String of Persian date of Gregorian date." |
5a4b28f19b75
Add references to Persian calendar.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
14687
diff
changeset
|
1669 t) |
5a4b28f19b75
Add references to Persian calendar.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
14687
diff
changeset
|
1670 |
13649
fb670bed6222
Use new file name diary-lib.
Richard M. Stallman <rms@gnu.org>
parents:
13597
diff
changeset
|
1671 (autoload 'show-all-diary-entries "diary-lib" |
7404 | 1672 "Show all of the diary entries in the diary file. |
1673 This function gets rid of the selective display of the diary file so that | |
628 | 1674 all entries, not just some, are visible. If there is no diary buffer, one |
1675 is created." | |
1676 t) | |
1677 | |
13649
fb670bed6222
Use new file name diary-lib.
Richard M. Stallman <rms@gnu.org>
parents:
13597
diff
changeset
|
1678 (autoload 'mark-diary-entries "diary-lib" |
628 | 1679 "Mark days in the calendar window that have diary entries. |
7404 | 1680 Each entry in diary file visible in the calendar window is marked." |
628 | 1681 t) |
1682 | |
13649
fb670bed6222
Use new file name diary-lib.
Richard M. Stallman <rms@gnu.org>
parents:
13597
diff
changeset
|
1683 (autoload 'make-diary-entry "diary-lib" |
13042
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1684 "Insert a diary entry STRING which may be NONMARKING in FILE." |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1685 t) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1686 |
13649
fb670bed6222
Use new file name diary-lib.
Richard M. Stallman <rms@gnu.org>
parents:
13597
diff
changeset
|
1687 (autoload 'insert-diary-entry "diary-lib" |
628 | 1688 "Insert a diary entry for the date indicated by point." |
1689 t) | |
1690 | |
13649
fb670bed6222
Use new file name diary-lib.
Richard M. Stallman <rms@gnu.org>
parents:
13597
diff
changeset
|
1691 (autoload 'insert-weekly-diary-entry "diary-lib" |
628 | 1692 "Insert a weekly diary entry for the day of the week indicated by point." |
1693 t) | |
1694 | |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1695 |
13649
fb670bed6222
Use new file name diary-lib.
Richard M. Stallman <rms@gnu.org>
parents:
13597
diff
changeset
|
1696 (autoload 'insert-monthly-diary-entry "diary-lib" |
628 | 1697 "Insert a monthly diary entry for the day of the month indicated by point." |
1698 t) | |
1699 | |
13649
fb670bed6222
Use new file name diary-lib.
Richard M. Stallman <rms@gnu.org>
parents:
13597
diff
changeset
|
1700 (autoload 'insert-yearly-diary-entry "diary-lib" |
628 | 1701 "Insert an annual diary entry for the day of the year indicated by point." |
1702 t) | |
1703 | |
13649
fb670bed6222
Use new file name diary-lib.
Richard M. Stallman <rms@gnu.org>
parents:
13597
diff
changeset
|
1704 (autoload 'insert-anniversary-diary-entry "diary-lib" |
628 | 1705 "Insert an anniversary diary entry for the date indicated by point." |
1706 t) | |
1707 | |
13649
fb670bed6222
Use new file name diary-lib.
Richard M. Stallman <rms@gnu.org>
parents:
13597
diff
changeset
|
1708 (autoload 'insert-block-diary-entry "diary-lib" |
628 | 1709 "Insert a block diary entry for the dates indicated by point and mark." |
1710 t) | |
1711 | |
13649
fb670bed6222
Use new file name diary-lib.
Richard M. Stallman <rms@gnu.org>
parents:
13597
diff
changeset
|
1712 (autoload 'insert-cyclic-diary-entry "diary-lib" |
628 | 1713 "Insert a cyclic diary entry starting at the date indicated by point." |
1714 t) | |
1715 | |
13042
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1716 (autoload 'insert-hebrew-diary-entry "cal-hebrew" |
628 | 1717 "Insert a diary entry for the Hebrew date corresponding to the date |
1718 indicated by point." | |
1719 t) | |
1720 | |
13042
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1721 (autoload 'insert-monthly-hebrew-diary-entry "cal-hebrew" |
628 | 1722 "Insert a monthly diary entry for the day of the Hebrew month corresponding |
1723 to the date indicated by point." | |
1724 t) | |
1725 | |
13042
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1726 (autoload 'insert-yearly-hebrew-diary-entry "cal-hebrew" |
628 | 1727 "Insert an annual diary entry for the day of the Hebrew year corresponding |
1728 to the date indicated by point." | |
1729 t) | |
1730 | |
14687
0d4ff7e4d6a3
Use the new file names in autoloads.
Karl Heuer <kwzh@gnu.org>
parents:
14169
diff
changeset
|
1731 (autoload 'insert-islamic-diary-entry "cal-islam" |
628 | 1732 "Insert a diary entry for the Islamic date corresponding to the date |
1733 indicated by point." | |
1734 t) | |
1735 | |
14687
0d4ff7e4d6a3
Use the new file names in autoloads.
Karl Heuer <kwzh@gnu.org>
parents:
14169
diff
changeset
|
1736 (autoload 'insert-monthly-islamic-diary-entry "cal-islam" |
628 | 1737 "Insert a monthly diary entry for the day of the Islamic month corresponding |
1738 to the date indicated by point." | |
1739 t) | |
1740 | |
14687
0d4ff7e4d6a3
Use the new file names in autoloads.
Karl Heuer <kwzh@gnu.org>
parents:
14169
diff
changeset
|
1741 (autoload 'insert-yearly-islamic-diary-entry "cal-islam" |
628 | 1742 "Insert an annual diary entry for the day of the Islamic year corresponding |
1743 to the date indicated by point." | |
1744 t) | |
1745 | |
1746 (autoload 'list-calendar-holidays "holidays" | |
1747 "Create a buffer containing the holidays for the current calendar window. | |
1748 The holidays are those in the list `calendar-notable-days'. Returns t if any | |
1749 holidays are found, nil if not." | |
1750 t) | |
1751 | |
13193
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
1752 (autoload 'cal-tex-cursor-month "cal-tex" |
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
1753 "Make a buffer with LaTeX commands for the month cursor is on. |
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
1754 Optional prefix argument specifies number of months to be produced. |
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
1755 Calendar is condensed onto one page.") |
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
1756 |
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
1757 (autoload 'cal-tex-cursor-month-landscape "cal-tex" |
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
1758 "Make a buffer with LaTeX commands for the month cursor is on. |
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
1759 Optional prefix argument specifies number of months to be produced.") |
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
1760 |
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
1761 (autoload 'cal-tex-cursor-day "cal-tex" |
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
1762 "Make a buffer with LaTeX commands for the day cursor is on.") |
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
1763 |
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
1764 (autoload 'cal-tex-cursor-week "cal-tex" |
13596
d205632cc756
(cal-tex-cursor-filofax-week): Renamed from cal-tex-cursor-week6.
Richard M. Stallman <rms@gnu.org>
parents:
13589
diff
changeset
|
1765 "Make a buffer with LaTeX commands for a two-page one-week calendar. |
d205632cc756
(cal-tex-cursor-filofax-week): Renamed from cal-tex-cursor-week6.
Richard M. Stallman <rms@gnu.org>
parents:
13589
diff
changeset
|
1766 It applies to the week that point is in. |
d205632cc756
(cal-tex-cursor-filofax-week): Renamed from cal-tex-cursor-week6.
Richard M. Stallman <rms@gnu.org>
parents:
13589
diff
changeset
|
1767 Optional prefix argument specifies number of weeks. |
d205632cc756
(cal-tex-cursor-filofax-week): Renamed from cal-tex-cursor-week6.
Richard M. Stallman <rms@gnu.org>
parents:
13589
diff
changeset
|
1768 Holidays are included if `cal-tex-holidays' is t.") |
13193
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
1769 |
26427
3b6cf16f3633
* calendar/calendar.el (calendar-remove-frame-by-deleting):
Sam Steingold <sds@gnu.org>
parents:
26329
diff
changeset
|
1770 (autoload 'cal-tex-cursor-week2 "cal-tex" |
13596
d205632cc756
(cal-tex-cursor-filofax-week): Renamed from cal-tex-cursor-week6.
Richard M. Stallman <rms@gnu.org>
parents:
13589
diff
changeset
|
1771 "Make a buffer with LaTeX commands for a two-page one-week calendar. |
d205632cc756
(cal-tex-cursor-filofax-week): Renamed from cal-tex-cursor-week6.
Richard M. Stallman <rms@gnu.org>
parents:
13589
diff
changeset
|
1772 It applies to the week that point is in. |
d205632cc756
(cal-tex-cursor-filofax-week): Renamed from cal-tex-cursor-week6.
Richard M. Stallman <rms@gnu.org>
parents:
13589
diff
changeset
|
1773 Optional prefix argument specifies number of weeks. |
d205632cc756
(cal-tex-cursor-filofax-week): Renamed from cal-tex-cursor-week6.
Richard M. Stallman <rms@gnu.org>
parents:
13589
diff
changeset
|
1774 Holidays are included if `cal-tex-holidays' is t.") |
13193
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
1775 |
13596
d205632cc756
(cal-tex-cursor-filofax-week): Renamed from cal-tex-cursor-week6.
Richard M. Stallman <rms@gnu.org>
parents:
13589
diff
changeset
|
1776 (autoload 'cal-tex-cursor-week-iso "cal-tex" |
d205632cc756
(cal-tex-cursor-filofax-week): Renamed from cal-tex-cursor-week6.
Richard M. Stallman <rms@gnu.org>
parents:
13589
diff
changeset
|
1777 "Make a buffer with LaTeX commands for a one page ISO-style weekly calendar. |
13597
493156a0ad85
(cal-tex-cursor-week-iso): Doc fix.
Erik Naggum <erik@naggum.no>
parents:
13596
diff
changeset
|
1778 Optional prefix argument specifies number of weeks. |
13596
d205632cc756
(cal-tex-cursor-filofax-week): Renamed from cal-tex-cursor-week6.
Richard M. Stallman <rms@gnu.org>
parents:
13589
diff
changeset
|
1779 Diary entries are included if `cal-tex-diary' is t. |
d205632cc756
(cal-tex-cursor-filofax-week): Renamed from cal-tex-cursor-week6.
Richard M. Stallman <rms@gnu.org>
parents:
13589
diff
changeset
|
1780 Holidays are included if `cal-tex-holidays' is t.") |
13193
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
1781 |
13596
d205632cc756
(cal-tex-cursor-filofax-week): Renamed from cal-tex-cursor-week6.
Richard M. Stallman <rms@gnu.org>
parents:
13589
diff
changeset
|
1782 (autoload 'cal-tex-cursor-week-monday "cal-tex" |
d205632cc756
(cal-tex-cursor-filofax-week): Renamed from cal-tex-cursor-week6.
Richard M. Stallman <rms@gnu.org>
parents:
13589
diff
changeset
|
1783 "Make a buffer with LaTeX commands for a two-page one-week calendar. |
d205632cc756
(cal-tex-cursor-filofax-week): Renamed from cal-tex-cursor-week6.
Richard M. Stallman <rms@gnu.org>
parents:
13589
diff
changeset
|
1784 It applies to the week that point is in, and starts on Monday. |
d205632cc756
(cal-tex-cursor-filofax-week): Renamed from cal-tex-cursor-week6.
Richard M. Stallman <rms@gnu.org>
parents:
13589
diff
changeset
|
1785 Optional prefix argument specifies number of weeks. |
d205632cc756
(cal-tex-cursor-filofax-week): Renamed from cal-tex-cursor-week6.
Richard M. Stallman <rms@gnu.org>
parents:
13589
diff
changeset
|
1786 Holidays are included if `cal-tex-holidays' is t.") |
13193
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
1787 |
13596
d205632cc756
(cal-tex-cursor-filofax-week): Renamed from cal-tex-cursor-week6.
Richard M. Stallman <rms@gnu.org>
parents:
13589
diff
changeset
|
1788 (autoload 'cal-tex-cursor-filofax-2week "cal-tex" |
d205632cc756
(cal-tex-cursor-filofax-week): Renamed from cal-tex-cursor-week6.
Richard M. Stallman <rms@gnu.org>
parents:
13589
diff
changeset
|
1789 "Two-weeks-at-a-glance Filofax style calendar for week indicated by cursor. |
d205632cc756
(cal-tex-cursor-filofax-week): Renamed from cal-tex-cursor-week6.
Richard M. Stallman <rms@gnu.org>
parents:
13589
diff
changeset
|
1790 Optional prefix argument specifies number of weeks. |
d205632cc756
(cal-tex-cursor-filofax-week): Renamed from cal-tex-cursor-week6.
Richard M. Stallman <rms@gnu.org>
parents:
13589
diff
changeset
|
1791 Diary entries are included if cal-tex-diary is t. |
d205632cc756
(cal-tex-cursor-filofax-week): Renamed from cal-tex-cursor-week6.
Richard M. Stallman <rms@gnu.org>
parents:
13589
diff
changeset
|
1792 Holidays are included if `cal-tex-holidays' is t.") |
13193
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
1793 |
13596
d205632cc756
(cal-tex-cursor-filofax-week): Renamed from cal-tex-cursor-week6.
Richard M. Stallman <rms@gnu.org>
parents:
13589
diff
changeset
|
1794 (autoload 'cal-tex-cursor-filofax-week "cal-tex" |
d205632cc756
(cal-tex-cursor-filofax-week): Renamed from cal-tex-cursor-week6.
Richard M. Stallman <rms@gnu.org>
parents:
13589
diff
changeset
|
1795 "One-week-at-a-glance Filofax style calendar for week indicated by cursor. |
d205632cc756
(cal-tex-cursor-filofax-week): Renamed from cal-tex-cursor-week6.
Richard M. Stallman <rms@gnu.org>
parents:
13589
diff
changeset
|
1796 Optional prefix argument specifies number of weeks. |
26427
3b6cf16f3633
* calendar/calendar.el (calendar-remove-frame-by-deleting):
Sam Steingold <sds@gnu.org>
parents:
26329
diff
changeset
|
1797 Weeks start on Monday. |
13596
d205632cc756
(cal-tex-cursor-filofax-week): Renamed from cal-tex-cursor-week6.
Richard M. Stallman <rms@gnu.org>
parents:
13589
diff
changeset
|
1798 Diary entries are included if cal-tex-diary is t. |
d205632cc756
(cal-tex-cursor-filofax-week): Renamed from cal-tex-cursor-week6.
Richard M. Stallman <rms@gnu.org>
parents:
13589
diff
changeset
|
1799 Holidays are included if `cal-tex-holidays' is t.") |
13193
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
1800 |
19974
620ed2f8250e
(calendar-mode-map): Bind it to key.
Karl Heuer <kwzh@gnu.org>
parents:
19438
diff
changeset
|
1801 (autoload 'cal-tex-cursor-filofax-daily "cal-tex" |
620ed2f8250e
(calendar-mode-map): Bind it to key.
Karl Heuer <kwzh@gnu.org>
parents:
19438
diff
changeset
|
1802 "Day-per-page Filofax style calendar for week indicated by cursor. |
26427
3b6cf16f3633
* calendar/calendar.el (calendar-remove-frame-by-deleting):
Sam Steingold <sds@gnu.org>
parents:
26329
diff
changeset
|
1803 Optional prefix argument specifies number of weeks. Weeks start on Monday. |
19974
620ed2f8250e
(calendar-mode-map): Bind it to key.
Karl Heuer <kwzh@gnu.org>
parents:
19438
diff
changeset
|
1804 Diary entries are included if `cal-tex-diary' is t. |
620ed2f8250e
(calendar-mode-map): Bind it to key.
Karl Heuer <kwzh@gnu.org>
parents:
19438
diff
changeset
|
1805 Holidays are included if `cal-tex-holidays' is t.") |
620ed2f8250e
(calendar-mode-map): Bind it to key.
Karl Heuer <kwzh@gnu.org>
parents:
19438
diff
changeset
|
1806 |
13193
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
1807 (autoload 'cal-tex-cursor-year "cal-tex" |
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
1808 "Make a buffer with LaTeX commands for a year's calendar. |
13671
97293da2f27b
(calendar-setup, calendar-basic-setup, calendar-next-calendar-round-date,
Paul Eggert <eggert@twinsun.com>
parents:
13649
diff
changeset
|
1809 Optional prefix argument specifies number of years.") |
13193
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
1810 |
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
1811 (autoload 'cal-tex-cursor-year-landscape "cal-tex" |
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
1812 "Make a buffer with LaTeX commands for a year's calendar (landscape). |
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
1813 Optional prefix argument specifies number of years.") |
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
1814 |
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
1815 (autoload 'cal-tex-cursor-filofax-year "cal-tex" |
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
1816 "Make a buffer with LaTeX commands for a year's calendar (Filofax). |
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
1817 Optional prefix argument specifies number of years.") |
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
1818 |
628 | 1819 (autoload 'mark-calendar-holidays "holidays" |
1820 "Mark notable days in the calendar window." | |
1821 t) | |
1822 | |
1823 (autoload 'calendar-cursor-holidays "holidays" | |
1824 "Find holidays for the date specified by the cursor in the calendar window." | |
1825 t) | |
1826 | |
957 | 1827 (defun generate-calendar-window (&optional mon yr) |
1828 "Generate the calendar window for the current date. | |
1829 Or, for optional MON, YR." | |
628 | 1830 (let* ((buffer-read-only nil) |
1831 (today (calendar-current-date)) | |
1832 (month (extract-calendar-month today)) | |
1833 (day (extract-calendar-day today)) | |
1834 (year (extract-calendar-year today)) | |
957 | 1835 (today-visible |
1836 (or (not mon) | |
1837 (let ((offset (calendar-interval mon yr month year))) | |
1838 (and (<= offset 1) (>= offset -1))))) | |
628 | 1839 (day-in-week (calendar-day-of-week today))) |
1840 (update-calendar-mode-line) | |
957 | 1841 (if mon |
1842 (generate-calendar mon yr) | |
1843 (generate-calendar month year)) | |
628 | 1844 (calendar-cursor-to-visible-date |
1845 (if today-visible today (list displayed-month 1 displayed-year))) | |
1846 (set-buffer-modified-p nil) | |
33729
939d7e7181b6
(generate-calendar-window): When we don't call `fit-window-to-buffer',
Miles Bader <miles@gnu.org>
parents:
33438
diff
changeset
|
1847 (if (or (one-window-p t) (/= (frame-width) (window-width))) |
939d7e7181b6
(generate-calendar-window): When we don't call `fit-window-to-buffer',
Miles Bader <miles@gnu.org>
parents:
33438
diff
changeset
|
1848 ;; Don't mess with the window size, but ensure that the first |
939d7e7181b6
(generate-calendar-window): When we don't call `fit-window-to-buffer',
Miles Bader <miles@gnu.org>
parents:
33438
diff
changeset
|
1849 ;; line is fully visible |
939d7e7181b6
(generate-calendar-window): When we don't call `fit-window-to-buffer',
Miles Bader <miles@gnu.org>
parents:
33438
diff
changeset
|
1850 (set-window-vscroll nil 0) |
939d7e7181b6
(generate-calendar-window): When we don't call `fit-window-to-buffer',
Miles Bader <miles@gnu.org>
parents:
33438
diff
changeset
|
1851 ;; Adjust the window to exactly fit the displayed calendar |
33438
8b81b726f919
(generate-calendar-window): Use `fit-window-to-buffer'.
Miles Bader <miles@gnu.org>
parents:
33208
diff
changeset
|
1852 (fit-window-to-buffer)) |
628 | 1853 (sit-for 0) |
49736
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
1854 (if (and (boundp 'font-lock-mode) |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
1855 font-lock-mode) |
48366
9dad713d153a
Patch of Alan Shutko <ats@acm.org> by way of rms.
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47333
diff
changeset
|
1856 (font-lock-fontify-buffer)) |
628 | 1857 (and mark-holidays-in-calendar |
1858 (mark-calendar-holidays) | |
1859 (sit-for 0)) | |
1860 (unwind-protect | |
1861 (if mark-diary-entries-in-calendar (mark-diary-entries)) | |
1862 (if today-visible | |
1863 (run-hooks 'today-visible-calendar-hook) | |
1864 (run-hooks 'today-invisible-calendar-hook))))) | |
1865 | |
1866 (defun generate-calendar (month year) | |
1867 "Generate a three-month Gregorian calendar centered around MONTH, YEAR." | |
1868 (if (< (+ month (* 12 (1- year))) 2) | |
38422
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
38088
diff
changeset
|
1869 (error "Months before February, 1 AD are not available")) |
628 | 1870 (setq displayed-month month) |
1871 (setq displayed-year year) | |
1872 (erase-buffer) | |
1873 (increment-calendar-month month year -1) | |
1874 (calendar-for-loop i from 0 to 2 do | |
1875 (generate-calendar-month month year (+ 5 (* 25 i))) | |
1876 (increment-calendar-month month year 1))) | |
1877 | |
1878 (defun generate-calendar-month (month year indent) | |
1879 "Produce a calendar for MONTH, YEAR on the Gregorian calendar. | |
43010
f3f6fc83e6d1
(generate-calendar-month): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents:
42924
diff
changeset
|
1880 The calendar is inserted at the top of the buffer in which point is currently |
f3f6fc83e6d1
(generate-calendar-month): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents:
42924
diff
changeset
|
1881 located, but indented INDENT spaces. The indentation is done from the first |
f3f6fc83e6d1
(generate-calendar-month): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents:
42924
diff
changeset
|
1882 character on the line and does not disturb the first INDENT characters on the |
f3f6fc83e6d1
(generate-calendar-month): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents:
42924
diff
changeset
|
1883 line." |
4861
924486090b27
(calendar-week-start-day): New var (autoloaded) to
Richard M. Stallman <rms@gnu.org>
parents:
4658
diff
changeset
|
1884 (let* ((blank-days;; at start of month |
7760
4edcac57a8f2
(calendar-mod): Remove; it was equivalent to `mod'. All callers changed.
Paul Eggert <eggert@twinsun.com>
parents:
7759
diff
changeset
|
1885 (mod |
4861
924486090b27
(calendar-week-start-day): New var (autoloaded) to
Richard M. Stallman <rms@gnu.org>
parents:
4658
diff
changeset
|
1886 (- (calendar-day-of-week (list month 1 year)) |
924486090b27
(calendar-week-start-day): New var (autoloaded) to
Richard M. Stallman <rms@gnu.org>
parents:
4658
diff
changeset
|
1887 calendar-week-start-day) |
924486090b27
(calendar-week-start-day): New var (autoloaded) to
Richard M. Stallman <rms@gnu.org>
parents:
4658
diff
changeset
|
1888 7)) |
924486090b27
(calendar-week-start-day): New var (autoloaded) to
Richard M. Stallman <rms@gnu.org>
parents:
4658
diff
changeset
|
1889 (last (calendar-last-day-of-month month year))) |
924486090b27
(calendar-week-start-day): New var (autoloaded) to
Richard M. Stallman <rms@gnu.org>
parents:
4658
diff
changeset
|
1890 (goto-char (point-min)) |
924486090b27
(calendar-week-start-day): New var (autoloaded) to
Richard M. Stallman <rms@gnu.org>
parents:
4658
diff
changeset
|
1891 (calendar-insert-indented |
924486090b27
(calendar-week-start-day): New var (autoloaded) to
Richard M. Stallman <rms@gnu.org>
parents:
4658
diff
changeset
|
1892 (calendar-string-spread |
12061
017af11017a0
Fixed calendar-string-spread to allow 0 or 1 string; this simplified several
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
10459
diff
changeset
|
1893 (list (format "%s %d" (calendar-month-name month) year)) ? 20) |
4861
924486090b27
(calendar-week-start-day): New var (autoloaded) to
Richard M. Stallman <rms@gnu.org>
parents:
4658
diff
changeset
|
1894 indent t) |
924486090b27
(calendar-week-start-day): New var (autoloaded) to
Richard M. Stallman <rms@gnu.org>
parents:
4658
diff
changeset
|
1895 (calendar-insert-indented "" indent);; Go to proper spot |
924486090b27
(calendar-week-start-day): New var (autoloaded) to
Richard M. Stallman <rms@gnu.org>
parents:
4658
diff
changeset
|
1896 (calendar-for-loop i from 0 to 6 do |
18940
953dfe84b101
(calendar-day-name): New optional args WIDTH, ABSOLUTE.
Richard M. Stallman <rms@gnu.org>
parents:
17625
diff
changeset
|
1897 (insert (calendar-day-name (mod (+ calendar-week-start-day i) 7) |
953dfe84b101
(calendar-day-name): New optional args WIDTH, ABSOLUTE.
Richard M. Stallman <rms@gnu.org>
parents:
17625
diff
changeset
|
1898 2 t)) |
4861
924486090b27
(calendar-week-start-day): New var (autoloaded) to
Richard M. Stallman <rms@gnu.org>
parents:
4658
diff
changeset
|
1899 (insert " ")) |
924486090b27
(calendar-week-start-day): New var (autoloaded) to
Richard M. Stallman <rms@gnu.org>
parents:
4658
diff
changeset
|
1900 (calendar-insert-indented "" 0 t);; Force onto following line |
924486090b27
(calendar-week-start-day): New var (autoloaded) to
Richard M. Stallman <rms@gnu.org>
parents:
4658
diff
changeset
|
1901 (calendar-insert-indented "" indent);; Go to proper spot |
924486090b27
(calendar-week-start-day): New var (autoloaded) to
Richard M. Stallman <rms@gnu.org>
parents:
4658
diff
changeset
|
1902 ;; Add blank days before the first of the month |
924486090b27
(calendar-week-start-day): New var (autoloaded) to
Richard M. Stallman <rms@gnu.org>
parents:
4658
diff
changeset
|
1903 (calendar-for-loop i from 1 to blank-days do (insert " ")) |
924486090b27
(calendar-week-start-day): New var (autoloaded) to
Richard M. Stallman <rms@gnu.org>
parents:
4658
diff
changeset
|
1904 ;; Put in the days of the month |
924486090b27
(calendar-week-start-day): New var (autoloaded) to
Richard M. Stallman <rms@gnu.org>
parents:
4658
diff
changeset
|
1905 (calendar-for-loop i from 1 to last do |
924486090b27
(calendar-week-start-day): New var (autoloaded) to
Richard M. Stallman <rms@gnu.org>
parents:
4658
diff
changeset
|
1906 (insert (format "%2d " i)) |
38088
fcbf5971fe12
(generate-calendar-month): Add help-echo to mouse-highlighted text.
Eli Zaretskii <eliz@gnu.org>
parents:
37430
diff
changeset
|
1907 (add-text-properties |
fcbf5971fe12
(generate-calendar-month): Add help-echo to mouse-highlighted text.
Eli Zaretskii <eliz@gnu.org>
parents:
37430
diff
changeset
|
1908 (- (point) 3) (1- (point)) |
fcbf5971fe12
(generate-calendar-month): Add help-echo to mouse-highlighted text.
Eli Zaretskii <eliz@gnu.org>
parents:
37430
diff
changeset
|
1909 '(mouse-face highlight |
fcbf5971fe12
(generate-calendar-month): Add help-echo to mouse-highlighted text.
Eli Zaretskii <eliz@gnu.org>
parents:
37430
diff
changeset
|
1910 help-echo "mouse-2: menu of operations for this date")) |
7760
4edcac57a8f2
(calendar-mod): Remove; it was equivalent to `mod'. All callers changed.
Paul Eggert <eggert@twinsun.com>
parents:
7759
diff
changeset
|
1911 (and (zerop (mod (+ i blank-days) 7)) |
4861
924486090b27
(calendar-week-start-day): New var (autoloaded) to
Richard M. Stallman <rms@gnu.org>
parents:
4658
diff
changeset
|
1912 (/= i last) |
924486090b27
(calendar-week-start-day): New var (autoloaded) to
Richard M. Stallman <rms@gnu.org>
parents:
4658
diff
changeset
|
1913 (calendar-insert-indented "" 0 t) ;; Force onto following line |
924486090b27
(calendar-week-start-day): New var (autoloaded) to
Richard M. Stallman <rms@gnu.org>
parents:
4658
diff
changeset
|
1914 (calendar-insert-indented "" indent)))));; Go to proper spot |
628 | 1915 |
1916 (defun calendar-insert-indented (string indent &optional newline) | |
1917 "Insert STRING at column INDENT. | |
1918 If the optional parameter NEWLINE is t, leave point at start of next line, | |
1919 inserting a newline if there was no next line; otherwise, leave point after | |
1920 the inserted text. Value is always t." | |
1921 ;; Try to move to that column. | |
1922 (move-to-column indent) | |
1923 ;; If line is too short, indent out to that column. | |
1924 (if (< (current-column) indent) | |
1925 (indent-to indent)) | |
1926 (insert string) | |
1927 ;; Advance to next line, if requested. | |
1928 (if newline | |
1929 (progn | |
1930 (end-of-line) | |
1931 (if (eobp) | |
1932 (newline) | |
1933 (forward-line 1)))) | |
1934 t) | |
1935 | |
1936 (defun redraw-calendar () | |
1937 "Redraw the calendar display." | |
1938 (interactive) | |
26329
5dfb5127e9ee
(redraw-calendar): Move to nearest date before
Gerd Moellmann <gerd@gnu.org>
parents:
25412
diff
changeset
|
1939 (let ((cursor-date (calendar-cursor-to-nearest-date))) |
957 | 1940 (generate-calendar-window displayed-month displayed-year) |
628 | 1941 (calendar-cursor-to-visible-date cursor-date))) |
1942 | |
17625
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
1943 (defcustom calendar-debug-sexp nil |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
1944 "*Turn debugging on when evaluating a sexp in the diary or holiday list." |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
1945 :type 'boolean |
321afd5b0bc5
Add defgroups, and use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16099
diff
changeset
|
1946 :group 'calendar) |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
1947 |
628 | 1948 (defvar calendar-mode-map nil) |
1949 (if calendar-mode-map | |
1950 nil | |
1951 (setq calendar-mode-map (make-sparse-keymap)) | |
39523
183567a011b1
(calendar-mode-map): Require cal-menu unconditionally.
Eli Zaretskii <eliz@gnu.org>
parents:
38756
diff
changeset
|
1952 (require 'cal-menu) |
628 | 1953 (calendar-for-loop i from 0 to 9 do |
1954 (define-key calendar-mode-map (int-to-string i) 'digit-argument)) | |
1955 (let ((l (list 'narrow-to-region 'mark-word 'mark-sexp 'mark-paragraph | |
6906
bcd548b4921d
(calendar-mode-map): Use substitute-key-definition.
Richard M. Stallman <rms@gnu.org>
parents:
6737
diff
changeset
|
1956 'mark-defun 'mark-whole-buffer 'mark-page |
9998
a119e2a45c5f
Undefine kill-region and copy-region-as-kill.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9859
diff
changeset
|
1957 'downcase-region 'upcase-region 'kill-region |
a119e2a45c5f
Undefine kill-region and copy-region-as-kill.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9859
diff
changeset
|
1958 'copy-region-as-kill 'capitalize-region 'write-region))) |
6906
bcd548b4921d
(calendar-mode-map): Use substitute-key-definition.
Richard M. Stallman <rms@gnu.org>
parents:
6737
diff
changeset
|
1959 (while l |
bcd548b4921d
(calendar-mode-map): Use substitute-key-definition.
Richard M. Stallman <rms@gnu.org>
parents:
6737
diff
changeset
|
1960 (substitute-key-definition (car l) 'calendar-not-implemented |
bcd548b4921d
(calendar-mode-map): Use substitute-key-definition.
Richard M. Stallman <rms@gnu.org>
parents:
6737
diff
changeset
|
1961 calendar-mode-map global-map) |
bcd548b4921d
(calendar-mode-map): Use substitute-key-definition.
Richard M. Stallman <rms@gnu.org>
parents:
6737
diff
changeset
|
1962 (setq l (cdr l)))) |
628 | 1963 (define-key calendar-mode-map "-" 'negative-argument) |
1964 (define-key calendar-mode-map "\C-x>" 'scroll-calendar-right) | |
4652
0f5527e47955
* calendar.el (calendar-absolute-from-iso,
Jim Blandy <jimb@redhat.com>
parents:
4530
diff
changeset
|
1965 (define-key calendar-mode-map [prior] 'scroll-calendar-right-three-months) |
5272
00beab2bf9f0
(calendar-mode-map): Put back C-v and M-v bindings.
Richard M. Stallman <rms@gnu.org>
parents:
5009
diff
changeset
|
1966 (define-key calendar-mode-map "\ev" 'scroll-calendar-right-three-months) |
628 | 1967 (define-key calendar-mode-map "\C-x<" 'scroll-calendar-left) |
4652
0f5527e47955
* calendar.el (calendar-absolute-from-iso,
Jim Blandy <jimb@redhat.com>
parents:
4530
diff
changeset
|
1968 (define-key calendar-mode-map [next] 'scroll-calendar-left-three-months) |
5272
00beab2bf9f0
(calendar-mode-map): Put back C-v and M-v bindings.
Richard M. Stallman <rms@gnu.org>
parents:
5009
diff
changeset
|
1969 (define-key calendar-mode-map "\C-v" 'scroll-calendar-left-three-months) |
628 | 1970 (define-key calendar-mode-map "\C-b" 'calendar-backward-day) |
1971 (define-key calendar-mode-map "\C-p" 'calendar-backward-week) | |
957 | 1972 (define-key calendar-mode-map "\e{" 'calendar-backward-month) |
628 | 1973 (define-key calendar-mode-map "\C-x[" 'calendar-backward-year) |
1974 (define-key calendar-mode-map "\C-f" 'calendar-forward-day) | |
1975 (define-key calendar-mode-map "\C-n" 'calendar-forward-week) | |
2688
a906a3882b9f
(calendar-mode-map): Add arrow key bindings.
Richard M. Stallman <rms@gnu.org>
parents:
2640
diff
changeset
|
1976 (define-key calendar-mode-map [left] 'calendar-backward-day) |
a906a3882b9f
(calendar-mode-map): Add arrow key bindings.
Richard M. Stallman <rms@gnu.org>
parents:
2640
diff
changeset
|
1977 (define-key calendar-mode-map [up] 'calendar-backward-week) |
a906a3882b9f
(calendar-mode-map): Add arrow key bindings.
Richard M. Stallman <rms@gnu.org>
parents:
2640
diff
changeset
|
1978 (define-key calendar-mode-map [right] 'calendar-forward-day) |
a906a3882b9f
(calendar-mode-map): Add arrow key bindings.
Richard M. Stallman <rms@gnu.org>
parents:
2640
diff
changeset
|
1979 (define-key calendar-mode-map [down] 'calendar-forward-week) |
957 | 1980 (define-key calendar-mode-map "\e}" 'calendar-forward-month) |
628 | 1981 (define-key calendar-mode-map "\C-x]" 'calendar-forward-year) |
1982 (define-key calendar-mode-map "\C-a" 'calendar-beginning-of-week) | |
1983 (define-key calendar-mode-map "\C-e" 'calendar-end-of-week) | |
1984 (define-key calendar-mode-map "\ea" 'calendar-beginning-of-month) | |
1985 (define-key calendar-mode-map "\ee" 'calendar-end-of-month) | |
1986 (define-key calendar-mode-map "\e<" 'calendar-beginning-of-year) | |
1987 (define-key calendar-mode-map "\e>" 'calendar-end-of-year) | |
1988 (define-key calendar-mode-map "\C-@" 'calendar-set-mark) | |
4339
2b1aa3183d79
(calendar-mode-map): Bind C-SPC.
Richard M. Stallman <rms@gnu.org>
parents:
4161
diff
changeset
|
1989 ;; Many people are used to typing C-SPC and getting C-@. |
20638
c3360a392ae4
Change "?\C-\ " to "?\C- " because "\ " is changed
Kenichi Handa <handa@m17n.org>
parents:
20462
diff
changeset
|
1990 (define-key calendar-mode-map [?\C- ] 'calendar-set-mark) |
628 | 1991 (define-key calendar-mode-map "\C-x\C-x" 'calendar-exchange-point-and-mark) |
957 | 1992 (define-key calendar-mode-map "\e=" 'calendar-count-days-region) |
1993 (define-key calendar-mode-map "gd" 'calendar-goto-date) | |
1994 (define-key calendar-mode-map "gj" 'calendar-goto-julian-date) | |
1995 (define-key calendar-mode-map "ga" 'calendar-goto-astro-day-number) | |
1996 (define-key calendar-mode-map "gh" 'calendar-goto-hebrew-date) | |
1997 (define-key calendar-mode-map "gi" 'calendar-goto-islamic-date) | |
13042
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1998 (define-key calendar-mode-map "gC" 'calendar-goto-chinese-date) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
1999 (define-key calendar-mode-map "gk" 'calendar-goto-coptic-date) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
2000 (define-key calendar-mode-map "ge" 'calendar-goto-ethiopic-date) |
14915
5a4b28f19b75
Add references to Persian calendar.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
14687
diff
changeset
|
2001 (define-key calendar-mode-map "gp" 'calendar-goto-persian-date) |
957 | 2002 (define-key calendar-mode-map "gc" 'calendar-goto-iso-date) |
2003 (define-key calendar-mode-map "gf" 'calendar-goto-french-date) | |
2004 (define-key calendar-mode-map "gml" 'calendar-goto-mayan-long-count-date) | |
2005 (define-key calendar-mode-map "gmpc" 'calendar-previous-calendar-round-date) | |
2006 (define-key calendar-mode-map "gmnc" 'calendar-next-calendar-round-date) | |
2007 (define-key calendar-mode-map "gmph" 'calendar-previous-haab-date) | |
2008 (define-key calendar-mode-map "gmnh" 'calendar-next-haab-date) | |
2009 (define-key calendar-mode-map "gmpt" 'calendar-previous-tzolkin-date) | |
2010 (define-key calendar-mode-map "gmnt" 'calendar-next-tzolkin-date) | |
24243
aa82f46ecc36
Fix key bindings for appt-add and appt-delete
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
24188
diff
changeset
|
2011 (define-key calendar-mode-map "Aa" 'appt-add) |
aa82f46ecc36
Fix key bindings for appt-add and appt-delete
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
24188
diff
changeset
|
2012 (define-key calendar-mode-map "Ad" 'appt-delete) |
957 | 2013 (define-key calendar-mode-map "S" 'calendar-sunrise-sunset) |
2014 (define-key calendar-mode-map "M" 'calendar-phases-of-moon) | |
2015 (define-key calendar-mode-map " " 'scroll-other-window) | |
628 | 2016 (define-key calendar-mode-map "\C-c\C-l" 'redraw-calendar) |
8262
676fd590cc41
(calendar-goto-today): Renamed from calendar-current-month.
Richard M. Stallman <rms@gnu.org>
parents:
8143
diff
changeset
|
2017 (define-key calendar-mode-map "." 'calendar-goto-today) |
957 | 2018 (define-key calendar-mode-map "o" 'calendar-other-month) |
2019 (define-key calendar-mode-map "q" 'exit-calendar) | |
2020 (define-key calendar-mode-map "a" 'list-calendar-holidays) | |
2021 (define-key calendar-mode-map "h" 'calendar-cursor-holidays) | |
2022 (define-key calendar-mode-map "x" 'mark-calendar-holidays) | |
2023 (define-key calendar-mode-map "u" 'calendar-unmark) | |
2024 (define-key calendar-mode-map "m" 'mark-diary-entries) | |
2025 (define-key calendar-mode-map "d" 'view-diary-entries) | |
9765
c48a14db3f7b
Bind new function to key.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9757
diff
changeset
|
2026 (define-key calendar-mode-map "D" 'view-other-diary-entries) |
957 | 2027 (define-key calendar-mode-map "s" 'show-all-diary-entries) |
2028 (define-key calendar-mode-map "pd" 'calendar-print-day-of-year) | |
13042
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
2029 (define-key calendar-mode-map "pC" 'calendar-print-chinese-date) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
2030 (define-key calendar-mode-map "pk" 'calendar-print-coptic-date) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
2031 (define-key calendar-mode-map "pe" 'calendar-print-ethiopic-date) |
14915
5a4b28f19b75
Add references to Persian calendar.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
14687
diff
changeset
|
2032 (define-key calendar-mode-map "pp" 'calendar-print-persian-date) |
957 | 2033 (define-key calendar-mode-map "pc" 'calendar-print-iso-date) |
2034 (define-key calendar-mode-map "pj" 'calendar-print-julian-date) | |
2035 (define-key calendar-mode-map "pa" 'calendar-print-astro-day-number) | |
2036 (define-key calendar-mode-map "ph" 'calendar-print-hebrew-date) | |
2037 (define-key calendar-mode-map "pi" 'calendar-print-islamic-date) | |
2038 (define-key calendar-mode-map "pf" 'calendar-print-french-date) | |
2039 (define-key calendar-mode-map "pm" 'calendar-print-mayan-date) | |
22261
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2040 (define-key calendar-mode-map "po" 'calendar-print-other-dates) |
957 | 2041 (define-key calendar-mode-map "id" 'insert-diary-entry) |
2042 (define-key calendar-mode-map "iw" 'insert-weekly-diary-entry) | |
2043 (define-key calendar-mode-map "im" 'insert-monthly-diary-entry) | |
2044 (define-key calendar-mode-map "iy" 'insert-yearly-diary-entry) | |
2045 (define-key calendar-mode-map "ia" 'insert-anniversary-diary-entry) | |
2046 (define-key calendar-mode-map "ib" 'insert-block-diary-entry) | |
2047 (define-key calendar-mode-map "ic" 'insert-cyclic-diary-entry) | |
2048 (define-key calendar-mode-map "ihd" 'insert-hebrew-diary-entry) | |
2049 (define-key calendar-mode-map "ihm" 'insert-monthly-hebrew-diary-entry) | |
2050 (define-key calendar-mode-map "ihy" 'insert-yearly-hebrew-diary-entry) | |
2051 (define-key calendar-mode-map "iid" 'insert-islamic-diary-entry) | |
2052 (define-key calendar-mode-map "iim" 'insert-monthly-islamic-diary-entry) | |
2053 (define-key calendar-mode-map "iiy" 'insert-yearly-islamic-diary-entry) | |
13193
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
2054 (define-key calendar-mode-map "?" 'calendar-goto-info-node) |
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
2055 (define-key calendar-mode-map "tm" 'cal-tex-cursor-month) |
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
2056 (define-key calendar-mode-map "tM" 'cal-tex-cursor-month-landscape) |
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
2057 (define-key calendar-mode-map "td" 'cal-tex-cursor-day) |
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
2058 (define-key calendar-mode-map "tw1" 'cal-tex-cursor-week) |
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
2059 (define-key calendar-mode-map "tw2" 'cal-tex-cursor-week2) |
13596
d205632cc756
(cal-tex-cursor-filofax-week): Renamed from cal-tex-cursor-week6.
Richard M. Stallman <rms@gnu.org>
parents:
13589
diff
changeset
|
2060 (define-key calendar-mode-map "tw3" 'cal-tex-cursor-week-iso) |
d205632cc756
(cal-tex-cursor-filofax-week): Renamed from cal-tex-cursor-week6.
Richard M. Stallman <rms@gnu.org>
parents:
13589
diff
changeset
|
2061 (define-key calendar-mode-map "tw4" 'cal-tex-cursor-week-monday) |
19974
620ed2f8250e
(calendar-mode-map): Bind it to key.
Karl Heuer <kwzh@gnu.org>
parents:
19438
diff
changeset
|
2062 (define-key calendar-mode-map "tfd" 'cal-tex-cursor-filofax-daily) |
13596
d205632cc756
(cal-tex-cursor-filofax-week): Renamed from cal-tex-cursor-week6.
Richard M. Stallman <rms@gnu.org>
parents:
13589
diff
changeset
|
2063 (define-key calendar-mode-map "tfw" 'cal-tex-cursor-filofax-2week) |
d205632cc756
(cal-tex-cursor-filofax-week): Renamed from cal-tex-cursor-week6.
Richard M. Stallman <rms@gnu.org>
parents:
13589
diff
changeset
|
2064 (define-key calendar-mode-map "tfW" 'cal-tex-cursor-filofax-week) |
13193
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
2065 (define-key calendar-mode-map "tfy" 'cal-tex-cursor-filofax-year) |
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
2066 (define-key calendar-mode-map "ty" 'cal-tex-cursor-year) |
a25a4f1246c0
Added key definitions and autoloads for cal-tex.el (a new file).
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13042
diff
changeset
|
2067 (define-key calendar-mode-map "tY" 'cal-tex-cursor-year-landscape)) |
628 | 2068 |
2069 (defun describe-calendar-mode () | |
48366
9dad713d153a
Patch of Alan Shutko <ats@acm.org> by way of rms.
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47333
diff
changeset
|
2070 "Create a help buffer with a brief description of the `calendar-mode'." |
628 | 2071 (interactive) |
2072 (with-output-to-temp-buffer "*Help*" | |
2073 (princ | |
2074 (format | |
2075 "Calendar Mode:\nFor a complete description, type %s\n%s\n" | |
2076 (substitute-command-keys | |
2077 "\\<calendar-mode-map>\\[describe-mode] from within the calendar") | |
2078 (substitute-command-keys "\\{calendar-mode-map}"))) | |
9859
addf04676b54
(describe-calendar-mode): Set help-mode in *Help* buffer.
Karl Heuer <kwzh@gnu.org>
parents:
9837
diff
changeset
|
2079 (save-excursion |
addf04676b54
(describe-calendar-mode): Set help-mode in *Help* buffer.
Karl Heuer <kwzh@gnu.org>
parents:
9837
diff
changeset
|
2080 (set-buffer standard-output) |
addf04676b54
(describe-calendar-mode): Set help-mode in *Help* buffer.
Karl Heuer <kwzh@gnu.org>
parents:
9837
diff
changeset
|
2081 (help-mode)) |
628 | 2082 (print-help-return-message))) |
2083 | |
2084 ;; Calendar mode is suitable only for specially formatted data. | |
2085 (put 'calendar-mode 'mode-class 'special) | |
2086 | |
2087 (defvar calendar-mode-line-format | |
957 | 2088 (list |
31669
ec8ce5820488
(calendar-mode-line-format): Make fields
Dave Love <fx@gnu.org>
parents:
26530
diff
changeset
|
2089 (propertize (substitute-command-keys |
ec8ce5820488
(calendar-mode-line-format): Make fields
Dave Love <fx@gnu.org>
parents:
26530
diff
changeset
|
2090 "\\<calendar-mode-map>\\[scroll-calendar-left]") |
ec8ce5820488
(calendar-mode-line-format): Make fields
Dave Love <fx@gnu.org>
parents:
26530
diff
changeset
|
2091 'help-echo "mouse-2: scroll left" |
39785
5c56451d877f
(calendar-mode-line-format): do not use #' on undefined functions
Sam Steingold <sds@gnu.org>
parents:
39523
diff
changeset
|
2092 'keymap (make-mode-line-mouse-map 'mouse-2 |
47333
79920a7d8018
(mouse-scroll-calendar-left)
Richard M. Stallman <rms@gnu.org>
parents:
44371
diff
changeset
|
2093 'mouse-scroll-calendar-left)) |
957 | 2094 "Calendar" |
31669
ec8ce5820488
(calendar-mode-line-format): Make fields
Dave Love <fx@gnu.org>
parents:
26530
diff
changeset
|
2095 (concat |
ec8ce5820488
(calendar-mode-line-format): Make fields
Dave Love <fx@gnu.org>
parents:
26530
diff
changeset
|
2096 (propertize |
ec8ce5820488
(calendar-mode-line-format): Make fields
Dave Love <fx@gnu.org>
parents:
26530
diff
changeset
|
2097 (substitute-command-keys |
ec8ce5820488
(calendar-mode-line-format): Make fields
Dave Love <fx@gnu.org>
parents:
26530
diff
changeset
|
2098 "\\<calendar-mode-map>\\[calendar-goto-info-node] info") |
ec8ce5820488
(calendar-mode-line-format): Make fields
Dave Love <fx@gnu.org>
parents:
26530
diff
changeset
|
2099 'help-echo "mouse-2: read Info on Calendar" |
39785
5c56451d877f
(calendar-mode-line-format): do not use #' on undefined functions
Sam Steingold <sds@gnu.org>
parents:
39523
diff
changeset
|
2100 'keymap (make-mode-line-mouse-map 'mouse-2 'calendar-goto-info-node)) |
31669
ec8ce5820488
(calendar-mode-line-format): Make fields
Dave Love <fx@gnu.org>
parents:
26530
diff
changeset
|
2101 "/" |
ec8ce5820488
(calendar-mode-line-format): Make fields
Dave Love <fx@gnu.org>
parents:
26530
diff
changeset
|
2102 (propertize |
ec8ce5820488
(calendar-mode-line-format): Make fields
Dave Love <fx@gnu.org>
parents:
26530
diff
changeset
|
2103 (substitute-command-keys |
ec8ce5820488
(calendar-mode-line-format): Make fields
Dave Love <fx@gnu.org>
parents:
26530
diff
changeset
|
2104 "\\<calendar-mode-map>\\[calendar-other-month] other") |
ec8ce5820488
(calendar-mode-line-format): Make fields
Dave Love <fx@gnu.org>
parents:
26530
diff
changeset
|
2105 'help-echo "mouse-2: choose another month" |
39785
5c56451d877f
(calendar-mode-line-format): do not use #' on undefined functions
Sam Steingold <sds@gnu.org>
parents:
39523
diff
changeset
|
2106 'keymap (make-mode-line-mouse-map |
47333
79920a7d8018
(mouse-scroll-calendar-left)
Richard M. Stallman <rms@gnu.org>
parents:
44371
diff
changeset
|
2107 'mouse-2 'mouse-calendar-other-month)) |
31669
ec8ce5820488
(calendar-mode-line-format): Make fields
Dave Love <fx@gnu.org>
parents:
26530
diff
changeset
|
2108 "/" |
ec8ce5820488
(calendar-mode-line-format): Make fields
Dave Love <fx@gnu.org>
parents:
26530
diff
changeset
|
2109 (propertize |
ec8ce5820488
(calendar-mode-line-format): Make fields
Dave Love <fx@gnu.org>
parents:
26530
diff
changeset
|
2110 (substitute-command-keys |
ec8ce5820488
(calendar-mode-line-format): Make fields
Dave Love <fx@gnu.org>
parents:
26530
diff
changeset
|
2111 "\\<calendar-mode-map>\\[calendar-goto-today] today") |
ec8ce5820488
(calendar-mode-line-format): Make fields
Dave Love <fx@gnu.org>
parents:
26530
diff
changeset
|
2112 'help-echo "mouse-2: go to today's date" |
38756
aa185d4220dd
(calendar-mode-line-format): Use
Gerd Moellmann <gerd@gnu.org>
parents:
38448
diff
changeset
|
2113 'keymap (make-mode-line-mouse-map 'mouse-2 #'calendar-goto-today))) |
957 | 2114 '(calendar-date-string (calendar-current-date) t) |
31669
ec8ce5820488
(calendar-mode-line-format): Make fields
Dave Love <fx@gnu.org>
parents:
26530
diff
changeset
|
2115 (propertize (substitute-command-keys |
ec8ce5820488
(calendar-mode-line-format): Make fields
Dave Love <fx@gnu.org>
parents:
26530
diff
changeset
|
2116 "\\<calendar-mode-map>\\[scroll-calendar-right]") |
ec8ce5820488
(calendar-mode-line-format): Make fields
Dave Love <fx@gnu.org>
parents:
26530
diff
changeset
|
2117 'help-echo "mouse-2: scroll right" |
39785
5c56451d877f
(calendar-mode-line-format): do not use #' on undefined functions
Sam Steingold <sds@gnu.org>
parents:
39523
diff
changeset
|
2118 'keymap (make-mode-line-mouse-map |
47333
79920a7d8018
(mouse-scroll-calendar-left)
Richard M. Stallman <rms@gnu.org>
parents:
44371
diff
changeset
|
2119 'mouse-2 'mouse-scroll-calendar-right))) |
44369
72939dbe7b7b
(update-calendar-mode-line): Force mode-line update.
Richard M. Stallman <rms@gnu.org>
parents:
44084
diff
changeset
|
2120 "The mode line of the calendar buffer. |
72939dbe7b7b
(update-calendar-mode-line): Force mode-line update.
Richard M. Stallman <rms@gnu.org>
parents:
44084
diff
changeset
|
2121 |
72939dbe7b7b
(update-calendar-mode-line): Force mode-line update.
Richard M. Stallman <rms@gnu.org>
parents:
44084
diff
changeset
|
2122 This must be a list of items that evaluate to strings--those strings are |
72939dbe7b7b
(update-calendar-mode-line): Force mode-line update.
Richard M. Stallman <rms@gnu.org>
parents:
44084
diff
changeset
|
2123 evaluated and concatenated together, evenly separated by blanks. The variable |
72939dbe7b7b
(update-calendar-mode-line): Force mode-line update.
Richard M. Stallman <rms@gnu.org>
parents:
44084
diff
changeset
|
2124 `date' is available for use as the date under (or near) the cursor; `date' |
72939dbe7b7b
(update-calendar-mode-line): Force mode-line update.
Richard M. Stallman <rms@gnu.org>
parents:
44084
diff
changeset
|
2125 defaults to the current date if it is otherwise undefined. Here is an example |
44371 | 2126 value that has the Hebrew date, the day number/days remaining in the year, |
44369
72939dbe7b7b
(update-calendar-mode-line): Force mode-line update.
Richard M. Stallman <rms@gnu.org>
parents:
44084
diff
changeset
|
2127 and the ISO week/year numbers in the mode. When calendar-move-hook is set to |
72939dbe7b7b
(update-calendar-mode-line): Force mode-line update.
Richard M. Stallman <rms@gnu.org>
parents:
44084
diff
changeset
|
2128 'update-calendar-mode-line, these mode line shows these values for the date |
72939dbe7b7b
(update-calendar-mode-line): Force mode-line update.
Richard M. Stallman <rms@gnu.org>
parents:
44084
diff
changeset
|
2129 under the cursor: |
72939dbe7b7b
(update-calendar-mode-line): Force mode-line update.
Richard M. Stallman <rms@gnu.org>
parents:
44084
diff
changeset
|
2130 |
72939dbe7b7b
(update-calendar-mode-line): Force mode-line update.
Richard M. Stallman <rms@gnu.org>
parents:
44084
diff
changeset
|
2131 (list |
72939dbe7b7b
(update-calendar-mode-line): Force mode-line update.
Richard M. Stallman <rms@gnu.org>
parents:
44084
diff
changeset
|
2132 \"\" |
72939dbe7b7b
(update-calendar-mode-line): Force mode-line update.
Richard M. Stallman <rms@gnu.org>
parents:
44084
diff
changeset
|
2133 '(calendar-hebrew-date-string date) |
72939dbe7b7b
(update-calendar-mode-line): Force mode-line update.
Richard M. Stallman <rms@gnu.org>
parents:
44084
diff
changeset
|
2134 '(let* ((year (extract-calendar-year date)) |
72939dbe7b7b
(update-calendar-mode-line): Force mode-line update.
Richard M. Stallman <rms@gnu.org>
parents:
44084
diff
changeset
|
2135 (d (calendar-day-number date)) |
72939dbe7b7b
(update-calendar-mode-line): Force mode-line update.
Richard M. Stallman <rms@gnu.org>
parents:
44084
diff
changeset
|
2136 (days-remaining |
72939dbe7b7b
(update-calendar-mode-line): Force mode-line update.
Richard M. Stallman <rms@gnu.org>
parents:
44084
diff
changeset
|
2137 (- (calendar-day-number (list 12 31 year)) d))) |
72939dbe7b7b
(update-calendar-mode-line): Force mode-line update.
Richard M. Stallman <rms@gnu.org>
parents:
44084
diff
changeset
|
2138 (format \"%d/%d\" d days-remaining)) |
72939dbe7b7b
(update-calendar-mode-line): Force mode-line update.
Richard M. Stallman <rms@gnu.org>
parents:
44084
diff
changeset
|
2139 '(let* ((d (calendar-absolute-from-gregorian date)) |
72939dbe7b7b
(update-calendar-mode-line): Force mode-line update.
Richard M. Stallman <rms@gnu.org>
parents:
44084
diff
changeset
|
2140 (iso-date (calendar-iso-from-absolute d))) |
72939dbe7b7b
(update-calendar-mode-line): Force mode-line update.
Richard M. Stallman <rms@gnu.org>
parents:
44084
diff
changeset
|
2141 (format \"ISO week %d of %d\" |
72939dbe7b7b
(update-calendar-mode-line): Force mode-line update.
Richard M. Stallman <rms@gnu.org>
parents:
44084
diff
changeset
|
2142 (extract-calendar-month iso-date) |
72939dbe7b7b
(update-calendar-mode-line): Force mode-line update.
Richard M. Stallman <rms@gnu.org>
parents:
44084
diff
changeset
|
2143 (extract-calendar-year iso-date))) |
72939dbe7b7b
(update-calendar-mode-line): Force mode-line update.
Richard M. Stallman <rms@gnu.org>
parents:
44084
diff
changeset
|
2144 \"\")) |
72939dbe7b7b
(update-calendar-mode-line): Force mode-line update.
Richard M. Stallman <rms@gnu.org>
parents:
44084
diff
changeset
|
2145 ") |
628 | 2146 |
47333
79920a7d8018
(mouse-scroll-calendar-left)
Richard M. Stallman <rms@gnu.org>
parents:
44371
diff
changeset
|
2147 (defun mouse-scroll-calendar-left (event) |
79920a7d8018
(mouse-scroll-calendar-left)
Richard M. Stallman <rms@gnu.org>
parents:
44371
diff
changeset
|
2148 "Scroll the displayed calendar left by one month. |
79920a7d8018
(mouse-scroll-calendar-left)
Richard M. Stallman <rms@gnu.org>
parents:
44371
diff
changeset
|
2149 Maintains the relative position of the cursor |
79920a7d8018
(mouse-scroll-calendar-left)
Richard M. Stallman <rms@gnu.org>
parents:
44371
diff
changeset
|
2150 with respect to the calendar as well as possible." |
79920a7d8018
(mouse-scroll-calendar-left)
Richard M. Stallman <rms@gnu.org>
parents:
44371
diff
changeset
|
2151 (interactive "e") |
79920a7d8018
(mouse-scroll-calendar-left)
Richard M. Stallman <rms@gnu.org>
parents:
44371
diff
changeset
|
2152 (save-selected-window |
79920a7d8018
(mouse-scroll-calendar-left)
Richard M. Stallman <rms@gnu.org>
parents:
44371
diff
changeset
|
2153 (select-window (posn-window (event-start event))) |
79920a7d8018
(mouse-scroll-calendar-left)
Richard M. Stallman <rms@gnu.org>
parents:
44371
diff
changeset
|
2154 (scroll-calendar-left 1))) |
79920a7d8018
(mouse-scroll-calendar-left)
Richard M. Stallman <rms@gnu.org>
parents:
44371
diff
changeset
|
2155 |
79920a7d8018
(mouse-scroll-calendar-left)
Richard M. Stallman <rms@gnu.org>
parents:
44371
diff
changeset
|
2156 (defun mouse-scroll-calendar-right (event) |
79920a7d8018
(mouse-scroll-calendar-left)
Richard M. Stallman <rms@gnu.org>
parents:
44371
diff
changeset
|
2157 "Scroll the displayed calendar right by one month. |
79920a7d8018
(mouse-scroll-calendar-left)
Richard M. Stallman <rms@gnu.org>
parents:
44371
diff
changeset
|
2158 Maintains the relative position of the cursor |
79920a7d8018
(mouse-scroll-calendar-left)
Richard M. Stallman <rms@gnu.org>
parents:
44371
diff
changeset
|
2159 with respect to the calendar as well as possible." |
79920a7d8018
(mouse-scroll-calendar-left)
Richard M. Stallman <rms@gnu.org>
parents:
44371
diff
changeset
|
2160 (interactive "e") |
79920a7d8018
(mouse-scroll-calendar-left)
Richard M. Stallman <rms@gnu.org>
parents:
44371
diff
changeset
|
2161 (save-selected-window |
79920a7d8018
(mouse-scroll-calendar-left)
Richard M. Stallman <rms@gnu.org>
parents:
44371
diff
changeset
|
2162 (select-window (posn-window (event-start event))) |
79920a7d8018
(mouse-scroll-calendar-left)
Richard M. Stallman <rms@gnu.org>
parents:
44371
diff
changeset
|
2163 (scroll-calendar-right 1))) |
79920a7d8018
(mouse-scroll-calendar-left)
Richard M. Stallman <rms@gnu.org>
parents:
44371
diff
changeset
|
2164 |
79920a7d8018
(mouse-scroll-calendar-left)
Richard M. Stallman <rms@gnu.org>
parents:
44371
diff
changeset
|
2165 (defun mouse-calendar-other-month (event) |
79920a7d8018
(mouse-scroll-calendar-left)
Richard M. Stallman <rms@gnu.org>
parents:
44371
diff
changeset
|
2166 "Display a three-month calendar centered around a specified month and year." |
79920a7d8018
(mouse-scroll-calendar-left)
Richard M. Stallman <rms@gnu.org>
parents:
44371
diff
changeset
|
2167 (interactive "e") |
79920a7d8018
(mouse-scroll-calendar-left)
Richard M. Stallman <rms@gnu.org>
parents:
44371
diff
changeset
|
2168 (save-selected-window |
79920a7d8018
(mouse-scroll-calendar-left)
Richard M. Stallman <rms@gnu.org>
parents:
44371
diff
changeset
|
2169 (select-window (posn-window (event-start event))) |
79920a7d8018
(mouse-scroll-calendar-left)
Richard M. Stallman <rms@gnu.org>
parents:
44371
diff
changeset
|
2170 (call-interactively 'calendar-other-month))) |
79920a7d8018
(mouse-scroll-calendar-left)
Richard M. Stallman <rms@gnu.org>
parents:
44371
diff
changeset
|
2171 |
9709
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2172 (defun calendar-goto-info-node () |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2173 "Go to the info node for the calendar." |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2174 (interactive) |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2175 (require 'info) |
13589
a2554930ea38
(calendar-goto-info-node): Don't let
Richard M. Stallman <rms@gnu.org>
parents:
13573
diff
changeset
|
2176 (let ((where (save-window-excursion |
a2554930ea38
(calendar-goto-info-node): Don't let
Richard M. Stallman <rms@gnu.org>
parents:
13573
diff
changeset
|
2177 (Info-find-emacs-command-nodes 'calendar)))) |
9709
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2178 (if (not where) |
38422
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
38088
diff
changeset
|
2179 (error "Couldn't find documentation for the calendar") |
13589
a2554930ea38
(calendar-goto-info-node): Don't let
Richard M. Stallman <rms@gnu.org>
parents:
13573
diff
changeset
|
2180 (let (same-window-buffer-names) |
a2554930ea38
(calendar-goto-info-node): Don't let
Richard M. Stallman <rms@gnu.org>
parents:
13573
diff
changeset
|
2181 (info)) |
9709
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2182 (Info-find-node (car (car where)) (car (cdr (car where))))))) |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2183 |
48366
9dad713d153a
Patch of Alan Shutko <ats@acm.org> by way of rms.
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47333
diff
changeset
|
2184 |
9dad713d153a
Patch of Alan Shutko <ats@acm.org> by way of rms.
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47333
diff
changeset
|
2185 |
628 | 2186 (defun calendar-mode () |
957 | 2187 "A major mode for the calendar window. |
628 | 2188 |
9709
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2189 For a complete description, type \ |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2190 \\<calendar-mode-map>\\[calendar-goto-info-node] from within the calendar. |
628 | 2191 |
9709
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2192 \\<calendar-mode-map>\\{calendar-mode-map}" |
628 | 2193 |
2194 (kill-all-local-variables) | |
2195 (setq major-mode 'calendar-mode) | |
2196 (setq mode-name "Calendar") | |
2197 (use-local-map calendar-mode-map) | |
2198 (setq buffer-read-only t) | |
2199 (setq indent-tabs-mode nil) | |
957 | 2200 (update-calendar-mode-line) |
39523
183567a011b1
(calendar-mode-map): Require cal-menu unconditionally.
Eli Zaretskii <eliz@gnu.org>
parents:
38756
diff
changeset
|
2201 (add-hook 'activate-menubar-hook 'cal-menu-update nil t) |
628 | 2202 (make-local-variable 'calendar-mark-ring) |
2203 (make-local-variable 'displayed-month);; Month in middle of window. | |
48366
9dad713d153a
Patch of Alan Shutko <ats@acm.org> by way of rms.
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47333
diff
changeset
|
2204 (make-local-variable 'displayed-year) ;; Year in middle of window. |
9dad713d153a
Patch of Alan Shutko <ats@acm.org> by way of rms.
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47333
diff
changeset
|
2205 (set (make-local-variable 'font-lock-defaults) |
9dad713d153a
Patch of Alan Shutko <ats@acm.org> by way of rms.
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47333
diff
changeset
|
2206 '(calendar-font-lock-keywords t))) |
628 | 2207 |
957 | 2208 (defun calendar-string-spread (strings char length) |
12061
017af11017a0
Fixed calendar-string-spread to allow 0 or 1 string; this simplified several
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
10459
diff
changeset
|
2209 "Concatenate list of STRINGS separated with copies of CHAR to fill LENGTH. |
017af11017a0
Fixed calendar-string-spread to allow 0 or 1 string; this simplified several
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
10459
diff
changeset
|
2210 The effect is like mapconcat but the separating pieces are as balanced as |
017af11017a0
Fixed calendar-string-spread to allow 0 or 1 string; this simplified several
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
10459
diff
changeset
|
2211 possible. Each item of STRINGS is evaluated before concatenation so it can |
017af11017a0
Fixed calendar-string-spread to allow 0 or 1 string; this simplified several
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
10459
diff
changeset
|
2212 actually be an expression that evaluates to a string. If LENGTH is too short, |
017af11017a0
Fixed calendar-string-spread to allow 0 or 1 string; this simplified several
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
10459
diff
changeset
|
2213 the STRINGS are just concatenated and the result truncated." |
957 | 2214 ;; The algorithm is based on equation (3.25) on page 85 of Concrete |
2215 ;; Mathematics by Ronald L. Graham, Donald E. Knuth, and Oren Patashnik, | |
2216 ;; Addison-Wesley, Reading, MA, 1989 | |
12061
017af11017a0
Fixed calendar-string-spread to allow 0 or 1 string; this simplified several
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
10459
diff
changeset
|
2217 (let* ((strings (mapcar 'eval |
017af11017a0
Fixed calendar-string-spread to allow 0 or 1 string; this simplified several
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
10459
diff
changeset
|
2218 (if (< (length strings) 2) |
017af11017a0
Fixed calendar-string-spread to allow 0 or 1 string; this simplified several
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
10459
diff
changeset
|
2219 (append (list "") strings (list "")) |
017af11017a0
Fixed calendar-string-spread to allow 0 or 1 string; this simplified several
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
10459
diff
changeset
|
2220 strings))) |
957 | 2221 (n (- length (length (apply 'concat strings)))) |
2222 (m (1- (length strings))) | |
2223 (s (car strings)) | |
2224 (strings (cdr strings)) | |
2225 (i 0)) | |
2226 (while strings | |
2227 (setq s (concat s | |
2228 (make-string (max 0 (/ (+ n i) m)) char) | |
2229 (car strings))) | |
2230 (setq i (1+ i)) | |
2231 (setq strings (cdr strings))) | |
2232 (substring s 0 length))) | |
2233 | |
628 | 2234 (defun update-calendar-mode-line () |
2235 "Update the calendar mode line with the current date and date style." | |
2236 (if (bufferp (get-buffer calendar-buffer)) | |
2237 (save-excursion | |
2238 (set-buffer calendar-buffer) | |
2239 (setq mode-line-format | |
957 | 2240 (calendar-string-spread |
44369
72939dbe7b7b
(update-calendar-mode-line): Force mode-line update.
Richard M. Stallman <rms@gnu.org>
parents:
44084
diff
changeset
|
2241 (let ((date (condition-case nil |
72939dbe7b7b
(update-calendar-mode-line): Force mode-line update.
Richard M. Stallman <rms@gnu.org>
parents:
44084
diff
changeset
|
2242 (calendar-cursor-to-nearest-date) |
72939dbe7b7b
(update-calendar-mode-line): Force mode-line update.
Richard M. Stallman <rms@gnu.org>
parents:
44084
diff
changeset
|
2243 (error (calendar-current-date))))) |
72939dbe7b7b
(update-calendar-mode-line): Force mode-line update.
Richard M. Stallman <rms@gnu.org>
parents:
44084
diff
changeset
|
2244 (mapcar 'eval calendar-mode-line-format)) |
72939dbe7b7b
(update-calendar-mode-line): Force mode-line update.
Richard M. Stallman <rms@gnu.org>
parents:
44084
diff
changeset
|
2245 ? (frame-width))) |
72939dbe7b7b
(update-calendar-mode-line): Force mode-line update.
Richard M. Stallman <rms@gnu.org>
parents:
44084
diff
changeset
|
2246 (force-mode-line-update)))) |
628 | 2247 |
9709
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2248 (defun calendar-window-list () |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2249 "List of all calendar-related windows." |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2250 (let ((calendar-buffers (calendar-buffer-list)) |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2251 list) |
31669
ec8ce5820488
(calendar-mode-line-format): Make fields
Dave Love <fx@gnu.org>
parents:
26530
diff
changeset
|
2252 (walk-windows (lambda (w) |
ec8ce5820488
(calendar-mode-line-format): Make fields
Dave Love <fx@gnu.org>
parents:
26530
diff
changeset
|
2253 (if (memq (window-buffer w) calendar-buffers) |
ec8ce5820488
(calendar-mode-line-format): Make fields
Dave Love <fx@gnu.org>
parents:
26530
diff
changeset
|
2254 (setq list (cons w list)))) |
9709
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2255 nil t) |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2256 list)) |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2257 |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2258 (defun calendar-buffer-list () |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2259 "List of all calendar-related buffers." |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2260 (let* ((diary-buffer (get-file-buffer diary-file)) |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2261 (buffers (list "*Yahrzeits*" lunar-phases-buffer holiday-buffer |
22270
0739384d4356
Minor fixes of earlier updates.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22261
diff
changeset
|
2262 fancy-diary-buffer diary-buffer calendar-buffer |
0739384d4356
Minor fixes of earlier updates.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22261
diff
changeset
|
2263 other-calendars-buffer)) |
9709
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2264 (buffer-list nil) |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2265 b) |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2266 (while buffers |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2267 (setq b (car buffers)) |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2268 (setq b (cond ((stringp b) (get-buffer b)) |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2269 ((bufferp b) b) |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2270 (t nil))) |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2271 (if b (setq buffer-list (cons b buffer-list))) |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2272 (setq buffers (cdr buffers))) |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2273 buffer-list)) |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2274 |
628 | 2275 (defun exit-calendar () |
9709
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2276 "Get out of the calendar window and hide it and related buffers." |
628 | 2277 (interactive) |
9709
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2278 (let* ((diary-buffer (get-file-buffer diary-file))) |
22028
639be14b80ef
On exiting, don't signal error when user changes mind.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22027
diff
changeset
|
2279 (if (or (not diary-buffer) |
639be14b80ef
On exiting, don't signal error when user changes mind.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22027
diff
changeset
|
2280 (not (buffer-modified-p diary-buffer)) |
639be14b80ef
On exiting, don't signal error when user changes mind.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22027
diff
changeset
|
2281 (yes-or-no-p |
639be14b80ef
On exiting, don't signal error when user changes mind.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22027
diff
changeset
|
2282 "Diary modified; do you really want to exit the calendar? ")) |
9709
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2283 ;; Need to do this multiple times because one time can replace some |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2284 ;; calendar-related buffers with other calendar-related buffers |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2285 (mapcar (lambda (x) |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2286 (mapcar 'calendar-hide-window (calendar-window-list))) |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2287 (calendar-window-list))))) |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2288 |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2289 (defun calendar-hide-window (window) |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2290 "Hide WINDOW if it is calendar-related." |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2291 (let ((buffer (if (window-live-p window) (window-buffer window)))) |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2292 (if (memq buffer (calendar-buffer-list)) |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2293 (cond |
37430
a0e805e3a7f1
(diary-entry-marker, calendar-today-marker, calendar-holiday-marker): Use
Eli Zaretskii <eliz@gnu.org>
parents:
37001
diff
changeset
|
2294 ((and (display-multi-frame-p) |
9709
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2295 (eq 'icon (cdr (assoc 'visibility |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2296 (frame-parameters |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2297 (window-frame window)))))) |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2298 nil) |
37430
a0e805e3a7f1
(diary-entry-marker, calendar-today-marker, calendar-holiday-marker): Use
Eli Zaretskii <eliz@gnu.org>
parents:
37001
diff
changeset
|
2299 ((and (display-multi-frame-p) (window-dedicated-p window)) |
26427
3b6cf16f3633
* calendar/calendar.el (calendar-remove-frame-by-deleting):
Sam Steingold <sds@gnu.org>
parents:
26329
diff
changeset
|
2300 (if calendar-remove-frame-by-deleting |
3b6cf16f3633
* calendar/calendar.el (calendar-remove-frame-by-deleting):
Sam Steingold <sds@gnu.org>
parents:
26329
diff
changeset
|
2301 (delete-frame (window-frame window)) |
3b6cf16f3633
* calendar/calendar.el (calendar-remove-frame-by-deleting):
Sam Steingold <sds@gnu.org>
parents:
26329
diff
changeset
|
2302 (iconify-frame (window-frame window)))) |
9709
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2303 ((not (and (select-window window) (one-window-p window))) |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2304 (delete-window window)) |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2305 (t (set-buffer buffer) |
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2306 (bury-buffer)))))) |
628 | 2307 |
2308 (defun calendar-current-date () | |
31730
719a230f8091
Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31671
diff
changeset
|
2309 "Return the current date in a list (month day year)." |
16099
e3b0c3bf4451
(calendar-current-date): Simplify by using decode-time instead
Richard M. Stallman <rms@gnu.org>
parents:
15317
diff
changeset
|
2310 (let ((now (decode-time))) |
e3b0c3bf4451
(calendar-current-date): Simplify by using decode-time instead
Richard M. Stallman <rms@gnu.org>
parents:
15317
diff
changeset
|
2311 (list (nth 4 now) (nth 3 now) (nth 5 now)))) |
628 | 2312 |
5829
d266967cc1cc
(calendar-mode-line-format): Change "current" to "today".
Richard M. Stallman <rms@gnu.org>
parents:
5771
diff
changeset
|
2313 (defun calendar-cursor-to-date (&optional error) |
31730
719a230f8091
Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31671
diff
changeset
|
2314 "Return a list (month day year) of current cursor position. |
5829
d266967cc1cc
(calendar-mode-line-format): Change "current" to "today".
Richard M. Stallman <rms@gnu.org>
parents:
5771
diff
changeset
|
2315 If cursor is not on a specific date, signals an error if optional parameter |
d266967cc1cc
(calendar-mode-line-format): Change "current" to "today".
Richard M. Stallman <rms@gnu.org>
parents:
5771
diff
changeset
|
2316 ERROR is t, otherwise just returns nil." |
6037
324bb3410cfb
Fix calendar-cursor-to-date to handle starred days correctly.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
6025
diff
changeset
|
2317 (let* ((segment (/ (current-column) 25)) |
324bb3410cfb
Fix calendar-cursor-to-date to handle starred days correctly.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
6025
diff
changeset
|
2318 (month (% (+ displayed-month segment -1) 12)) |
324bb3410cfb
Fix calendar-cursor-to-date to handle starred days correctly.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
6025
diff
changeset
|
2319 (month (if (= 0 month) 12 month)) |
324bb3410cfb
Fix calendar-cursor-to-date to handle starred days correctly.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
6025
diff
changeset
|
2320 (year |
324bb3410cfb
Fix calendar-cursor-to-date to handle starred days correctly.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
6025
diff
changeset
|
2321 (cond |
324bb3410cfb
Fix calendar-cursor-to-date to handle starred days correctly.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
6025
diff
changeset
|
2322 ((and (= 12 month) (= segment 0)) (1- displayed-year)) |
324bb3410cfb
Fix calendar-cursor-to-date to handle starred days correctly.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
6025
diff
changeset
|
2323 ((and (= 1 month) (= segment 2)) (1+ displayed-year)) |
324bb3410cfb
Fix calendar-cursor-to-date to handle starred days correctly.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
6025
diff
changeset
|
2324 (t displayed-year)))) |
13042
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
2325 (if (and (looking-at "[ 0-9]?[0-9][^0-9]") |
6037
324bb3410cfb
Fix calendar-cursor-to-date to handle starred days correctly.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
6025
diff
changeset
|
2326 (< 2 (count-lines (point-min) (point)))) |
324bb3410cfb
Fix calendar-cursor-to-date to handle starred days correctly.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
6025
diff
changeset
|
2327 (save-excursion |
13042
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
2328 (if (not (looking-at " ")) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
2329 (re-search-backward "[^0-9]")) |
6037
324bb3410cfb
Fix calendar-cursor-to-date to handle starred days correctly.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
6025
diff
changeset
|
2330 (list month |
324bb3410cfb
Fix calendar-cursor-to-date to handle starred days correctly.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
6025
diff
changeset
|
2331 (string-to-int (buffer-substring (1+ (point)) (+ 4 (point)))) |
324bb3410cfb
Fix calendar-cursor-to-date to handle starred days correctly.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
6025
diff
changeset
|
2332 year)) |
7441
7f25bd8883e6
(calendar-cursor-to-date): Fix error return.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
7404
diff
changeset
|
2333 (if (looking-at "\\*") |
7f25bd8883e6
(calendar-cursor-to-date): Fix error return.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
7404
diff
changeset
|
2334 (save-excursion |
7f25bd8883e6
(calendar-cursor-to-date): Fix error return.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
7404
diff
changeset
|
2335 (re-search-backward "[^*]") |
7f25bd8883e6
(calendar-cursor-to-date): Fix error return.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
7404
diff
changeset
|
2336 (if (looking-at ".\\*\\*") |
7714
f90c3d5352e9
(calendar-cursor-to-date): Rename starred-day to calendar-starred-day.
Richard M. Stallman <rms@gnu.org>
parents:
7441
diff
changeset
|
2337 (list month calendar-starred-day year) |
7441
7f25bd8883e6
(calendar-cursor-to-date): Fix error return.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
7404
diff
changeset
|
2338 (if error (error "Not on a date!")))) |
7f25bd8883e6
(calendar-cursor-to-date): Fix error return.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
7404
diff
changeset
|
2339 (if error (error "Not on a date!")))))) |
628 | 2340 |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2341 ;; The following version of calendar-gregorian-from-absolute is preferred for |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2342 ;; reasons of clarity, BUT it's much slower than the version that follows it. |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2343 |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2344 ;;(defun calendar-gregorian-from-absolute (date) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2345 ;; "Compute the list (month day year) corresponding to the absolute DATE. |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2346 ;;The absolute date is the number of days elapsed since the (imaginary) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2347 ;;Gregorian date Sunday, December 31, 1 BC." |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2348 ;; (let* ((approx (/ date 366));; Approximation from below. |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2349 ;; (year ;; Search forward from the approximation. |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2350 ;; (+ approx |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2351 ;; (calendar-sum y approx |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2352 ;; (>= date (calendar-absolute-from-gregorian (list 1 1 (1+ y)))) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2353 ;; 1))) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2354 ;; (month ;; Search forward from January. |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2355 ;; (1+ (calendar-sum m 1 |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2356 ;; (> date |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2357 ;; (calendar-absolute-from-gregorian |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2358 ;; (list m (calendar-last-day-of-month m year) year))) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2359 ;; 1))) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2360 ;; (day ;; Calculate the day by subtraction. |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2361 ;; (- date |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2362 ;; (1- (calendar-absolute-from-gregorian (list month 1 year)))))) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2363 ;; (list month day year))) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2364 |
628 | 2365 (defun calendar-gregorian-from-absolute (date) |
2366 "Compute the list (month day year) corresponding to the absolute DATE. | |
2367 The absolute date is the number of days elapsed since the (imaginary) | |
2368 Gregorian date Sunday, December 31, 1 BC." | |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2369 ;; See the footnote on page 384 of ``Calendrical Calculations, Part II: |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2370 ;; Three Historical Calendars'' by E. M. Reingold, N. Dershowitz, and S. M. |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2371 ;; Clamen, Software--Practice and Experience, Volume 23, Number 4 |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2372 ;; (April, 1993), pages 383-404 for an explanation. |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2373 (let* ((d0 (1- date)) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2374 (n400 (/ d0 146097)) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2375 (d1 (% d0 146097)) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2376 (n100 (/ d1 36524)) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2377 (d2 (% d1 36524)) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2378 (n4 (/ d2 1461)) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2379 (d3 (% d2 1461)) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2380 (n1 (/ d3 365)) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2381 (day (1+ (% d3 365))) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2382 (year (+ (* 400 n400) (* 100 n100) (* n4 4) n1))) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2383 (if (or (= n100 4) (= n1 4)) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2384 (list 12 31 year) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2385 (let ((year (1+ year)) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2386 (month 1)) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2387 (while (let ((mdays (calendar-last-day-of-month month year))) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2388 (and (< mdays day) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2389 (setq day (- day mdays)))) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2390 (setq month (1+ month))) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2391 (list month day year))))) |
628 | 2392 |
2393 (defun calendar-other-month (month year) | |
2394 "Display a three-month calendar centered around MONTH and YEAR." | |
9747
5586959f3393
Redo the noday option for calendar-read-date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9709
diff
changeset
|
2395 (interactive (calendar-read-date 'noday)) |
628 | 2396 (if (and (= month displayed-month) |
2397 (= year displayed-year)) | |
2398 nil | |
2399 (let ((old-date (calendar-cursor-to-date)) | |
2400 (today (calendar-current-date))) | |
957 | 2401 (generate-calendar-window month year) |
628 | 2402 (calendar-cursor-to-visible-date |
2403 (cond | |
2404 ((calendar-date-is-visible-p old-date) old-date) | |
2405 ((calendar-date-is-visible-p today) today) | |
2406 (t (list month 1 year))))))) | |
2407 | |
2408 (defun calendar-set-mark (arg) | |
2409 "Mark the date under the cursor, or jump to marked date. | |
2410 With no prefix argument, push current date onto marked date ring. | |
2411 With argument, jump to mark, pop it, and put point at end of ring." | |
2412 (interactive "P") | |
5829
d266967cc1cc
(calendar-mode-line-format): Change "current" to "today".
Richard M. Stallman <rms@gnu.org>
parents:
5771
diff
changeset
|
2413 (let ((date (calendar-cursor-to-date t))) |
628 | 2414 (if (null arg) |
2415 (progn | |
2416 (setq calendar-mark-ring (cons date calendar-mark-ring)) | |
2417 ;; Since the top of the mark ring is the marked date in the | |
2418 ;; calendar, the mark ring in the calendar is one longer than | |
2419 ;; in other buffers to get the same effect. | |
2420 (if (> (length calendar-mark-ring) (1+ mark-ring-max)) | |
2421 (setcdr (nthcdr mark-ring-max calendar-mark-ring) nil)) | |
2422 (message "Mark set")) | |
2423 (if (null calendar-mark-ring) | |
2424 (error "No mark set in this buffer") | |
2425 (calendar-goto-date (car calendar-mark-ring)) | |
2426 (setq calendar-mark-ring | |
2427 (cdr (nconc calendar-mark-ring (list date)))))))) | |
2428 | |
2429 (defun calendar-exchange-point-and-mark () | |
2430 "Exchange the current cursor position with the marked date." | |
2431 (interactive) | |
2432 (let ((mark (car calendar-mark-ring)) | |
5829
d266967cc1cc
(calendar-mode-line-format): Change "current" to "today".
Richard M. Stallman <rms@gnu.org>
parents:
5771
diff
changeset
|
2433 (date (calendar-cursor-to-date t))) |
628 | 2434 (if (null mark) |
2435 (error "No mark set in this buffer") | |
2436 (setq calendar-mark-ring (cons date (cdr calendar-mark-ring))) | |
2437 (calendar-goto-date mark)))) | |
2438 | |
2439 (defun calendar-count-days-region () | |
2440 "Count the number of days (inclusive) between point and the mark." | |
2441 (interactive) | |
2442 (let* ((days (- (calendar-absolute-from-gregorian | |
5829
d266967cc1cc
(calendar-mode-line-format): Change "current" to "today".
Richard M. Stallman <rms@gnu.org>
parents:
5771
diff
changeset
|
2443 (calendar-cursor-to-date t)) |
628 | 2444 (calendar-absolute-from-gregorian |
2445 (or (car calendar-mark-ring) | |
2446 (error "No mark set in this buffer"))))) | |
2447 (days (1+ (if (> days 0) days (- days))))) | |
2448 (message "Region has %d day%s (inclusive)" | |
2449 days (if (> days 1) "s" "")))) | |
2450 | |
2451 (defun calendar-not-implemented () | |
2452 "Not implemented." | |
2453 (interactive) | |
2454 (error "%s not available in the calendar" | |
2455 (global-key-binding (this-command-keys)))) | |
2456 | |
2457 (defun calendar-read (prompt acceptable &optional initial-contents) | |
2458 "Return an object read from the minibuffer. | |
2459 Prompt with the string PROMPT and use the function ACCEPTABLE to decide if | |
2460 entered item is acceptable. If non-nil, optional third arg INITIAL-CONTENTS | |
2461 is a string to insert in the minibuffer before reading." | |
2462 (let ((value (read-minibuffer prompt initial-contents))) | |
2463 (while (not (funcall acceptable value)) | |
2464 (setq value (read-minibuffer prompt initial-contents))) | |
2465 value)) | |
2466 | |
9709
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2467 (defun calendar-read-date (&optional noday) |
31730
719a230f8091
Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31671
diff
changeset
|
2468 "Prompt for Gregorian date. Return a list (month day year). |
9709
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2469 If optional NODAY is t, does not ask for day, but just returns |
18940
953dfe84b101
(calendar-day-name): New optional args WIDTH, ABSOLUTE.
Richard M. Stallman <rms@gnu.org>
parents:
17625
diff
changeset
|
2470 \(month nil year); if NODAY is any other non-nil value the value returned is |
31730
719a230f8091
Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31671
diff
changeset
|
2471 \(month year)" |
957 | 2472 (let* ((year (calendar-read |
2473 "Year (>0): " | |
31669
ec8ce5820488
(calendar-mode-line-format): Make fields
Dave Love <fx@gnu.org>
parents:
26530
diff
changeset
|
2474 (lambda (x) (> x 0)) |
957 | 2475 (int-to-string (extract-calendar-year |
2476 (calendar-current-date))))) | |
2477 (month-array calendar-month-name-array) | |
2478 (completion-ignore-case t) | |
24188
94db9f395842
(calendar-read-date): Use assoc-ignore-case and do not capitalize when
Richard M. Stallman <rms@gnu.org>
parents:
23531
diff
changeset
|
2479 (month (cdr (assoc-ignore-case |
957 | 2480 (completing-read |
2481 "Month name: " | |
2482 (mapcar 'list (append month-array nil)) | |
24188
94db9f395842
(calendar-read-date): Use assoc-ignore-case and do not capitalize when
Richard M. Stallman <rms@gnu.org>
parents:
23531
diff
changeset
|
2483 nil t) |
94db9f395842
(calendar-read-date): Use assoc-ignore-case and do not capitalize when
Richard M. Stallman <rms@gnu.org>
parents:
23531
diff
changeset
|
2484 (calendar-make-alist month-array 1)))) |
9709
3ece524b8ea3
Lots of minor fixes and code polishing. Exit-calendar code rewritten.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9417
diff
changeset
|
2485 (last (calendar-last-day-of-month month year))) |
9747
5586959f3393
Redo the noday option for calendar-read-date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9709
diff
changeset
|
2486 (if noday |
5586959f3393
Redo the noday option for calendar-read-date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9709
diff
changeset
|
2487 (if (eq noday t) |
5586959f3393
Redo the noday option for calendar-read-date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9709
diff
changeset
|
2488 (list month nil year) |
5586959f3393
Redo the noday option for calendar-read-date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9709
diff
changeset
|
2489 (list month year)) |
5586959f3393
Redo the noday option for calendar-read-date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9709
diff
changeset
|
2490 (list month |
5586959f3393
Redo the noday option for calendar-read-date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9709
diff
changeset
|
2491 (calendar-read (format "Day (1-%d): " last) |
31669
ec8ce5820488
(calendar-mode-line-format): Make fields
Dave Love <fx@gnu.org>
parents:
26530
diff
changeset
|
2492 (lambda (x) (and (< 0 x) (<= x last)))) |
9747
5586959f3393
Redo the noday option for calendar-read-date.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
9709
diff
changeset
|
2493 year)))) |
957 | 2494 |
628 | 2495 (defun calendar-interval (mon1 yr1 mon2 yr2) |
957 | 2496 "The number of months difference between MON1, YR1 and MON2, YR2." |
628 | 2497 (+ (* 12 (- yr2 yr1)) |
2498 (- mon2 mon1))) | |
2499 | |
4861
924486090b27
(calendar-week-start-day): New var (autoloaded) to
Richard M. Stallman <rms@gnu.org>
parents:
4658
diff
changeset
|
2500 (defvar calendar-day-name-array |
23531
37ae25c77df0
Add doc strings CORRECTLY!
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
23498
diff
changeset
|
2501 ["Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday"] |
37ae25c77df0
Add doc strings CORRECTLY!
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
23498
diff
changeset
|
2502 "Array of capitalized strings giving, in order, the day names.") |
628 | 2503 |
4861
924486090b27
(calendar-week-start-day): New var (autoloaded) to
Richard M. Stallman <rms@gnu.org>
parents:
4658
diff
changeset
|
2504 (defvar calendar-month-name-array |
628 | 2505 ["January" "February" "March" "April" "May" "June" |
23531
37ae25c77df0
Add doc strings CORRECTLY!
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
23498
diff
changeset
|
2506 "July" "August" "September" "October" "November" "December"] |
37ae25c77df0
Add doc strings CORRECTLY!
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
23498
diff
changeset
|
2507 "Array of capitalized strings giving, in order, the month names.") |
628 | 2508 |
48366
9dad713d153a
Patch of Alan Shutko <ats@acm.org> by way of rms.
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47333
diff
changeset
|
2509 (defvar calendar-font-lock-keywords |
48683
ead34b521994
(facemenu-unlisted-faces): Only update after facemenu was loaded.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
48366
diff
changeset
|
2510 `((,(concat (regexp-opt (mapcar 'identity calendar-month-name-array) t) |
ead34b521994
(facemenu-unlisted-faces): Only update after facemenu was loaded.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
48366
diff
changeset
|
2511 " -?[0-9]+") |
ead34b521994
(facemenu-unlisted-faces): Only update after facemenu was loaded.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
48366
diff
changeset
|
2512 . font-lock-function-name-face) ; month and year |
ead34b521994
(facemenu-unlisted-faces): Only update after facemenu was loaded.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
48366
diff
changeset
|
2513 (,(regexp-opt |
ead34b521994
(facemenu-unlisted-faces): Only update after facemenu was loaded.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
48366
diff
changeset
|
2514 (list (substring (aref calendar-day-name-array 6) 0 2) |
ead34b521994
(facemenu-unlisted-faces): Only update after facemenu was loaded.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
48366
diff
changeset
|
2515 (substring (aref calendar-day-name-array 0) 0 2))) |
ead34b521994
(facemenu-unlisted-faces): Only update after facemenu was loaded.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
48366
diff
changeset
|
2516 ;; Saturdays and Sundays are hilited differently. |
ead34b521994
(facemenu-unlisted-faces): Only update after facemenu was loaded.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
48366
diff
changeset
|
2517 . font-lock-comment-face) |
ead34b521994
(facemenu-unlisted-faces): Only update after facemenu was loaded.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
48366
diff
changeset
|
2518 (,(regexp-opt (mapcar (lambda (x) (substring x 0 2)) calendar-day-name-array)) |
ead34b521994
(facemenu-unlisted-faces): Only update after facemenu was loaded.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
48366
diff
changeset
|
2519 . font-lock-reference-face)) |
48366
9dad713d153a
Patch of Alan Shutko <ats@acm.org> by way of rms.
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47333
diff
changeset
|
2520 "Default keywords to highlight in Calendar mode.") |
9dad713d153a
Patch of Alan Shutko <ats@acm.org> by way of rms.
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47333
diff
changeset
|
2521 |
48717
b243692710b4
(calendar-day-name): Move defn down.
Richard M. Stallman <rms@gnu.org>
parents:
48683
diff
changeset
|
2522 (defun calendar-day-name (date &optional width absolute) |
b243692710b4
(calendar-day-name): Move defn down.
Richard M. Stallman <rms@gnu.org>
parents:
48683
diff
changeset
|
2523 "Return a string with the name of the day of the week of DATE. |
b243692710b4
(calendar-day-name): Move defn down.
Richard M. Stallman <rms@gnu.org>
parents:
48683
diff
changeset
|
2524 If WIDTH is non-nil, return just the first WIDTH characters of the name. |
b243692710b4
(calendar-day-name): Move defn down.
Richard M. Stallman <rms@gnu.org>
parents:
48683
diff
changeset
|
2525 If ABSOLUTE is non-nil, then DATE is actually the day-of-the-week |
b243692710b4
(calendar-day-name): Move defn down.
Richard M. Stallman <rms@gnu.org>
parents:
48683
diff
changeset
|
2526 rather than a date." |
b243692710b4
(calendar-day-name): Move defn down.
Richard M. Stallman <rms@gnu.org>
parents:
48683
diff
changeset
|
2527 (let ((string (aref calendar-day-name-array |
b243692710b4
(calendar-day-name): Move defn down.
Richard M. Stallman <rms@gnu.org>
parents:
48683
diff
changeset
|
2528 (if absolute date (calendar-day-of-week date))))) |
b243692710b4
(calendar-day-name): Move defn down.
Richard M. Stallman <rms@gnu.org>
parents:
48683
diff
changeset
|
2529 (cond ((null width) string) |
b243692710b4
(calendar-day-name): Move defn down.
Richard M. Stallman <rms@gnu.org>
parents:
48683
diff
changeset
|
2530 (enable-multibyte-characters (truncate-string-to-width string width)) |
b243692710b4
(calendar-day-name): Move defn down.
Richard M. Stallman <rms@gnu.org>
parents:
48683
diff
changeset
|
2531 (t (substring string 0 width))))) |
48366
9dad713d153a
Patch of Alan Shutko <ats@acm.org> by way of rms.
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47333
diff
changeset
|
2532 |
628 | 2533 (defun calendar-make-alist (sequence &optional start-index filter) |
2534 "Make an assoc list corresponding to SEQUENCE. | |
2535 Start at index 1, unless optional START-INDEX is provided. | |
2536 If FILTER is provided, apply it to each item in the list." | |
2537 (let ((index (if start-index (1- start-index) 0))) | |
2538 (mapcar | |
31730
719a230f8091
Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31671
diff
changeset
|
2539 (lambda (x) |
628 | 2540 (setq index (1+ index)) |
2541 (cons (if filter (funcall filter x) x) | |
2542 index)) | |
2543 (append sequence nil)))) | |
2544 | |
18940
953dfe84b101
(calendar-day-name): New optional args WIDTH, ABSOLUTE.
Richard M. Stallman <rms@gnu.org>
parents:
17625
diff
changeset
|
2545 (defun calendar-month-name (month &optional width) |
953dfe84b101
(calendar-day-name): New optional args WIDTH, ABSOLUTE.
Richard M. Stallman <rms@gnu.org>
parents:
17625
diff
changeset
|
2546 "The name of MONTH. |
953dfe84b101
(calendar-day-name): New optional args WIDTH, ABSOLUTE.
Richard M. Stallman <rms@gnu.org>
parents:
17625
diff
changeset
|
2547 If WIDTH is non-nil, return just the first WIDTH characters of the name." |
953dfe84b101
(calendar-day-name): New optional args WIDTH, ABSOLUTE.
Richard M. Stallman <rms@gnu.org>
parents:
17625
diff
changeset
|
2548 (let ((string (aref calendar-month-name-array (1- month)))) |
953dfe84b101
(calendar-day-name): New optional args WIDTH, ABSOLUTE.
Richard M. Stallman <rms@gnu.org>
parents:
17625
diff
changeset
|
2549 (if width |
953dfe84b101
(calendar-day-name): New optional args WIDTH, ABSOLUTE.
Richard M. Stallman <rms@gnu.org>
parents:
17625
diff
changeset
|
2550 (let ((i 0) (result "") (pos 0)) |
953dfe84b101
(calendar-day-name): New optional args WIDTH, ABSOLUTE.
Richard M. Stallman <rms@gnu.org>
parents:
17625
diff
changeset
|
2551 (while (< i width) |
31669
ec8ce5820488
(calendar-mode-line-format): Make fields
Dave Love <fx@gnu.org>
parents:
26530
diff
changeset
|
2552 (let ((chartext (char-to-string (aref string pos)))) |
18940
953dfe84b101
(calendar-day-name): New optional args WIDTH, ABSOLUTE.
Richard M. Stallman <rms@gnu.org>
parents:
17625
diff
changeset
|
2553 (setq pos (+ pos (length chartext))) |
953dfe84b101
(calendar-day-name): New optional args WIDTH, ABSOLUTE.
Richard M. Stallman <rms@gnu.org>
parents:
17625
diff
changeset
|
2554 (setq result (concat result chartext))) |
953dfe84b101
(calendar-day-name): New optional args WIDTH, ABSOLUTE.
Richard M. Stallman <rms@gnu.org>
parents:
17625
diff
changeset
|
2555 (setq i (1+ i))) |
953dfe84b101
(calendar-day-name): New optional args WIDTH, ABSOLUTE.
Richard M. Stallman <rms@gnu.org>
parents:
17625
diff
changeset
|
2556 result) |
953dfe84b101
(calendar-day-name): New optional args WIDTH, ABSOLUTE.
Richard M. Stallman <rms@gnu.org>
parents:
17625
diff
changeset
|
2557 string))) |
628 | 2558 |
2559 (defun calendar-day-of-week (date) | |
31730
719a230f8091
Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31671
diff
changeset
|
2560 "Return the day-of-the-week index of DATE, 0 for Sunday, 1 for Monday, etc." |
628 | 2561 (% (calendar-absolute-from-gregorian date) 7)) |
2562 | |
2563 (defun calendar-unmark () | |
5694
69471d331d0c
(calendar-version): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5272
diff
changeset
|
2564 "Delete all diary/holiday marks/highlighting from the calendar." |
628 | 2565 (interactive) |
2566 (setq mark-holidays-in-calendar nil) | |
5694
69471d331d0c
(calendar-version): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5272
diff
changeset
|
2567 (setq mark-diary-entries-in-calendar nil) |
69471d331d0c
(calendar-version): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5272
diff
changeset
|
2568 (redraw-calendar)) |
628 | 2569 |
2570 (defun calendar-date-is-visible-p (date) | |
31730
719a230f8091
Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31671
diff
changeset
|
2571 "Return t if DATE is legal and is visible in the calendar window." |
628 | 2572 (let ((gap (calendar-interval |
2573 displayed-month displayed-year | |
2574 (extract-calendar-month date) (extract-calendar-year date)))) | |
2575 (and (calendar-date-is-legal-p date) (> 2 gap) (< -2 gap)))) | |
2576 | |
2577 (defun calendar-date-is-legal-p (date) | |
31730
719a230f8091
Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31671
diff
changeset
|
2578 "Return t if DATE is a legal date." |
628 | 2579 (let ((month (extract-calendar-month date)) |
2580 (day (extract-calendar-day date)) | |
2581 (year (extract-calendar-year date))) | |
2582 (and (<= 1 month) (<= month 12) | |
2583 (<= 1 day) (<= day (calendar-last-day-of-month month year)) | |
2584 (<= 1 year)))) | |
2585 | |
2586 (defun calendar-date-equal (date1 date2) | |
31730
719a230f8091
Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31671
diff
changeset
|
2587 "Return t if the DATE1 and DATE2 are the same." |
628 | 2588 (and |
2589 (= (extract-calendar-month date1) (extract-calendar-month date2)) | |
2590 (= (extract-calendar-day date1) (extract-calendar-day date2)) | |
2591 (= (extract-calendar-year date1) (extract-calendar-year date2)))) | |
2592 | |
2593 (defun mark-visible-calendar-date (date &optional mark) | |
5694
69471d331d0c
(calendar-version): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5272
diff
changeset
|
2594 "Mark DATE in the calendar window with MARK. |
49736
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
2595 MARK is a single-character string, a list of face attributes/values, or a face. |
48366
9dad713d153a
Patch of Alan Shutko <ats@acm.org> by way of rms.
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47333
diff
changeset
|
2596 MARK defaults to `diary-entry-marker'." |
628 | 2597 (if (calendar-date-is-legal-p date) |
2598 (save-excursion | |
2599 (set-buffer calendar-buffer) | |
2600 (calendar-cursor-to-visible-date date) | |
49736
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
2601 (let ((mark (or (and (stringp mark) (= (length mark) 1) mark) ; single-char |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
2602 (and (listp mark) (> (length mark) 0) mark) ; attr list |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
2603 (and (facep mark) mark) ; face-name |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
2604 diary-entry-marker))) |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
2605 (if (facep mark) |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
2606 (progn ; face or an attr-list that contained a face |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
2607 (overlay-put |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
2608 (make-overlay (1- (point)) (1+ (point))) 'face mark)) |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
2609 (if (and (stringp mark) |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
2610 (= (length mark) 1)) ; single-char |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
2611 (let ((buffer-read-only nil)) |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
2612 (forward-char 1) |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
2613 (delete-char 1) |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
2614 (insert mark) |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
2615 (forward-char -2)) |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
2616 (progn ; attr list |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
2617 (setq temp-face |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
2618 (make-symbol (apply 'concat "temp-face-" |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
2619 (mapcar '(lambda (sym) |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
2620 (cond ((symbolp sym) (symbol-name sym)) |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
2621 ((numberp sym) (int-to-string sym)) |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
2622 (t sym))) mark)))) |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
2623 (make-face temp-face) |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
2624 ;; Remove :face info from the mark, copy the face info into temp-face |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
2625 (setq faceinfo mark) |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
2626 (while (setq faceinfo (memq :face faceinfo)) |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
2627 (copy-face (read (nth 1 faceinfo)) temp-face) |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
2628 (setcar faceinfo nil) |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
2629 (setcar (cdr faceinfo) nil)) |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
2630 (setq mark (delq nil mark)) |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
2631 ;; Apply the font aspects |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
2632 (apply 'set-face-attribute temp-face nil mark) |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
2633 (overlay-put |
dd8404d4fed8
(diary-face-attrs): New custom.
Juanma Barranquero <lekktu@gmail.com>
parents:
49350
diff
changeset
|
2634 (make-overlay (1- (point)) (1+ (point))) 'face temp-face)))))))) |
628 | 2635 |
2636 (defun calendar-star-date () | |
2637 "Replace the date under the cursor in the calendar window with asterisks. | |
31730
719a230f8091
Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31671
diff
changeset
|
2638 This function can be used with the `today-visible-calendar-hook' run after the |
628 | 2639 calendar window has been prepared." |
31730
719a230f8091
Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31671
diff
changeset
|
2640 (let ((inhibit-read-only t)) |
719a230f8091
Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31671
diff
changeset
|
2641 (make-local-variable 'calendar-starred-day) |
628 | 2642 (forward-char 1) |
7132
1842a026e270
(calendar-starred-day): Var renamed from starred-day.
Richard M. Stallman <rms@gnu.org>
parents:
6906
diff
changeset
|
2643 (setq calendar-starred-day |
957 | 2644 (string-to-int |
2645 (buffer-substring (point) (- (point) 2)))) | |
628 | 2646 (delete-char -2) |
2647 (insert "**") | |
2648 (backward-char 1) | |
2649 (set-buffer-modified-p nil))) | |
2650 | |
2651 (defun calendar-mark-today () | |
5694
69471d331d0c
(calendar-version): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5272
diff
changeset
|
2652 "Mark the date under the cursor in the calendar window. |
48366
9dad713d153a
Patch of Alan Shutko <ats@acm.org> by way of rms.
Markus Rost <rost@math.uni-bielefeld.de>
parents:
47333
diff
changeset
|
2653 The date is marked with `calendar-today-marker'. This function can be used with |
31730
719a230f8091
Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31671
diff
changeset
|
2654 the `today-visible-calendar-hook' run after the calendar window has been |
5694
69471d331d0c
(calendar-version): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5272
diff
changeset
|
2655 prepared." |
69471d331d0c
(calendar-version): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5272
diff
changeset
|
2656 (mark-visible-calendar-date |
69471d331d0c
(calendar-version): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5272
diff
changeset
|
2657 (calendar-cursor-to-date) |
69471d331d0c
(calendar-version): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5272
diff
changeset
|
2658 calendar-today-marker)) |
628 | 2659 |
2660 (defun calendar-date-compare (date1 date2) | |
31730
719a230f8091
Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31671
diff
changeset
|
2661 "Return t if DATE1 is before DATE2, nil otherwise. |
628 | 2662 The actual dates are in the car of DATE1 and DATE2." |
2663 (< (calendar-absolute-from-gregorian (car date1)) | |
2664 (calendar-absolute-from-gregorian (car date2)))) | |
2665 | |
2666 (defun calendar-date-string (date &optional abbreviate nodayname) | |
2667 "A string form of DATE, driven by the variable `calendar-date-display-form'. | |
2668 An optional parameter ABBREVIATE, when t, causes the month and day names to be | |
2669 abbreviated to three characters. An optional parameter NODAYNAME, when t, | |
2670 omits the name of the day of the week." | |
2671 (let* ((dayname | |
2672 (if nodayname | |
957 | 2673 nil |
628 | 2674 (if abbreviate |
18940
953dfe84b101
(calendar-day-name): New optional args WIDTH, ABSOLUTE.
Richard M. Stallman <rms@gnu.org>
parents:
17625
diff
changeset
|
2675 (calendar-day-name date 3) |
628 | 2676 (calendar-day-name date)))) |
2677 (month (extract-calendar-month date)) | |
2678 (monthname | |
2679 (if abbreviate | |
18940
953dfe84b101
(calendar-day-name): New optional args WIDTH, ABSOLUTE.
Richard M. Stallman <rms@gnu.org>
parents:
17625
diff
changeset
|
2680 (calendar-month-name month 3) |
628 | 2681 (calendar-month-name month))) |
2682 (day (int-to-string (extract-calendar-day date))) | |
2683 (month (int-to-string month)) | |
2684 (year (int-to-string (extract-calendar-year date)))) | |
2685 (mapconcat 'eval calendar-date-display-form ""))) | |
2686 | |
2687 (defun calendar-dayname-on-or-before (dayname date) | |
31730
719a230f8091
Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
31671
diff
changeset
|
2688 "Return the absolute date of the DAYNAME on or before absolute DATE. |
628 | 2689 DAYNAME=0 means Sunday, DAYNAME=1 means Monday, and so on. |
2690 | |
2691 Note: Applying this function to d+6 gives us the DAYNAME on or after an | |
2692 absolute day d. Similarly, applying it to d+3 gives the DAYNAME nearest to | |
2693 absolute date d, applying it to d-1 gives the DAYNAME previous to absolute | |
2694 date d, and applying it to d+7 gives the DAYNAME following absolute date d." | |
2695 (- date (% (- date dayname) 7))) | |
2696 | |
4658
a34bd3ee36ef
(solar-holidays): Use new
Paul Eggert <eggert@twinsun.com>
parents:
4652
diff
changeset
|
2697 (defun calendar-nth-named-absday (n dayname month year &optional day) |
a34bd3ee36ef
(solar-holidays): Use new
Paul Eggert <eggert@twinsun.com>
parents:
4652
diff
changeset
|
2698 "The absolute date of Nth DAYNAME in MONTH, YEAR before/after optional DAY. |
a34bd3ee36ef
(solar-holidays): Use new
Paul Eggert <eggert@twinsun.com>
parents:
4652
diff
changeset
|
2699 A DAYNAME of 0 means Sunday, 1 means Monday, and so on. If N<0, |
a34bd3ee36ef
(solar-holidays): Use new
Paul Eggert <eggert@twinsun.com>
parents:
4652
diff
changeset
|
2700 return the Nth DAYNAME before MONTH DAY, YEAR (inclusive). |
a34bd3ee36ef
(solar-holidays): Use new
Paul Eggert <eggert@twinsun.com>
parents:
4652
diff
changeset
|
2701 If N>0, return the Nth DAYNAME after MONTH DAY, YEAR (inclusive). |
a34bd3ee36ef
(solar-holidays): Use new
Paul Eggert <eggert@twinsun.com>
parents:
4652
diff
changeset
|
2702 |
a34bd3ee36ef
(solar-holidays): Use new
Paul Eggert <eggert@twinsun.com>
parents:
4652
diff
changeset
|
2703 If DAY is omitted, it defaults to 1 if N>0, and MONTH's last day otherwise." |
a34bd3ee36ef
(solar-holidays): Use new
Paul Eggert <eggert@twinsun.com>
parents:
4652
diff
changeset
|
2704 (if (> n 0) |
a34bd3ee36ef
(solar-holidays): Use new
Paul Eggert <eggert@twinsun.com>
parents:
4652
diff
changeset
|
2705 (+ (* 7 (1- n)) |
a34bd3ee36ef
(solar-holidays): Use new
Paul Eggert <eggert@twinsun.com>
parents:
4652
diff
changeset
|
2706 (calendar-dayname-on-or-before |
a34bd3ee36ef
(solar-holidays): Use new
Paul Eggert <eggert@twinsun.com>
parents:
4652
diff
changeset
|
2707 dayname |
a34bd3ee36ef
(solar-holidays): Use new
Paul Eggert <eggert@twinsun.com>
parents:
4652
diff
changeset
|
2708 (+ 6 (calendar-absolute-from-gregorian |
a34bd3ee36ef
(solar-holidays): Use new
Paul Eggert <eggert@twinsun.com>
parents:
4652
diff
changeset
|
2709 (list month (or day 1) year))))) |
a34bd3ee36ef
(solar-holidays): Use new
Paul Eggert <eggert@twinsun.com>
parents:
4652
diff
changeset
|
2710 (+ (* 7 (1+ n)) |
a34bd3ee36ef
(solar-holidays): Use new
Paul Eggert <eggert@twinsun.com>
parents:
4652
diff
changeset
|
2711 (calendar-dayname-on-or-before |
a34bd3ee36ef
(solar-holidays): Use new
Paul Eggert <eggert@twinsun.com>
parents:
4652
diff
changeset
|
2712 dayname |
a34bd3ee36ef
(solar-holidays): Use new
Paul Eggert <eggert@twinsun.com>
parents:
4652
diff
changeset
|
2713 (calendar-absolute-from-gregorian |
a34bd3ee36ef
(solar-holidays): Use new
Paul Eggert <eggert@twinsun.com>
parents:
4652
diff
changeset
|
2714 (list month |
a34bd3ee36ef
(solar-holidays): Use new
Paul Eggert <eggert@twinsun.com>
parents:
4652
diff
changeset
|
2715 (or day (calendar-last-day-of-month month year)) |
a34bd3ee36ef
(solar-holidays): Use new
Paul Eggert <eggert@twinsun.com>
parents:
4652
diff
changeset
|
2716 year)))))) |
a34bd3ee36ef
(solar-holidays): Use new
Paul Eggert <eggert@twinsun.com>
parents:
4652
diff
changeset
|
2717 |
3865
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2718 (defun calendar-nth-named-day (n dayname month year &optional day) |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2719 "The date of Nth DAYNAME in MONTH, YEAR before/after optional DAY. |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2720 A DAYNAME of 0 means Sunday, 1 means Monday, and so on. If N<0, |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2721 return the Nth DAYNAME before MONTH DAY, YEAR (inclusive). |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2722 If N>0, return the Nth DAYNAME after MONTH DAY, YEAR (inclusive). |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2723 |
2c6883d0a1b2
* calendar.el (calendar-version): Update to 5.1. Fixed a variety
Jim Blandy <jimb@redhat.com>
parents:
3778
diff
changeset
|
2724 If DAY is omitted, it defaults to 1 if N>0, and MONTH's last day otherwise." |
628 | 2725 (calendar-gregorian-from-absolute |
4658
a34bd3ee36ef
(solar-holidays): Use new
Paul Eggert <eggert@twinsun.com>
parents:
4652
diff
changeset
|
2726 (calendar-nth-named-absday n dayname month year day))) |
628 | 2727 |
5694
69471d331d0c
(calendar-version): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5272
diff
changeset
|
2728 (defun calendar-day-of-year-string (&optional date) |
69471d331d0c
(calendar-version): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5272
diff
changeset
|
2729 "String of day number of year of Gregorian DATE. |
69471d331d0c
(calendar-version): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5272
diff
changeset
|
2730 Defaults to today's date if DATE is not given." |
69471d331d0c
(calendar-version): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5272
diff
changeset
|
2731 (let* ((d (or date (calendar-current-date))) |
69471d331d0c
(calendar-version): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5272
diff
changeset
|
2732 (year (extract-calendar-year d)) |
69471d331d0c
(calendar-version): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5272
diff
changeset
|
2733 (day (calendar-day-number d)) |
69471d331d0c
(calendar-version): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5272
diff
changeset
|
2734 (days-remaining (- (calendar-day-number (list 12 31 year)) day))) |
69471d331d0c
(calendar-version): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5272
diff
changeset
|
2735 (format "Day %d of %d; %d day%s remaining in the year" |
69471d331d0c
(calendar-version): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5272
diff
changeset
|
2736 day year days-remaining (if (= days-remaining 1) "" "s")))) |
69471d331d0c
(calendar-version): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5272
diff
changeset
|
2737 |
22261
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2738 (defun calendar-print-other-dates () |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2739 "Show dates on other calendars for date under the cursor." |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2740 (interactive) |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2741 (let* ((date (calendar-cursor-to-date t))) |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2742 (save-excursion |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2743 (set-buffer (get-buffer-create other-calendars-buffer)) |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2744 (setq buffer-read-only nil) |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2745 (calendar-set-mode-line |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2746 (concat (calendar-date-string date) " (Gregorian)")) |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2747 (erase-buffer) |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2748 (insert |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2749 (mapconcat 'identity |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2750 (list (calendar-day-of-year-string date) |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2751 (format "ISO date: %s" (calendar-iso-date-string date)) |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2752 (format "Julian date: %s" |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2753 (calendar-julian-date-string date)) |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2754 (format |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2755 "Astronomical (Julian) day number (at noon UTC): %s.0" |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2756 (calendar-astro-date-string date)) |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2757 (format "Fixed (RD) date: %s" |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2758 (calendar-absolute-from-gregorian date)) |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2759 (format "Hebrew date (before sunset): %s" |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2760 (calendar-hebrew-date-string date)) |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2761 (format "Persian date: %s" |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2762 (calendar-persian-date-string date)) |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2763 (let ((i (calendar-islamic-date-string date))) |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2764 (if (not (string-equal i "")) |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2765 (format "Islamic date (before sunset): %s" i))) |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2766 (format "Chinese date: %s" |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2767 (calendar-chinese-date-string date)) |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2768 (let ((c (calendar-coptic-date-string date))) |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2769 (if (not (string-equal c "")) |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2770 (format "Coptic date: %s" c))) |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2771 (let ((e (calendar-ethiopic-date-string date))) |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2772 (if (not (string-equal e "")) |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2773 (format "Ethiopic date: %s" e))) |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2774 (let ((f (calendar-french-date-string date))) |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2775 (if (not (string-equal f "")) |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2776 (format "French Revolutionary date: %s" f))) |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2777 (format "Mayan date: %s" |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2778 (calendar-mayan-date-string date))) |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2779 "\n")) |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2780 (goto-char (point-min)) |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2781 (set-buffer-modified-p nil) |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2782 (setq buffer-read-only t) |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2783 (display-buffer other-calendars-buffer)))) |
329f546a73ec
Add function to show equivalent date on all available calendars (in parallel
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
22028
diff
changeset
|
2784 |
957 | 2785 (defun calendar-print-day-of-year () |
5694
69471d331d0c
(calendar-version): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5272
diff
changeset
|
2786 "Show day number in year/days remaining in year for date under the cursor." |
628 | 2787 (interactive) |
5829
d266967cc1cc
(calendar-mode-line-format): Change "current" to "today".
Richard M. Stallman <rms@gnu.org>
parents:
5771
diff
changeset
|
2788 (message (calendar-day-of-year-string (calendar-cursor-to-date t)))) |
628 | 2789 |
957 | 2790 (defun calendar-set-mode-line (str) |
2791 "Set mode line to STR, centered, surrounded by dashes." | |
2792 (setq mode-line-format | |
12061
017af11017a0
Fixed calendar-string-spread to allow 0 or 1 string; this simplified several
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
10459
diff
changeset
|
2793 (calendar-string-spread (list str) ?- (frame-width)))) |
957 | 2794 |
13042
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
2795 (defun calendar-mod (m n) |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
2796 "Non-negative remainder of M/N with N instead of 0." |
03ef030c9e75
Many functions moved to other files, some rewritten. See ChangeLog entry.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
12061
diff
changeset
|
2797 (1+ (mod (1- m) n))) |
957 | 2798 |
2799 (run-hooks 'calendar-load-hook) | |
628 | 2800 |
2801 (provide 'calendar) | |
2802 | |
14169 | 2803 ;;; Local variables: |
2804 ;;; byte-compile-dynamic: t | |
2805 ;;; End: | |
2806 | |
675
85fd29f25c75
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
628
diff
changeset
|
2807 ;;; calendar.el ends here |