Mercurial > emacs
annotate lisp/calendar/cal-french.el @ 109559:4325622babca
Remove declarations and unused variables.
* src/term.c (Qspace, QCalign_to, QCwidth): Remove declarations.
(encode_terminal_code, produce_composite_glyph): Remove unused variables.
(set_tty_color_mode, term_mouse_highlight, term_get_fkeys): Remove
local extern declarations.
author | Dan Nicolaescu <dann@ics.uci.edu> |
---|---|
date | Mon, 26 Jul 2010 21:20:51 -0700 |
parents | 1de48da1419b |
children | 280c8ae2476d |
rev | line source |
---|---|
38422
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
28781
diff
changeset
|
1 ;;; cal-french.el --- calendar functions for the French Revolutionary calendar |
957 | 2 |
67465
a55ee709ec8d
Update copyright pending Emacs 22.
Glenn Morris <rgm@gnu.org>
parents:
65145
diff
changeset
|
3 ;; Copyright (C) 1988, 1989, 1992, 1994, 1995, 1997, 2001, 2002, 2003, |
107406
1de48da1419b
* calendar/cal-french.el: Convert to utf-8.
Glenn Morris <rgm@gnu.org>
parents:
106815
diff
changeset
|
4 ;; 2004, 2005, 2006, 2007, 2008, 2009, 2010 |
1de48da1419b
* calendar/cal-french.el: Convert to utf-8.
Glenn Morris <rgm@gnu.org>
parents:
106815
diff
changeset
|
5 ;; Free Software Foundation, Inc. |
957 | 6 |
7 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> | |
67465
a55ee709ec8d
Update copyright pending Emacs 22.
Glenn Morris <rgm@gnu.org>
parents:
65145
diff
changeset
|
8 ;; Maintainer: Glenn Morris <rgm@gnu.org> |
2247
2c7997f249eb
Add or correct keywords
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1338
diff
changeset
|
9 ;; Keywords: calendar |
2c7997f249eb
Add or correct keywords
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
1338
diff
changeset
|
10 ;; Human-Keywords: French Revolutionary calendar, calendar, diary |
957 | 11 |
12 ;; This file is part of GNU Emacs. | |
13 | |
94653
e49abd957e81
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93844
diff
changeset
|
14 ;; GNU Emacs is free software: you can redistribute it and/or modify |
6736
3e1323443b1a
Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents:
5833
diff
changeset
|
15 ;; it under the terms of the GNU General Public License as published by |
94653
e49abd957e81
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93844
diff
changeset
|
16 ;; the Free Software Foundation, either version 3 of the License, or |
e49abd957e81
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93844
diff
changeset
|
17 ;; (at your option) any later version. |
957 | 18 |
6736
3e1323443b1a
Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents:
5833
diff
changeset
|
19 ;; GNU Emacs is distributed in the hope that it will be useful, |
3e1323443b1a
Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents:
5833
diff
changeset
|
20 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
3e1323443b1a
Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents:
5833
diff
changeset
|
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3e1323443b1a
Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents:
5833
diff
changeset
|
22 ;; GNU General Public License for more details. |
3e1323443b1a
Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents:
5833
diff
changeset
|
23 |
3e1323443b1a
Fix copying conditions for current GPL version.
Richard M. Stallman <rms@gnu.org>
parents:
5833
diff
changeset
|
24 ;; You should have received a copy of the GNU General Public License |
94653
e49abd957e81
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93844
diff
changeset
|
25 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
957 | 26 |
27 ;;; Commentary: | |
28 | |
93480
2aa65ff3876d
(Commentary): Point to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
92964
diff
changeset
|
29 ;; See calendar.el. |
957 | 30 |
31 ;;; Code: | |
32 | |
33 (require 'calendar) | |
34 | |
93717
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
35 (defconst calendar-french-epoch (calendar-absolute-from-gregorian '(9 22 1792)) |
92905
0cea6abac18e
(french-calendar-accents): Move definition after constants.
Glenn Morris <rgm@gnu.org>
parents:
92851
diff
changeset
|
36 "Absolute date of start of French Revolutionary calendar = Sept 22, 1792.") |
0cea6abac18e
(french-calendar-accents): Move definition after constants.
Glenn Morris <rgm@gnu.org>
parents:
92851
diff
changeset
|
37 |
93717
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
38 (defconst calendar-french-month-name-array |
92905
0cea6abac18e
(french-calendar-accents): Move definition after constants.
Glenn Morris <rgm@gnu.org>
parents:
92851
diff
changeset
|
39 ["Vende'miaire" "Brumaire" "Frimaire" "Nivo^se" "Pluvio^se" "Vento^se" |
0cea6abac18e
(french-calendar-accents): Move definition after constants.
Glenn Morris <rgm@gnu.org>
parents:
92851
diff
changeset
|
40 "Germinal" "Flore'al" "Prairial" "Messidor" "Thermidor" "Fructidor"] |
0cea6abac18e
(french-calendar-accents): Move definition after constants.
Glenn Morris <rgm@gnu.org>
parents:
92851
diff
changeset
|
41 "Array of month names in the French calendar.") |
0cea6abac18e
(french-calendar-accents): Move definition after constants.
Glenn Morris <rgm@gnu.org>
parents:
92851
diff
changeset
|
42 |
93717
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
43 (defconst calendar-french-multibyte-month-name-array |
107406
1de48da1419b
* calendar/cal-french.el: Convert to utf-8.
Glenn Morris <rgm@gnu.org>
parents:
106815
diff
changeset
|
44 ["Vendémiaire" "Brumaire" "Frimaire" "Nivôse" "Pluviôse" "Ventôse" |
1de48da1419b
* calendar/cal-french.el: Convert to utf-8.
Glenn Morris <rgm@gnu.org>
parents:
106815
diff
changeset
|
45 "Germinal" "Floréal" "Prairial" "Messidor" "Thermidor" "Fructidor"] |
92905
0cea6abac18e
(french-calendar-accents): Move definition after constants.
Glenn Morris <rgm@gnu.org>
parents:
92851
diff
changeset
|
46 "Array of multibyte month names in the French calendar.") |
0cea6abac18e
(french-calendar-accents): Move definition after constants.
Glenn Morris <rgm@gnu.org>
parents:
92851
diff
changeset
|
47 |
93717
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
48 (defconst calendar-french-day-name-array |
92905
0cea6abac18e
(french-calendar-accents): Move definition after constants.
Glenn Morris <rgm@gnu.org>
parents:
92851
diff
changeset
|
49 ["Primidi" "Duodi" "Tridi" "Quartidi" "Quintidi" "Sextidi" "Septidi" |
0cea6abac18e
(french-calendar-accents): Move definition after constants.
Glenn Morris <rgm@gnu.org>
parents:
92851
diff
changeset
|
50 "Octidi" "Nonidi" "Decadi"] |
0cea6abac18e
(french-calendar-accents): Move definition after constants.
Glenn Morris <rgm@gnu.org>
parents:
92851
diff
changeset
|
51 "Array of day names in the French calendar.") |
0cea6abac18e
(french-calendar-accents): Move definition after constants.
Glenn Morris <rgm@gnu.org>
parents:
92851
diff
changeset
|
52 |
93717
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
53 (defconst calendar-french-special-days-array |
92905
0cea6abac18e
(french-calendar-accents): Move definition after constants.
Glenn Morris <rgm@gnu.org>
parents:
92851
diff
changeset
|
54 ["de la Vertu" "du Ge'nie" "du Travail" "de la Raison" "des Re'compenses" |
0cea6abac18e
(french-calendar-accents): Move definition after constants.
Glenn Morris <rgm@gnu.org>
parents:
92851
diff
changeset
|
55 "de la Re'volution"] |
0cea6abac18e
(french-calendar-accents): Move definition after constants.
Glenn Morris <rgm@gnu.org>
parents:
92851
diff
changeset
|
56 "Array of special day names in the French calendar.") |
0cea6abac18e
(french-calendar-accents): Move definition after constants.
Glenn Morris <rgm@gnu.org>
parents:
92851
diff
changeset
|
57 |
93717
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
58 (defconst calendar-french-multibyte-special-days-array |
107406
1de48da1419b
* calendar/cal-french.el: Convert to utf-8.
Glenn Morris <rgm@gnu.org>
parents:
106815
diff
changeset
|
59 ["de la Vertu" "du Génie" "du Travail" "de la Raison" "des Récompenses" |
1de48da1419b
* calendar/cal-french.el: Convert to utf-8.
Glenn Morris <rgm@gnu.org>
parents:
106815
diff
changeset
|
60 "de la Révolution"] |
92905
0cea6abac18e
(french-calendar-accents): Move definition after constants.
Glenn Morris <rgm@gnu.org>
parents:
92851
diff
changeset
|
61 "Array of multibyte special day names in the French calendar.") |
0cea6abac18e
(french-calendar-accents): Move definition after constants.
Glenn Morris <rgm@gnu.org>
parents:
92851
diff
changeset
|
62 |
93717
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
63 (defun calendar-french-accents-p () |
92964
943c6058b43a
(french-calendar-accents): Doc fix.
Glenn Morris <rgm@gnu.org>
parents:
92905
diff
changeset
|
64 "Return non-nil if diacritical marks are available." |
19885
266e93ddaf0e
(french-calendar-accents): Change variable to function.
Richard M. Stallman <rms@gnu.org>
parents:
17570
diff
changeset
|
65 (and (or window-system |
92851 | 66 (terminal-coding-system)) |
19885
266e93ddaf0e
(french-calendar-accents): Change variable to function.
Richard M. Stallman <rms@gnu.org>
parents:
17570
diff
changeset
|
67 (or enable-multibyte-characters |
92851 | 68 (and (char-table-p standard-display-table) |
69 (equal (aref standard-display-table 161) [161]))))) | |
15550
4df6e0ffab90
(french-calendar-accents): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
70 |
93717
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
71 (defun calendar-french-month-name-array () |
92629
3d76a52b916c
(french-calendar-month-name-array)
Glenn Morris <rgm@gnu.org>
parents:
92628
diff
changeset
|
72 "Return the array of month names, depending on whether accents are available." |
93717
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
73 (if (calendar-french-accents-p) |
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
74 calendar-french-multibyte-month-name-array |
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
75 calendar-french-month-name-array)) |
20474
2ff24b456bb7
(calendar-french-single-byteify): New function.
Richard M. Stallman <rms@gnu.org>
parents:
20462
diff
changeset
|
76 |
93717
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
77 (defun calendar-french-day-name-array () |
92629
3d76a52b916c
(french-calendar-month-name-array)
Glenn Morris <rgm@gnu.org>
parents:
92628
diff
changeset
|
78 "Return the array of day names." |
93717
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
79 calendar-french-day-name-array) |
20474
2ff24b456bb7
(calendar-french-single-byteify): New function.
Richard M. Stallman <rms@gnu.org>
parents:
20462
diff
changeset
|
80 |
93717
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
81 (defun calendar-french-special-days-array () |
92629
3d76a52b916c
(french-calendar-month-name-array)
Glenn Morris <rgm@gnu.org>
parents:
92628
diff
changeset
|
82 "Return the special day names, depending on whether accents are available." |
93717
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
83 (if (calendar-french-accents-p) |
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
84 calendar-french-multibyte-special-days-array |
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
85 calendar-french-special-days-array)) |
20393
6f1b751fc31d
(french-calendar-special-days-array): New function.
Karl Heuer <kwzh@gnu.org>
parents:
20245
diff
changeset
|
86 |
93717
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
87 (defun calendar-french-leap-year-p (year) |
957 | 88 "True if YEAR is a leap year on the French Revolutionary calendar. |
89 For Gregorian years 1793 to 1805, the years of actual operation of the | |
19885
266e93ddaf0e
(french-calendar-accents): Change variable to function.
Richard M. Stallman <rms@gnu.org>
parents:
17570
diff
changeset
|
90 calendar, follows historical practice based on equinoxes (years 3, 7, |
957 | 91 and 11 were leap years; 15 and 20 would have been leap years). For later |
92 years uses the proposed rule of Romme (never adopted)--leap years fall every | |
93 four years except century years not divisible 400 and century years that are | |
94 multiples of 4000." | |
92628 | 95 (or (memq year '(3 7 11)) ; actual practice--based on equinoxes |
96 (memq year '(15 20)) ; anticipated practice--based on equinoxes | |
97 (and (> year 20) ; Romme's proposal--never adopted | |
957 | 98 (zerop (% year 4)) |
99 (not (memq (% year 400) '(100 200 300))) | |
100 (not (zerop (% year 4000)))))) | |
101 | |
93717
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
102 (defun calendar-french-last-day-of-month (month year) |
1338 | 103 "Return last day of MONTH, YEAR on the French Revolutionary calendar. |
957 | 104 The 13th month is not really a month, but the 5 (6 in leap years) day period of |
105 `sansculottides' at the end of the year." | |
106 (if (< month 13) | |
107 30 | |
93717
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
108 (if (calendar-french-leap-year-p year) |
957 | 109 6 |
110 5))) | |
111 | |
93717
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
112 (defun calendar-french-to-absolute (date) |
1338 | 113 "Compute absolute date from French Revolutionary date DATE. |
957 | 114 The absolute date is the number of days elapsed since the (imaginary) |
115 Gregorian date Sunday, December 31, 1 BC." | |
93809
3ff2b47de8f2
Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents:
93781
diff
changeset
|
116 (let ((month (calendar-extract-month date)) |
3ff2b47de8f2
Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents:
93781
diff
changeset
|
117 (day (calendar-extract-day date)) |
3ff2b47de8f2
Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents:
93781
diff
changeset
|
118 (year (calendar-extract-year date))) |
92628 | 119 (+ (* 365 (1- year)) ; days in prior years |
120 ;; Leap days in prior years. | |
957 | 121 (if (< year 20) |
92628 | 122 (/ year 4) ; actual and anticipated practice (years 3, 7, 11, 15) |
123 ;; Romme's proposed rule (using the Principle of Inclusion/Exclusion). | |
124 (+ (/ (1- year) 4) ; luckily, there were 4 leap years before year 20 | |
957 | 125 (- (/ (1- year) 100)) |
126 (/ (1- year) 400) | |
127 (- (/ (1- year) 4000)))) | |
92628 | 128 (* 30 (1- month)) ; days in prior months this year |
129 day ; days so far this month | |
93717
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
130 (1- calendar-french-epoch)))) ; days before start of calendar |
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
131 |
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
132 (define-obsolete-function-alias 'calendar-absolute-from-french |
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
133 'calendar-french-to-absolute "23.1") |
957 | 134 |
135 (defun calendar-french-from-absolute (date) | |
1338 | 136 "Compute the French Revolutionary equivalent for absolute date DATE. |
137 The result is a list of the form (MONTH DAY YEAR). | |
138 The absolute date is the number of days elapsed since the | |
7639 | 139 \(imaginary) Gregorian date Sunday, December 31, 1 BC." |
93717
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
140 (if (< date calendar-french-epoch) |
92628 | 141 (list 0 0 0) ; pre-French Revolutionary date |
142 (let* ((approx ; approximation from below | |
93717
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
143 (/ (- date calendar-french-epoch) 366)) |
92628 | 144 (year ; search forward from the approximation |
957 | 145 (+ approx |
146 (calendar-sum y approx | |
93717
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
147 (>= date (calendar-french-to-absolute |
92851 | 148 (list 1 1 (1+ y)))) |
149 1))) | |
92628 | 150 (month ; search forward from Vendemiaire |
957 | 151 (1+ (calendar-sum m 1 |
92851 | 152 (> date |
93717
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
153 (calendar-french-to-absolute |
92851 | 154 (list m |
93717
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
155 (calendar-french-last-day-of-month |
92851 | 156 m year) |
157 year))) | |
158 1))) | |
92628 | 159 (day ; calculate the day by subtraction |
957 | 160 (- date |
93717
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
161 (1- (calendar-french-to-absolute (list month 1 year)))))) |
92851 | 162 (list month day year)))) |
957 | 163 |
92829
8777b384ba72
(generated-autoload-file): Don't set, instead use different values of
Glenn Morris <rgm@gnu.org>
parents:
92629
diff
changeset
|
164 ;;;###cal-autoload |
5699
a2d78b648542
(calendar-french-date-string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5416
diff
changeset
|
165 (defun calendar-french-date-string (&optional date) |
a2d78b648542
(calendar-french-date-string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5416
diff
changeset
|
166 "String of French Revolutionary date of Gregorian DATE. |
a2d78b648542
(calendar-french-date-string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5416
diff
changeset
|
167 Returns the empty string if DATE is pre-French Revolutionary. |
a2d78b648542
(calendar-french-date-string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5416
diff
changeset
|
168 Defaults to today's date if DATE is not given." |
957 | 169 (let* ((french-date (calendar-french-from-absolute |
170 (calendar-absolute-from-gregorian | |
5699
a2d78b648542
(calendar-french-date-string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5416
diff
changeset
|
171 (or date (calendar-current-date))))) |
93809
3ff2b47de8f2
Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents:
93781
diff
changeset
|
172 (y (calendar-extract-year french-date)) |
3ff2b47de8f2
Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents:
93781
diff
changeset
|
173 (m (calendar-extract-month french-date)) |
3ff2b47de8f2
Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents:
93781
diff
changeset
|
174 (d (calendar-extract-day french-date))) |
5699
a2d78b648542
(calendar-french-date-string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5416
diff
changeset
|
175 (cond |
a2d78b648542
(calendar-french-date-string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5416
diff
changeset
|
176 ((< y 1) "") |
93717
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
177 ((= m 13) (format (if (calendar-french-accents-p) |
107406
1de48da1419b
* calendar/cal-french.el: Convert to utf-8.
Glenn Morris <rgm@gnu.org>
parents:
106815
diff
changeset
|
178 "Jour %s de l'Année %d de la Révolution" |
15550
4df6e0ffab90
(french-calendar-accents): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
179 "Jour %s de l'Anne'e %d de la Re'volution") |
93717
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
180 (aref (calendar-french-special-days-array) (1- d)) |
5699
a2d78b648542
(calendar-french-date-string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5416
diff
changeset
|
181 y)) |
15550
4df6e0ffab90
(french-calendar-accents): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
182 (t (format |
93717
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
183 (if (calendar-french-accents-p) |
107406
1de48da1419b
* calendar/cal-french.el: Convert to utf-8.
Glenn Morris <rgm@gnu.org>
parents:
106815
diff
changeset
|
184 "%d %s an %d de la Révolution" |
28781
dc2a0cf401ab
(french-calendar-multibyte-special-days-array)
Gerd Moellmann <gerd@gnu.org>
parents:
24191
diff
changeset
|
185 "%d %s an %d de la Re'volution") |
dc2a0cf401ab
(french-calendar-multibyte-special-days-array)
Gerd Moellmann <gerd@gnu.org>
parents:
24191
diff
changeset
|
186 d |
93717
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
187 (aref (calendar-french-month-name-array) (1- m)) |
15550
4df6e0ffab90
(french-calendar-accents): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
188 y))))) |
5699
a2d78b648542
(calendar-french-date-string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5416
diff
changeset
|
189 |
92829
8777b384ba72
(generated-autoload-file): Don't set, instead use different values of
Glenn Morris <rgm@gnu.org>
parents:
92629
diff
changeset
|
190 ;;;###cal-autoload |
93717
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
191 (defun calendar-french-print-date () |
5699
a2d78b648542
(calendar-french-date-string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5416
diff
changeset
|
192 "Show the French Revolutionary calendar equivalent of the selected date." |
a2d78b648542
(calendar-french-date-string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5416
diff
changeset
|
193 (interactive) |
20763
129b8b78151c
(calendar-french-single-byteify): Function deleted.
Richard M. Stallman <rms@gnu.org>
parents:
20474
diff
changeset
|
194 (let ((f (calendar-french-date-string (calendar-cursor-to-date t)))) |
5699
a2d78b648542
(calendar-french-date-string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5416
diff
changeset
|
195 (if (string-equal f "") |
957 | 196 (message "Date is pre-French Revolution") |
17570
daaffe2dece5
(calendar-print-french-date): Label French date in echo area.
Richard M. Stallman <rms@gnu.org>
parents:
17381
diff
changeset
|
197 (message "French Revolutionary date: %s" f)))) |
957 | 198 |
93717
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
199 (define-obsolete-function-alias 'calendar-print-french-date |
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
200 'calendar-french-print-date "23.1") |
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
201 |
92829
8777b384ba72
(generated-autoload-file): Don't set, instead use different values of
Glenn Morris <rgm@gnu.org>
parents:
92629
diff
changeset
|
202 ;;;###cal-autoload |
93717
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
203 (defun calendar-french-goto-date (date &optional noecho) |
1338 | 204 "Move cursor to French Revolutionary date DATE. |
92905
0cea6abac18e
(french-calendar-accents): Move definition after constants.
Glenn Morris <rgm@gnu.org>
parents:
92851
diff
changeset
|
205 Echo French Revolutionary date unless NOECHO is non-nil." |
957 | 206 (interactive |
93717
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
207 (let* ((months (calendar-french-month-name-array)) |
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
208 (special-days (calendar-french-special-days-array)) |
93480
2aa65ff3876d
(Commentary): Point to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
92964
diff
changeset
|
209 (year (progn |
2aa65ff3876d
(Commentary): Point to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
92964
diff
changeset
|
210 (calendar-read |
93717
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
211 (if (calendar-french-accents-p) |
107406
1de48da1419b
* calendar/cal-french.el: Convert to utf-8.
Glenn Morris <rgm@gnu.org>
parents:
106815
diff
changeset
|
212 "Année de la Révolution (>0): " |
93480
2aa65ff3876d
(Commentary): Point to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
92964
diff
changeset
|
213 "Anne'e de la Re'volution (>0): ") |
2aa65ff3876d
(Commentary): Point to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
92964
diff
changeset
|
214 (lambda (x) (> x 0)) |
93844
bf9ef749c23e
Replace int-to-string with number-to-string.
Glenn Morris <rgm@gnu.org>
parents:
93809
diff
changeset
|
215 (number-to-string |
93809
3ff2b47de8f2
Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents:
93781
diff
changeset
|
216 (calendar-extract-year |
93480
2aa65ff3876d
(Commentary): Point to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
92964
diff
changeset
|
217 (calendar-french-from-absolute |
2aa65ff3876d
(Commentary): Point to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
92964
diff
changeset
|
218 (calendar-absolute-from-gregorian |
2aa65ff3876d
(Commentary): Point to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
92964
diff
changeset
|
219 (calendar-current-date)))))))) |
2aa65ff3876d
(Commentary): Point to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
92964
diff
changeset
|
220 (month-list |
2aa65ff3876d
(Commentary): Point to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
92964
diff
changeset
|
221 (mapcar 'list |
2aa65ff3876d
(Commentary): Point to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
92964
diff
changeset
|
222 (append months |
93717
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
223 (if (calendar-french-leap-year-p year) |
93480
2aa65ff3876d
(Commentary): Point to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
92964
diff
changeset
|
224 (mapcar |
2aa65ff3876d
(Commentary): Point to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
92964
diff
changeset
|
225 (lambda (x) (concat "Jour " x)) |
93717
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
226 calendar-french-special-days-array) |
93480
2aa65ff3876d
(Commentary): Point to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
92964
diff
changeset
|
227 (reverse |
2aa65ff3876d
(Commentary): Point to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
92964
diff
changeset
|
228 (cdr ; we don't want rev. day in a non-leap yr |
92851 | 229 (reverse |
93480
2aa65ff3876d
(Commentary): Point to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
92964
diff
changeset
|
230 (mapcar |
2aa65ff3876d
(Commentary): Point to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
92964
diff
changeset
|
231 (lambda (x) |
2aa65ff3876d
(Commentary): Point to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
92964
diff
changeset
|
232 (concat "Jour " x)) |
2aa65ff3876d
(Commentary): Point to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
92964
diff
changeset
|
233 special-days)))))))) |
2aa65ff3876d
(Commentary): Point to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
92964
diff
changeset
|
234 (completion-ignore-case t) |
2aa65ff3876d
(Commentary): Point to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
92964
diff
changeset
|
235 (month (cdr (assoc-string |
2aa65ff3876d
(Commentary): Point to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
92964
diff
changeset
|
236 (completing-read |
2aa65ff3876d
(Commentary): Point to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
92964
diff
changeset
|
237 "Mois ou Sansculottide: " |
2aa65ff3876d
(Commentary): Point to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
92964
diff
changeset
|
238 month-list |
2aa65ff3876d
(Commentary): Point to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
92964
diff
changeset
|
239 nil t) |
2aa65ff3876d
(Commentary): Point to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
92964
diff
changeset
|
240 (calendar-make-alist month-list 1 'car) t))) |
2aa65ff3876d
(Commentary): Point to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
92964
diff
changeset
|
241 (day (if (> month 12) |
2aa65ff3876d
(Commentary): Point to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
92964
diff
changeset
|
242 (- month 12) |
2aa65ff3876d
(Commentary): Point to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
92964
diff
changeset
|
243 (calendar-read |
2aa65ff3876d
(Commentary): Point to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
92964
diff
changeset
|
244 "Jour (1-30): " |
2aa65ff3876d
(Commentary): Point to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
92964
diff
changeset
|
245 (lambda (x) (and (<= 1 x) (<= x 30)))))) |
2aa65ff3876d
(Commentary): Point to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
92964
diff
changeset
|
246 (month (if (> month 12) 13 month))) |
2aa65ff3876d
(Commentary): Point to calendar.el.
Glenn Morris <rgm@gnu.org>
parents:
92964
diff
changeset
|
247 (list (list month day year)))) |
957 | 248 (calendar-goto-date (calendar-gregorian-from-absolute |
93717
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
249 (calendar-french-to-absolute date))) |
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
250 (or noecho (calendar-french-print-date))) |
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
251 |
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
252 (define-obsolete-function-alias 'calendar-goto-french-date |
73275d7e89b7
(calendar-french-epoch): Rename french-calendar-epoch. Update callers.
Glenn Morris <rgm@gnu.org>
parents:
93480
diff
changeset
|
253 'calendar-french-goto-date "23.1") |
957 | 254 |
92612 | 255 (defvar date) |
256 | |
93781 | 257 ;; To be called from diary-list-sexp-entries, where DATE is bound. |
92829
8777b384ba72
(generated-autoload-file): Don't set, instead use different values of
Glenn Morris <rgm@gnu.org>
parents:
92629
diff
changeset
|
258 ;;;###diary-autoload |
957 | 259 (defun diary-french-date () |
260 "French calendar equivalent of date diary entry." | |
17381
d1fc8a2d353f
(diary-french-date): Use `date'.
Richard M. Stallman <rms@gnu.org>
parents:
15550
diff
changeset
|
261 (let ((f (calendar-french-date-string date))) |
5699
a2d78b648542
(calendar-french-date-string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5416
diff
changeset
|
262 (if (string-equal f "") |
a2d78b648542
(calendar-french-date-string): New function.
Richard M. Stallman <rms@gnu.org>
parents:
5416
diff
changeset
|
263 "Date is pre-French Revolution" |
17381
d1fc8a2d353f
(diary-french-date): Use `date'.
Richard M. Stallman <rms@gnu.org>
parents:
15550
diff
changeset
|
264 (format "French Revolutionary date: %s" f)))) |
957 | 265 |
266 (provide 'cal-french) | |
267 | |
107406
1de48da1419b
* calendar/cal-french.el: Convert to utf-8.
Glenn Morris <rgm@gnu.org>
parents:
106815
diff
changeset
|
268 ;; Local Variables: |
1de48da1419b
* calendar/cal-french.el: Convert to utf-8.
Glenn Morris <rgm@gnu.org>
parents:
106815
diff
changeset
|
269 ;; coding: utf-8 |
1de48da1419b
* calendar/cal-french.el: Convert to utf-8.
Glenn Morris <rgm@gnu.org>
parents:
106815
diff
changeset
|
270 ;; End: |
1de48da1419b
* calendar/cal-french.el: Convert to utf-8.
Glenn Morris <rgm@gnu.org>
parents:
106815
diff
changeset
|
271 |
92582
68c1d9ecc30d
Unquote lambda functions. Add autoload cookies to functions formerly
Glenn Morris <rgm@gnu.org>
parents:
79703
diff
changeset
|
272 ;; arch-tag: 7e8045a3-8609-46b5-9cde-cf40ce541cf9 |
957 | 273 ;;; cal-french.el ends here |