diff options
| author | Richard M. Stallman | 1996-06-28 08:44:25 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-06-28 08:44:25 +0000 |
| commit | 327c8eb2f9a636046ea354d0d7b7851354397127 (patch) | |
| tree | 6db492851bf7f854ae64acf5d8b9189cc900fb41 | |
| parent | 1d08d73314668aa616faba3b1f73df5b797ff499 (diff) | |
| download | emacs-327c8eb2f9a636046ea354d0d7b7851354397127.tar.gz emacs-327c8eb2f9a636046ea354d0d7b7851354397127.zip | |
(french-calendar-accents): New variable.
(french-calendar-month-name-array): Check that variable.
(french-calendar-special-days-array): Likewise.
(calendar-french-date-string): Likewise.
(calendar-goto-french-date): Likewise.
| -rw-r--r-- | lisp/calendar/cal-french.el | 51 |
1 files changed, 35 insertions, 16 deletions
diff --git a/lisp/calendar/cal-french.el b/lisp/calendar/cal-french.el index c11a7cd0bb4..8f68841d229 100644 --- a/lisp/calendar/cal-french.el +++ b/lisp/calendar/cal-french.el | |||
| @@ -29,10 +29,9 @@ | |||
| 29 | ;; diary.el that deal with the French Revolutionary calendar. | 29 | ;; diary.el that deal with the French Revolutionary calendar. |
| 30 | 30 | ||
| 31 | ;; Technical details of the French Revolutionary calendar can be found in | 31 | ;; Technical details of the French Revolutionary calendar can be found in |
| 32 | ;; ``Calendrical Calculations, Part II: Three Historical Calendars'' | 32 | ;; ``Calendrical Calculations, Part II: Three Historical Calendars'' by |
| 33 | ;; by E. M. Reingold, N. Dershowitz, and S. M. Clamen, | 33 | ;; E. M. Reingold, N. Dershowitz, and S. M. Clamen, Software--Practice and |
| 34 | ;; Software--Practice and Experience, Volume 23, Number 4 (April, 1993), | 34 | ;; Experience, Volume 23, Number 4 (April, 1993), pages 383-404. |
| 35 | ;; pages 383-404. | ||
| 36 | 35 | ||
| 37 | ;; Comments, corrections, and improvements should be sent to | 36 | ;; Comments, corrections, and improvements should be sent to |
| 38 | ;; Edward M. Reingold Department of Computer Science | 37 | ;; Edward M. Reingold Department of Computer Science |
| @@ -44,20 +43,31 @@ | |||
| 44 | 43 | ||
| 45 | (require 'calendar) | 44 | (require 'calendar) |
| 46 | 45 | ||
| 46 | (defvar french-calendar-accents | ||
| 47 | (and (char-table-p standard-display-table) | ||
| 48 | (equal (aref standard-display-table 161) [161])) | ||
| 49 | "True if diacritical marks are available.") | ||
| 50 | |||
| 47 | (defconst french-calendar-epoch (calendar-absolute-from-gregorian '(9 22 1792)) | 51 | (defconst french-calendar-epoch (calendar-absolute-from-gregorian '(9 22 1792)) |
| 48 | "Absolute date of start of French Revolutionary calendar = September 22, 1792.") | 52 | "Absolute date of start of French Revolutionary calendar = September 22, 1792.") |
| 49 | 53 | ||
| 50 | (defconst french-calendar-month-name-array | 54 | (defconst french-calendar-month-name-array |
| 51 | ["Vende'miaire" "Brumaire" "Frimaire" "Nivo^se" "Pluvio^se" "Vento^se" | 55 | (if french-calendar-accents |
| 52 | "Germinal" "Flore'al" "Prairial" "Messidor" "Thermidor" "Fructidor"]) | 56 | ["Vendémiaire" "Brumaire" "Frimaire" "Nivôse" "Pluviôse" "Ventôse" |
| 57 | "Germinal" "Floréal" "Prairial" "Messidor" "Thermidor" "Fructidor"] | ||
| 58 | ["Vende'miaire" "Brumaire" "Frimaire" "Nivo^se" "Pluvio^se" "Vento^se" | ||
| 59 | "Germinal" "Flore'al" "Prairial" "Messidor" "Thermidor" "Fructidor"])) | ||
| 53 | 60 | ||
| 54 | (defconst french-calendar-day-name-array | 61 | (defconst french-calendar-day-name-array |
| 55 | ["Primidi" "Duodi" "Tridi" "Quartidi" "Quintidi" "Sextidi" "Septidi" | 62 | ["Primidi" "Duodi" "Tridi" "Quartidi" "Quintidi" "Sextidi" "Septidi" |
| 56 | "Octidi" "Nonidi" "Decadi"]) | 63 | "Octidi" "Nonidi" "Decadi"]) |
| 57 | 64 | ||
| 58 | (defconst french-calendar-special-days-array | 65 | (defconst french-calendar-special-days-array |
| 59 | ["de la Vertu" "du Genie" "du Labour" "de la Raison" "de la Re'compense" | 66 | (if french-calendar-accents |
| 60 | "de la Re'volution"]) | 67 | ["de la Vertu" "du Genie" "du Labour" "de la Raison" |
| 68 | "de la Récompense" "de la Révolution"] | ||
| 69 | ["de la Vertu" "du Genie" "du Labour" "de la Raison" "de la Re'compense" | ||
| 70 | "de la Re'volution"])) | ||
| 61 | 71 | ||
| 62 | (defun french-calendar-leap-year-p (year) | 72 | (defun french-calendar-leap-year-p (year) |
| 63 | "True if YEAR is a leap year on the French Revolutionary calendar. | 73 | "True if YEAR is a leap year on the French Revolutionary calendar. |
| @@ -143,14 +153,19 @@ Defaults to today's date if DATE is not given." | |||
| 143 | (d (extract-calendar-day french-date))) | 153 | (d (extract-calendar-day french-date))) |
| 144 | (cond | 154 | (cond |
| 145 | ((< y 1) "") | 155 | ((< y 1) "") |
| 146 | ((= m 13) (format "Jour %s de l'Anne'e %d de la Re'volution" | 156 | ((= m 13) (format (if french-calendar-accents |
| 157 | "Jour %s de l'Année %d de la Révolution" | ||
| 158 | "Jour %s de l'Anne'e %d de la Re'volution") | ||
| 147 | (aref french-calendar-special-days-array (1- d)) | 159 | (aref french-calendar-special-days-array (1- d)) |
| 148 | y)) | 160 | y)) |
| 149 | (t (format "De'cade %s, %s de %s de l'Anne'e %d de la Re'volution" | 161 | (t (format |
| 150 | (make-string (1+ (/ (1- d) 10)) ?I) | 162 | (if french-calendar-accents |
| 151 | (aref french-calendar-day-name-array (% (1- d) 10)) | 163 | "Décade %s, %s de %s de l'Année %d de la Révolution" |
| 152 | (aref french-calendar-month-name-array (1- m)) | 164 | "De'cade %s, %s de %s de l'Anne'e %d de la Re'volution") |
| 153 | y))))) | 165 | (make-string (1+ (/ (1- d) 10)) ?I) |
| 166 | (aref french-calendar-day-name-array (% (1- d) 10)) | ||
| 167 | (aref french-calendar-month-name-array (1- m)) | ||
| 168 | y))))) | ||
| 154 | 169 | ||
| 155 | (defun calendar-print-french-date () | 170 | (defun calendar-print-french-date () |
| 156 | "Show the French Revolutionary calendar equivalent of the selected date." | 171 | "Show the French Revolutionary calendar equivalent of the selected date." |
| @@ -165,7 +180,9 @@ Defaults to today's date if DATE is not given." | |||
| 165 | Echo French Revolutionary date unless NOECHO is t." | 180 | Echo French Revolutionary date unless NOECHO is t." |
| 166 | (interactive | 181 | (interactive |
| 167 | (let* ((year (calendar-read | 182 | (let* ((year (calendar-read |
| 168 | "Anne'e de la Re'volution (>0): " | 183 | (if french-calendar-accents |
| 184 | "Année de la Révolution (>0): " | ||
| 185 | "Anne'e de la Re'volution (>0): ") | ||
| 169 | '(lambda (x) (> x 0)) | 186 | '(lambda (x) (> x 0)) |
| 170 | (int-to-string | 187 | (int-to-string |
| 171 | (extract-calendar-year | 188 | (extract-calendar-year |
| @@ -199,7 +216,9 @@ Echo French Revolutionary date unless NOECHO is t." | |||
| 199 | (decade (if (> month 12) | 216 | (decade (if (> month 12) |
| 200 | 1 | 217 | 1 |
| 201 | (calendar-read | 218 | (calendar-read |
| 202 | "De'cade (1-3): " | 219 | (if french-calendar-accents |
| 220 | "Décade (1-3): " | ||
| 221 | "De'cade (1-3): ") | ||
| 203 | '(lambda (x) (memq x '(1 2 3)))))) | 222 | '(lambda (x) (memq x '(1 2 3)))))) |
| 204 | (day (if (> month 12) | 223 | (day (if (> month 12) |
| 205 | (- month 12) | 224 | (- month 12) |