Commit 0f65baa0 authored by Stefan Monnier's avatar Stefan Monnier

* lisp/calendar/cal-french.el (calendar-french-accents-p): Obsolete function

Always assume accented letters can be used

(calendar-french-month-name-array)
(calendar-french-special-days-array): Use the accented names.
(calendar-french-multibyte-month-name-array)
(calendar-french-multibyte-special-days-array): Make those vars
obsolete aliases.
(calendar-french-month-name-array, calendar-french-day-name-array)
(calendar-french-special-days-array): Mark functions as obsolete.
(calendar-french-date-string, calendar-french-goto-date): Always use
the text with accents.
parent d8a9828b
...@@ -35,54 +35,45 @@ ...@@ -35,54 +35,45 @@
(defconst calendar-french-epoch (calendar-absolute-from-gregorian '(9 22 1792)) (defconst calendar-french-epoch (calendar-absolute-from-gregorian '(9 22 1792))
"Absolute date of start of French Revolutionary calendar = Sept 22, 1792.") "Absolute date of start of French Revolutionary calendar = Sept 22, 1792.")
(defconst calendar-french-month-name-array (define-obsolete-variable-alias 'calendar-french-multibyte-month-name-array
["Vende'miaire" "Brumaire" "Frimaire" "Nivo^se" "Pluvio^se" "Vento^se" 'calendar-french-month-name-array "28.1")
"Germinal" "Flore'al" "Prairial" "Messidor" "Thermidor" "Fructidor"]
"Array of month names in the French calendar.")
(defconst calendar-french-multibyte-month-name-array (defconst calendar-french-month-name-array
["Vendémiaire" "Brumaire" "Frimaire" "Nivôse" "Pluviôse" "Ventôse" ["Vendémiaire" "Brumaire" "Frimaire" "Nivôse" "Pluviôse" "Ventôse"
"Germinal" "Floréal" "Prairial" "Messidor" "Thermidor" "Fructidor"] "Germinal" "Floréal" "Prairial" "Messidor" "Thermidor" "Fructidor"]
"Array of multibyte month names in the French calendar.") "Array of month names in the French calendar.")
(defconst calendar-french-day-name-array (defconst calendar-french-day-name-array
["Primidi" "Duodi" "Tridi" "Quartidi" "Quintidi" "Sextidi" "Septidi" ["Primidi" "Duodi" "Tridi" "Quartidi" "Quintidi" "Sextidi" "Septidi"
"Octidi" "Nonidi" "Decadi"] "Octidi" "Nonidi" "Decadi"]
"Array of day names in the French calendar.") "Array of day names in the French calendar.")
(defconst calendar-french-special-days-array (define-obsolete-variable-alias 'calendar-french-multibyte-special-days-array
["de la Vertu" "du Ge'nie" "du Travail" "de la Raison" "des Re'compenses" 'calendar-french-special-days-array "28.1")
"de la Re'volution"]
"Array of special day names in the French calendar.")
(defconst calendar-french-multibyte-special-days-array (defconst calendar-french-special-days-array
["de la Vertu" "du Génie" "du Travail" "de la Raison" "des Récompenses" ["de la Vertu" "du Génie" "du Travail" "de la Raison" "des Récompenses"
"de la Révolution"] "de la Révolution"]
"Array of multibyte special day names in the French calendar.") "Array of special day names in the French calendar.")
(defun calendar-french-accents-p () (defun calendar-french-accents-p ()
"Return non-nil if diacritical marks are available." (declare (obsolete nil "28.1"))
(and (or window-system t)
(terminal-coding-system))
(or enable-multibyte-characters
(and (char-table-p standard-display-table)
(equal (aref standard-display-table 161) [161])))))
(defun calendar-french-month-name-array () (defun calendar-french-month-name-array ()
"Return the array of month names, depending on whether accents are available." "Return the array of month names, depending on whether accents are available."
(if (calendar-french-accents-p) (declare (obsolete "use the variable of the same name instead" "28.1"))
calendar-french-multibyte-month-name-array calendar-french-month-name-array)
calendar-french-month-name-array))
(defun calendar-french-day-name-array () (defun calendar-french-day-name-array ()
"Return the array of day names." "Return the array of day names."
(declare (obsolete "use the variable of the same name instead" "28.1"))
calendar-french-day-name-array) calendar-french-day-name-array)
(defun calendar-french-special-days-array () (defun calendar-french-special-days-array ()
"Return the special day names, depending on whether accents are available." "Return the special day names, depending on whether accents are available."
(if (calendar-french-accents-p) (declare (obsolete "use the variable of the same name instead" "28.1"))
calendar-french-multibyte-special-days-array calendar-french-special-days-array)
calendar-french-special-days-array))
(defun calendar-french-leap-year-p (year) (defun calendar-french-leap-year-p (year)
"True if YEAR is a leap year on the French Revolutionary calendar. "True if YEAR is a leap year on the French Revolutionary calendar.
...@@ -171,17 +162,13 @@ Defaults to today's date if DATE is not given." ...@@ -171,17 +162,13 @@ Defaults to today's date if DATE is not given."
(d (calendar-extract-day french-date))) (d (calendar-extract-day french-date)))
(cond (cond
((< y 1) "") ((< y 1) "")
((= m 13) (format (if (calendar-french-accents-p) ((= m 13) (format "Jour %s de l'Année %d de la Révolution"
"Jour %s de l'Année %d de la Révolution" (aref calendar-french-special-days-array (1- d))
"Jour %s de l'Anne'e %d de la Re'volution")
(aref (calendar-french-special-days-array) (1- d))
y)) y))
(t (format (t (format
(if (calendar-french-accents-p) "%d %s an %d de la Révolution"
"%d %s an %d de la Révolution"
"%d %s an %d de la Re'volution")
d d
(aref (calendar-french-month-name-array) (1- m)) (aref calendar-french-month-name-array (1- m))
y))))) y)))))
;;;###cal-autoload ;;;###cal-autoload
...@@ -198,13 +185,11 @@ Defaults to today's date if DATE is not given." ...@@ -198,13 +185,11 @@ Defaults to today's date if DATE is not given."
"Move cursor to French Revolutionary date DATE. "Move cursor to French Revolutionary date DATE.
Echo French Revolutionary date unless NOECHO is non-nil." Echo French Revolutionary date unless NOECHO is non-nil."
(interactive (interactive
(let* ((months (calendar-french-month-name-array)) (let* ((months calendar-french-month-name-array)
(special-days (calendar-french-special-days-array)) (special-days calendar-french-special-days-array)
(year (progn (year (progn
(calendar-read (calendar-read
(if (calendar-french-accents-p) "Année de la Révolution (>0): "
"Année de la Révolution (>0): "
"Anne'e de la Re'volution (>0): ")
(lambda (x) (> x 0)) (lambda (x) (> x 0))
(number-to-string (number-to-string
(calendar-extract-year (calendar-extract-year
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment