annotate lisp/calendar/cal-french.el @ 16:0293115a14e9 r19-15b91

Import from CVS: tag r19-15b91
author cvs
date Mon, 13 Aug 2007 08:49:20 +0200
parents 376386a54a3c
children 131b0175ea99
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; cal-french.el --- calendar functions for the French Revolutionary calendar.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;; Copyright (C) 1988, 1989, 1992, 1994 Free Software Foundation, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;; Keywords: calendar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;; Human-Keywords: French Revolutionary calendar, calendar, diary
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;; This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;; XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;; under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;; XEmacs is distributed in the hope that it will be useful, but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;; General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;; You should have received a copy of the GNU General Public License
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
22 ;; along with XEmacs; see the file COPYING. If not, write to the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
24 ;; Boston, MA 02111-1307, USA.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 ;;; Commentary:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ;; This collection of functions implements the features of calendar.el and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 ;; diary.el that deal with the French Revolutionary calendar.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 ;; Technical details of the French Revolutionary calendar can be found in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 ;; ``Calendrical Calculations, Part II: Three Historical Calendars''
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 ;; by E. M. Reingold, N. Dershowitz, and S. M. Clamen,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 ;; Software--Practice and Experience, Volume 23, Number 4 (April, 1993),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 ;; pages 383-404.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 ;; Comments, corrections, and improvements should be sent to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 ;; Edward M. Reingold Department of Computer Science
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 ;; (217) 333-6733 University of Illinois at Urbana-Champaign
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 ;; reingold@cs.uiuc.edu 1304 West Springfield Avenue
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 ;; Urbana, Illinois 61801
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 ;;; Code:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 (require 'calendar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 (defconst french-calendar-month-name-array
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 ["Vende'miaire" "Brumaire" "Frimaire" "Nivo^se" "Pluvio^se" "Vento^se"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 "Germinal" "Flore'al" "Prairial" "Messidor" "Thermidor" "Fructidor"])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 (defconst french-calendar-day-name-array
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 ["Primidi" "Duodi" "Tridi" "Quartidi" "Quintidi" "Sextidi" "Septidi"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 "Octidi" "Nonidi" "Decadi"])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 (defconst french-calendar-special-days-array
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 ["de la Vertu" "du Genie" "du Labour" "de la Raison" "de la Recompense"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 "de la Revolution"])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 (defun french-calendar-leap-year-p (year)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 "True if YEAR is a leap year on the French Revolutionary calendar.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 For Gregorian years 1793 to 1805, the years of actual operation of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 calendar, uses historical practice based on equinoxes is followed (years 3, 7,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 and 11 were leap years; 15 and 20 would have been leap years). For later
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 years uses the proposed rule of Romme (never adopted)--leap years fall every
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 four years except century years not divisible 400 and century years that are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 multiples of 4000."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 (or (memq year '(3 7 11));; Actual practice--based on equinoxes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 (memq year '(15 20)) ;; Anticipated practice--based on equinoxes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 (and (> year 20) ;; Romme's proposal--never adopted
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 (zerop (% year 4))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 (not (memq (% year 400) '(100 200 300)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 (not (zerop (% year 4000))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 (defun french-calendar-last-day-of-month (month year)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 "Return last day of MONTH, YEAR on the French Revolutionary calendar.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 The 13th month is not really a month, but the 5 (6 in leap years) day period of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 `sansculottides' at the end of the year."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 (if (< month 13)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 30
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 (if (french-calendar-leap-year-p year)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 6
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 5)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 (defun calendar-absolute-from-french (date)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 "Compute absolute date from French Revolutionary date DATE.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 The absolute date is the number of days elapsed since the (imaginary)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 Gregorian date Sunday, December 31, 1 BC."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 (let ((month (extract-calendar-month date))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 (day (extract-calendar-day date))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 (year (extract-calendar-year date)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 (+ (* 365 (1- year));; Days in prior years
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 ;; Leap days in prior years
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 (if (< year 20)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 (/ year 4);; Actual and anticipated practice (years 3, 7, 11, 15)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 ;; Romme's proposed rule (using the Principle of Inclusion/Exclusion)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 (+ (/ (1- year) 4);; Luckily, there were 4 leap years before year 20
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 (- (/ (1- year) 100))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 (/ (1- year) 400)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 (- (/ (1- year) 4000))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 (* 30 (1- month));; Days in prior months this year
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 day;; Days so far this month
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 654414)));; Days before start of calendar (September 22, 1792).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 (defun calendar-french-from-absolute (date)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 "Compute the French Revolutionary equivalent for absolute date DATE.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 The result is a list of the form (MONTH DAY YEAR).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 The absolute date is the number of days elapsed since the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 \(imaginary) Gregorian date Sunday, December 31, 1 BC."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 (if (< date 654415)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 (list 0 0 0);; pre-French Revolutionary date
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 (let* ((approx (/ (- date 654414) 366));; Approximation from below.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 (year ;; Search forward from the approximation.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 (+ approx
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 (calendar-sum y approx
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 (>= date (calendar-absolute-from-french (list 1 1 (1+ y))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 (month ;; Search forward from Vendemiaire.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 (1+ (calendar-sum m 1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 (> date
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 (calendar-absolute-from-french
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 (list m
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 (french-calendar-last-day-of-month m year)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 year)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 (day ;; Calculate the day by subtraction.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 (- date
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 (1- (calendar-absolute-from-french (list month 1 year))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 (list month day year))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 (defun calendar-french-date-string (&optional date)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 "String of French Revolutionary date of Gregorian DATE.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 Returns the empty string if DATE is pre-French Revolutionary.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 Defaults to today's date if DATE is not given."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 (let* ((french-date (calendar-french-from-absolute
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 (calendar-absolute-from-gregorian
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 (or date (calendar-current-date)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 (y (extract-calendar-year french-date))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 (m (extract-calendar-month french-date))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 (d (extract-calendar-day french-date)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 ((< y 1) "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 ((= m 13) (format "Jour %s de l'Anne'e %d de la Revolution"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 (aref french-calendar-special-days-array (1- d))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 y))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 (t (format "Decade %s, %s de %s de l'Anne'e %d de la Revolution"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 (make-string (1+ (/ (1- d) 10)) ?I)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 (aref french-calendar-day-name-array (% (1- d) 10))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 (aref french-calendar-month-name-array (1- m))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 y)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 (defun calendar-print-french-date ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 "Show the French Revolutionary calendar equivalent of the selected date."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 (let ((f (calendar-french-date-string (calendar-cursor-to-date t))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 (if (string-equal f "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 (message "Date is pre-French Revolution")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 (message f))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 (defun calendar-goto-french-date (date &optional noecho)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 "Move cursor to French Revolutionary date DATE.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 Echo French Revolutionary date unless NOECHO is t."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 (interactive
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 (let* ((year (calendar-read
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 "Anne'e de la Revolution (>0): "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 '(lambda (x) (> x 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 (int-to-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 (extract-calendar-year
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 (calendar-french-from-absolute
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 (calendar-absolute-from-gregorian
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 (calendar-current-date)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 (month-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 (mapcar 'list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 (append french-calendar-month-name-array
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 (if (french-calendar-leap-year-p year)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 (mapcar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 '(lambda (x) (concat "Jour " x))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 french-calendar-special-days-array)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 (nreverse
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 (cdr;; we don't want rev. day in a non-leap yr.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 (nreverse
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 (mapcar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 '(lambda (x) (concat "Jour " x))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 french-calendar-special-days-array))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 (completion-ignore-case t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 (month (cdr (assoc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 (capitalize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 (completing-read
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 "Mois ou Sansculottide: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 month-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 nil t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 (calendar-make-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 month-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 '(lambda (x) (capitalize (car x)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 (decade (if (> month 12)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 (calendar-read
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 "De'cade (1-3): "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 '(lambda (x) (memq x '(1 2 3))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 (day (if (> month 12)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 (- month 12)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 (calendar-read
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 "Jour (1-10): "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 '(lambda (x) (and (<= 1 x) (<= x 10))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 (month (if (> month 12) 13 month))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 (day (+ day (* 10 (1- decade)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 (list (list month day year))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 (calendar-goto-date (calendar-gregorian-from-absolute
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 (calendar-absolute-from-french date)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 (or noecho (calendar-print-french-date)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 (defun diary-french-date ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 "French calendar equivalent of date diary entry."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 (let ((f (calendar-french-date-string (calendar-cursor-to-date t))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 (if (string-equal f "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 "Date is pre-French Revolution"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 f)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 (provide 'cal-french)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 ;;; cal-french.el ends here