all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#19174: Wishlist/suggestion for emacs/lisp/calendar/cal-french.el
@ 2014-11-24 21:01 Jean Forget
  2014-11-26 19:14 ` Glenn Morris
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Jean Forget @ 2014-11-24 21:01 UTC (permalink / raw)
  To: 19174

The head comments of  lisp/calendar/cal-french.el give your
name and address as the maintainer of this file.

So, here is a wish item for lisp/calendar/cal-french.el.
It is implemented in my github repo :
https://github.com/jforget/emacs-lisp-cal-french

I used cal-french.el from the master branch of
https://github.com/emacs-mirror/emacs
in late October 2014.

There are 4 steps for the wish item, tagged with v1, v2, v3 and v4.
Here is a copy of the README file, showing the new features:

**** beginning of copy-paste
Changes
=======

Day Name
--------

Instead  of just  displaying  "18  Brumaire an  8  de la  Révolution",
cal-french.el now displays "Octidi 18 Brumaire an 8 de la Révolution".

Available with commit e4365c5, tag v1.

Additional Days
---------------

Displaying "Jour  du Travail de l'année  222 de la  Révolution" is not
very convenient, you cannot guess  whether this day is before or after
"Jour du Génie de l'année 222 de la Révolution".  This changes gives a
number in the 1-to-5 range (or 1-to-6 on leap years).  Additionally, I
found in  a book from the  French Revolution era that  these days bear
the same names as the other: "Primidi", "Duodi" etc.  So cal-french.el
will display:

   "Duodi 2 jour complémentaire an 222 de la Révolution, Jour du Génie"

   "Tridi 3 jour complémentaire an 222 de la Révolution, Jour du
Travail"

See http://datetime.mongueurs.net/Histoire/s-c/01-g.en.html.

In addition, when using "g f", you can now reply with the pseudo-month
"jour  complémentaire", and  then a  number  in the  1-to-5 or  1-to-6
range.

Available with commit b6dc17c, tag v2.

Feasts
------

Actually, not  only the 5 or  6 end-of-year additional  days, but also
the 360  normal days  had a feast.  So cal-french.el will  display the
feast for all days, for example:

  "Primidi 1 Vendémiaire an  223 de la Révolution, Jour du Raisin"

Of course, all feasts are available when answering to "g f".

A big disadvantage is that  the size or F<cal-french.el> inflates from
about 10 K to about 30 K.

Available with commit 6060f52, tag v3.

Feasts (second take)
--------------------

There are  two problems with  the functionality above, when  using the
calendar-french-goto-date function, triggered by "g f".

First, if the user enters a  normal (non-leap) year and then types "j"
and auto-complete twice  (tabulation), he gets a list  of 366 entries:
the pseudo-month "jour complémentaire" and  the 365 feasts for the 365
days of the year.

Second, if  the user is not  a native French-speaker (*)  he will have
trouble  sorting  masculine  and   feminine  words:  is  it  "jour  du
coriandre" or "jour de la coriandre"?

(*) and even for native  French-speakers as myself. For example, for a
long time I did the mistake with "coriandre".

The update consists of giving a list which no longer contains "jour du
raisin", "jour  de la coriandre" and  the like, but  only "raisin" and
"coriandre".

Available with commit 68384aa, tag v4.
**** end of copy-paste

Which version do you prefer to implement into Emacs? Will you clone
my Github repo or should I send you the full source or a diff output?
Or a pull request? I do not know yet how to send a pull request, but
I can learn that if necessary.

Problems and unknowns

I have tested only the multibyte version of strings, I do not know
how to activate the singlebyte option. We need to check especially
28 Fructidor jour du maïs ("mai\"s") and 18 Germinal jour de la
ciguë ("cigue\"").

Some historical sources say that "4 jour complémentaire" is "jour de
la raison", other sources say that it is "jour de l'opinion".

When choosing "jour du" vs "jour de la", I was not able to find the
word "bagarade" (26 Fructidor). I have chosen "jour de la bagarade"
because in modern French, there is a word "bigarade" for some kind
of orange and it would give "jour de la bigarade".

For version v3, if the user types "j" TAB TAB, he gets a 366-item
completion list. Performance-wise, it does not seem to be a burden for
Emacs, but you might have a different opinion. In this case, you
should adopt version v4 instead.

Best regards,

Jean Forget







^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#19174: Wishlist/suggestion for emacs/lisp/calendar/cal-french.el
  2014-11-24 21:01 bug#19174: Wishlist/suggestion for emacs/lisp/calendar/cal-french.el Jean Forget
@ 2014-11-26 19:14 ` Glenn Morris
  2021-05-28  2:00 ` Lars Ingebrigtsen
  2021-06-09 14:11 ` bug#19174: Wishlist/suggestion for emacs/lisp/calendar/cal-french.el Mattias Engdegård
  2 siblings, 0 replies; 15+ messages in thread
From: Glenn Morris @ 2014-11-26 19:14 UTC (permalink / raw)
  To: Jean Forget; +Cc: 19174


Thanks for the code.

I'm not sure when I will get time to look at it, but I forwarded it
to http://debbugs.gnu.org/19174 so that it is more visible.





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#19174: Wishlist/suggestion for emacs/lisp/calendar/cal-french.el
  2014-11-24 21:01 bug#19174: Wishlist/suggestion for emacs/lisp/calendar/cal-french.el Jean Forget
  2014-11-26 19:14 ` Glenn Morris
@ 2021-05-28  2:00 ` Lars Ingebrigtsen
  2021-06-07 19:32   ` Jean Forget
  2021-06-09 14:11 ` bug#19174: Wishlist/suggestion for emacs/lisp/calendar/cal-french.el Mattias Engdegård
  2 siblings, 1 reply; 15+ messages in thread
From: Lars Ingebrigtsen @ 2021-05-28  2:00 UTC (permalink / raw)
  To: Jean Forget; +Cc: Glenn Morris, 19174

Jean Forget <J2N-FORGET@orange.fr> writes:

> The head comments of  lisp/calendar/cal-french.el give your
> name and address as the maintainer of this file.
>
> So, here is a wish item for lisp/calendar/cal-french.el.
> It is implemented in my github repo :
> https://github.com/jforget/emacs-lisp-cal-french

(I'm going through old bug reports that unfortunately got no response at
the time.)

Could you send these changes as a patch to the debbugs address for
easier review?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#19174: Wishlist/suggestion for emacs/lisp/calendar/cal-french.el
  2021-05-28  2:00 ` Lars Ingebrigtsen
@ 2021-06-07 19:32   ` Jean Forget
  2021-06-08  9:34     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 15+ messages in thread
From: Jean Forget @ 2021-06-07 19:32 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Glenn Morris, 19174

Le 28/05/2021 à 04:00, Lars Ingebrigtsen a écrit :
> Jean Forget <J2N-FORGET@orange.fr> writes:
> 
>> The head comments of  lisp/calendar/cal-french.el give your
>> name and address as the maintainer of this file.
>>
>> So, here is a wish item for lisp/calendar/cal-french.el.
>> It is implemented in my github repo :
>> https://github.com/jforget/emacs-lisp-cal-french
> 
> (I'm going through old bug reports that unfortunately got no response at
> the time.)
> 
> Could you send these changes as a patch to the debbugs address for
> easier review?
> 
I can send you a patch ("diff -u" or plain "diff"), but it
will be a patch versus Emacs version 25.1.1, which is installed
on my machine.

I have taken a peek at the current version. I have seen that
there was a huge overhaul of the single-vs-multi-byte issue
in version 28.1. Backporting this overhaul into my version
is a big endeavour and will need much time.

Sending a patch showing the difference between *my* 25.1 version
and *your* 28.1 version would be counterproductive.

So are you interested by a patch for version 25.1 only?

Thank you for your interest,

Jean Forget







^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#19174: Wishlist/suggestion for emacs/lisp/calendar/cal-french.el
  2021-06-07 19:32   ` Jean Forget
@ 2021-06-08  9:34     ` Lars Ingebrigtsen
  2021-06-08 17:47       ` Jean Forget
  0 siblings, 1 reply; 15+ messages in thread
From: Lars Ingebrigtsen @ 2021-06-08  9:34 UTC (permalink / raw)
  To: Jean Forget; +Cc: Glenn Morris, 19174

Jean Forget <J2N-FORGET@orange.fr> writes:

> So are you interested by a patch for version 25.1 only?

Sure.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#19174: Wishlist/suggestion for emacs/lisp/calendar/cal-french.el
  2021-06-08  9:34     ` Lars Ingebrigtsen
@ 2021-06-08 17:47       ` Jean Forget
  2021-06-09 10:07         ` Lars Ingebrigtsen
  0 siblings, 1 reply; 15+ messages in thread
From: Jean Forget @ 2021-06-08 17:47 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Glenn Morris, 19174

[-- Attachment #1: Type: text/plain, Size: 193 bytes --]

Le 08/06/2021 à 11:34, Lars Ingebrigtsen a écrit :
> Jean Forget <J2N-FORGET@orange.fr> writes:
> 
>> So are you interested by a patch for version 25.1 only?
> 
> Sure.
> 
Here it is.

Jean

[-- Attachment #2: cal-french.el.patch --]
[-- Type: text/x-patch, Size: 25635 bytes --]

--- 25.1/lisp/calendar/cal-french.el	2016-09-26 23:13:06.000000000 +0200
+++ site-lisp/cal-french.el	2019-05-23 06:17:07.251961561 +0200
@@ -1,7 +1,7 @@
 ;;; cal-french.el --- calendar functions for the French Revolutionary calendar
 
-;; Copyright (C) 1988-1989, 1992, 1994-1995, 1997, 2001-2016 Free
-;; Software Foundation, Inc.
+;; Copyright (C) 1988-1989, 1992, 1994-1995, 1997, 2001-2014
+;;   Free Software Foundation, Inc.
 
 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
 ;; Maintainer: Glenn Morris <rgm@gnu.org>
@@ -37,17 +37,24 @@
 
 (defconst calendar-french-month-name-array
   ["Vende'miaire" "Brumaire" "Frimaire" "Nivo^se" "Pluvio^se" "Vento^se"
-   "Germinal" "Flore'al" "Prairial" "Messidor" "Thermidor" "Fructidor"]
+   "Germinal" "Flore'al" "Prairial" "Messidor" "Thermidor" "Fructidor"
+   "jour comple'mentaire"]
   "Array of month names in the French calendar.")
 
 (defconst calendar-french-multibyte-month-name-array
   ["Vendémiaire" "Brumaire" "Frimaire" "Nivôse" "Pluviôse" "Ventôse"
-   "Germinal" "Floréal" "Prairial" "Messidor" "Thermidor" "Fructidor"]
+   "Germinal" "Floréal" "Prairial" "Messidor" "Thermidor" "Fructidor"
+   "jour complémentaire"]
   "Array of multibyte month names in the French calendar.")
 
 (defconst calendar-french-day-name-array
   ["Primidi" "Duodi" "Tridi" "Quartidi" "Quintidi" "Sextidi" "Septidi"
-   "Octidi" "Nonidi" "Decadi"]
+   "Octidi" "Nonidi" "De'cadi"]
+  "Array of day names in the French calendar.")
+
+(defconst calendar-french-multibyte-day-name-array
+  ["Primidi" "Duodi" "Tridi" "Quartidi" "Quintidi" "Sextidi" "Septidi"
+   "Octidi" "Nonidi" "Décadi"]
   "Array of day names in the French calendar.")
 
 (defconst calendar-french-special-days-array
@@ -60,6 +67,186 @@
    "de la Révolution"]
   "Array of multibyte special day names in the French calendar.")
 
+(defconst calendar-french-feasts-array
+  [;; Vendémiaire
+   "du Raisin"               "du Safran"               "de la Cha^taigne"        "de la Colchique"          "du Cheval"
+   "de la Balsamine"         "de la Carotte"           "de l'Amarante"           "du Panais"                "de la Cuve"
+   "de la Pomme de terre"    "de l'Immortelle"         "du Potiron"              "du Re'se'da"              "de l'A^ne"
+   "de la Belle de nuit"     "de la Citrouille"        "du Sarrasin"             "du Tournesol"             "du Pressoir"
+   "du Chanvre"              "de la Pe^che"            "du Navet"                "de l'Amaryllis"           "du Boeuf"
+   "de l'Aubergine"          "du Piment"               "de la Tomate"            "de l'Orge"                "du Tonneau"
+   ;; Brumaire
+   "de la Pomme"             "du Ce'leri"              "de la Poire"             "de la Betterave"          "de l'Oie"
+   "de l'He'liotrope"        "de la Figue"             "de la Scorsone`re"       "de l'Alisier"             "de la Charrue"
+   "du Salsifis"             "de la Macre"             "du Topinambour"          "de l'Endive"              "du Dindon"
+   "du Chervis"              "du Cresson"              "de la Dentelaire"        "de la Grenade"            "de la Herse"
+   "de la Bacchante"         "de l'Azerole"            "de la Garance"           "de l'Orange"              "du Faisan"
+   "de la Pistache"          "du Macjon"               "du Coing"                "du Cormier"               "du Rouleau"
+   ;; Frimaire
+   "de la Raiponce"          "du Turneps"              "de la Chicore'e"         "de la Ne`fle"             "du Cochon"
+   "de la Ma^che"            "du Chou-fleur"           "du Miel"                 "du Genie`vre"             "de la Pioche"
+   "de la Cire"              "du Raifort"              "du Ce`dre"               "du Sapin"                 "du Chevreuil"
+   "de l'Ajonc"              "du Cypre`s"              "du Lierre"               "de la Sabine"             "du Hoyau"
+   "de l'E'rable-sucre"      "de la Bruye`re"          "du Roseau"               "de l'Oseille"             "du Grillon"
+   "du Pignon"               "du Lie`ge"               "de la Truffe"            "de l'Olive"               "de la Pelle"
+   ;; Nivôse
+   "de la Tourbe"            "de la Houille"           "du Bitume"               "du Soufre"                "du Chien"
+   "de la Lave"              "de la Terre ve'ge'tale"  "du Fumier"               "du Salpe^tre"             "du Fle'au"
+   "du Granit"               "de l'Argile"             "de l'Ardoise"            "du Gre`s"                 "du Lapin"
+   "du Silex"                "de la Marne"             "de la Pierre a` chaux"   "du Marbre"                "du Van"
+   "de la Pierre a` pla^tre" "du Sel"                  "du Fer"                  "du Cuivre"                "du Chat"
+   "de l'E'tain"             "du Plomb"                "du Zinc"                 "du Mercure"               "du Crible"
+   ;; Pluviôse
+   "de la Laure'ole"         "de la Mousse"            "du Fragon"               "du Perce-neige"           "du Taureau"
+   "du Laurier-thym"         "de l'Amadouvier"         "du Me'ze're'on"          "du Peuplier"              "de la Cogne'e"
+   "de l'Elle'bore"          "du Brocoli"              "du Laurier"              "de l'Avelinier"           "de la Vache"
+   "du Buis"                 "du Lichen"               "de l'If"                 "de la Pulmonaire"         "de la Serpette"
+   "du Thlaspi"              "du Thymele'"             "du Chiendent"            "de la Trai^nasse"         "du Lie`vre"
+   "de la Gue`de"            "du Noisetier"            "du Cyclamen"             "de la Che'lidoine"        "du Trai^neau"
+   ;; Ventôse
+   "du Tussilage"            "du Cornouiller"          "du Violier"              "du Troe`ne"               "du Bouc"
+   "de l'Asaret"             "de l'Alaterne"           "de la Violette"          "du Marsault"              "de la Be^che"
+   "du Narcisse"             "de l'Orme"               "de la Fumeterre"         "du Ve'lar"                "de la Che`vre"
+   "de l'E'pinard"           "du Doronic"              "du Mouron"               "du Cerfeuil"              "du Cordeau"
+   "de la Mandragore"        "du Persil"               "du Cochle'aria"          "de la Pa^querette"        "du Thon"
+   "du Pissenlit"            "de la Sylvie"            "du Capillaire"           "du Fre^ne"                "du Plantoir"
+   ;; Germinal
+   "de la Primeve`re"        "du Platane"              "de l'Asperge"            "de la Tulipe"             "de la Poule"
+   "de la Blette"            "du Bouleau"              "de la Jonquille"         "de l'Aulne"               "du Couvoir"
+   "de la Pervenche"         "du Charme"               "de la Morille"           "du He^tre"                "de l'Abeille"
+   "de la Laitue"            "du Me'le`ze"             "de la Cigue\""           "du Radis"                 "de la Ruche"
+   "du Gainier"              "de la Romaine"           "du Marronnier"           "de la Roquette"           "du Pigeon"
+   "du Lilas"                "de l'Ane'mone"           "de la Pense'e"           "de la Myrtille"           "du Greffoir"
+   ;; Floréal
+   "de la Rose"              "du Che^ne"               "de la Fouge`re"          "de l'Aube'pine"           "du Rossignol"
+   "de l'Ancolie"            "du Muguet"               "du Champignon"           "de la Jacinthe"           "du Rateau"
+   "de la Rhubarbe"          "du Sainfoin"             "du Ba^ton-d'or"          "du Chame'risier"          "du Ver a` soie"
+   "de la Consoude"          "de la Pimprenelle"       "de la Corbeille-d'or"    "de l'Arroche"             "du Sarcloir"
+   "du Statice"              "de la Fritillaire"       "de la Bourrache"         "de la Vale'riane"         "de la Carpe"
+   "du Fusain"               "de la Civette"           "de la Buglosse"          "du Se'neve'"              "de la Houlette"
+   ;; Prairial
+   "de la Luzerne"           "de l'He'me'rocalle"      "du Tre`fle"              "de l'Ange'lique"          "du Canard"
+   "de la Me'lisse"          "du Fromental"            "du Martagon"             "du Serpolet"              "de la Faux"
+   "de la Fraise"            "de la Be'toine"          "du Pois"                 "de l'Acacia"              "de la Caille"
+   "de l'Oeillet"            "du Sureau"               "du Pavot"                "du Tilleul"               "de la Fourche"
+   "du Barbeau"              "de la Camomille"         "du Che`vrefeuille"       "du Caille-lait"           "de la Tanche"
+   "du Jasmin"               "de la Verveine"          "du Thym"                 "de la Pivoine"            "du Chariot"
+   ;; Messidor
+   "du Seigle"               "de l'Avoine"             "de l'Oignon"             "de la Ve'ronique"         "du Mulet"
+   "du Romarin"              "du Concombre"            "de l'E'chalotte"         "de l'Absinthe"            "de la Faucille"
+   "de la Coriandre"         "de l'Artichaut"          "de la Girofle'e"         "de la Lavande"            "du Chamois"
+   "du Tabac"                "de la Groseille"         "de la Gesse"             "de la Cerise"             "du Parc"
+   "de la Menthe"            "du Cumin"                "du Haricot"              "de l'Orcane`te"           "de la Pintade"
+   "de la Sauge"             "de l'Ail"                "de la Vesce"             "du Ble'"                  "de la Chale'mie"
+   ;; Thermidor
+   "de l'E'pautre"           "du Bouillon-blanc"       "du Melon"                "de l'Ivraie"              "du Be'lier"
+   "de la Pre`le"            "de l'Armoise"            "du Carthame"             "de la Mu^re"              "de l'Arrosoir"
+   "du Panis"                "du Salicor"              "de l'Abricot"            "du Basilic"               "de la Brebis"
+   "de la Guimauve"          "du Lin"                  "de l'Amande"             "de la Gentiane"           "de l'E'cluse"
+   "de la Carline"           "du Ca^prier"             "de la Lentille"          "de l'Aune'e"              "de la Loutre"
+   "de la Myrte"             "du Colza"                "du Lupin"                "du Coton"                 "du Moulin"
+   ;; Fructidor
+   "de la Prune"             "du Millet"               "du Lycoperdon"           "de l'Escourgeon"          "du Saumon"
+   "de la Tube'reuse"        "du Sucrion"              "de l'Apocyn"             "de la Re'glisse"          "de l'E'chelle"
+   "de la Paste`que"         "du Fenouil"              "de l'E'pine-vinette"     "de la Noix"               "de la Truite"
+   "du Citron"               "de la Carde`re"          "du Nerprun"              "du Tagette"               "de la Hotte"
+   "de l'E'glantier"         "de la Noisette"          "du Houblon"              "du Sorgho"                "de l'E'crevisse"
+   "de la Bagarade"          "de la Verge-d'or"        "du Mai\"s"               "du Marron"                "du Panier"
+   ;; jour complémentaire
+   "de la Vertu"             "du Ge'nie"               "du Travail"              "de la Raison"             "des Re'compenses"
+   "de la Re'volution"]
+  "Array of day feasts in the French calendar.")
+
+(defconst calendar-french-multibyte-feasts-array
+  [;; Vendémiaire
+   "du Raisin"             "du Safran"             "de la Châtaigne"       "de la Colchique"        "du Cheval"
+   "de la Balsamine"       "de la Carotte"         "de l'Amarante"         "du Panais"              "de la Cuve"
+   "de la Pomme de terre"  "de l'Immortelle"       "du Potiron"            "du Réséda"              "de l'Âne"
+   "de la Belle de nuit"   "de la Citrouille"      "du Sarrasin"           "du Tournesol"           "du Pressoir"
+   "du Chanvre"            "de la Pêche"           "du Navet"              "de l'Amaryllis"         "du Bœuf"
+   "de l'Aubergine"        "du Piment"             "de la Tomate"          "de l'Orge"              "du Tonneau"
+   ;; Brumaire
+   "de la Pomme"           "du Céleri"             "de la Poire"           "de la Betterave"        "de l'Oie"
+   "de l'Héliotrope"       "de la Figue"           "de la Scorsonère"      "de l'Alisier"           "de la Charrue"
+   "du Salsifis"           "de la Macre"           "du Topinambour"        "de l'Endive"            "du Dindon"
+   "du Chervis"            "du Cresson"            "de la Dentelaire"      "de la Grenade"          "de la Herse"
+   "de la Bacchante"       "de l'Azerole"          "de la Garance"         "de l'Orange"            "du Faisan"
+   "de la Pistache"        "du Macjon"             "du Coing"              "du Cormier"             "du Rouleau"
+   ;; Frimaire
+   "de la Raiponce"        "du Turneps"            "de la Chicorée"        "de la Nèfle"            "du Cochon"
+   "de la Mâche"           "du Chou-fleur"         "du Miel"               "du Genièvre"            "de la Pioche"
+   "de la Cire"            "du Raifort"            "du Cèdre"              "du Sapin"               "du Chevreuil"
+   "de l'Ajonc"            "du Cyprès"             "du Lierre"             "de la Sabine"           "du Hoyau"
+   "de l'Érable-sucre"     "de la Bruyère"         "du Roseau"             "de l'Oseille"           "du Grillon"
+   "du Pignon"             "du Liège"              "de la Truffe"          "de l'Olive"             "de la Pelle"
+   ;; Nivôse
+   "de la Tourbe"          "de la Houille"         "du Bitume"             "du Soufre"              "du Chien"
+   "de la Lave"            "de la Terre végétale"  "du Fumier"             "du Salpêtre"            "du Fléau"
+   "du Granit"             "de l'Argile"           "de l'Ardoise"          "du Grès"                "du Lapin"
+   "du Silex"              "de la Marne"           "de la Pierre à chaux"  "du Marbre"              "du Van"
+   "de la Pierre à plâtre" "du Sel"                "du Fer"                "du Cuivre"              "du Chat"
+   "de l'Étain"            "du Plomb"              "du Zinc"               "du Mercure"             "du Crible"
+   ;; Pluviôse
+   "de la Lauréole"        "de la Mousse"          "du Fragon"             "du Perce-neige"         "du Taureau"
+   "du Laurier-thym"       "de l'Amadouvier"       "du Mézéréon"           "du Peuplier"            "de la Cognée"
+   "de l'Ellébore"         "du Brocoli"            "du Laurier"            "de l'Avelinier"         "de la Vache"
+   "du Buis"               "du Lichen"             "de l'If"               "de la Pulmonaire"       "de la Serpette"
+   "du Thlaspi"            "du Thymelé"            "du Chiendent"          "de la Traînasse"        "du Lièvre"
+   "de la Guède"           "du Noisetier"          "du Cyclamen"           "de la Chélidoine"       "du Traîneau"
+   ;; Ventôse
+   "du Tussilage"          "du Cornouiller"        "du Violier"            "du Troène"              "du Bouc"
+   "de l'Asaret"           "de l'Alaterne"         "de la Violette"        "du Marsault"            "de la Bêche"
+   "du Narcisse"           "de l'Orme"             "de la Fumeterre"       "du Vélar"               "de la Chèvre"
+   "de l'Épinard"          "du Doronic"            "du Mouron"             "du Cerfeuil"            "du Cordeau"
+   "de la Mandragore"      "du Persil"             "du Cochléaria"         "de la Pâquerette"       "du Thon"
+   "du Pissenlit"          "de la Sylvie"          "du Capillaire"         "du Frêne"               "du Plantoir"
+   ;; Germinal
+   "de la Primevère"       "du Platane"            "de l'Asperge"          "de la Tulipe"           "de la Poule"
+   "de la Blette"          "du Bouleau"            "de la Jonquille"       "de l'Aulne"             "du Couvoir"
+   "de la Pervenche"       "du Charme"             "de la Morille"         "du Hêtre"               "de l'Abeille"
+   "de la Laitue"          "du Mélèze"             "de la Ciguë"           "du Radis"               "de la Ruche"
+   "du Gainier"            "de la Romaine"         "du Marronnier"         "de la Roquette"         "du Pigeon"
+   "du Lilas"              "de l'Anémone"          "de la Pensée"          "de la Myrtille"         "du Greffoir"
+   ;; Floréal
+   "de la Rose"            "du Chêne"              "de la Fougère"         "de l'Aubépine"          "du Rossignol"
+   "de l'Ancolie"          "du Muguet"             "du Champignon"         "de la Jacinthe"         "du Rateau"
+   "de la Rhubarbe"        "du Sainfoin"           "du Bâton-d'or"         "du Chamérisier"         "du Ver à soie"
+   "de la Consoude"        "de la Pimprenelle"     "de la Corbeille-d'or"  "de l'Arroche"           "du Sarcloir"
+   "du Statice"            "de la Fritillaire"     "de la Bourrache"       "de la Valériane"        "de la Carpe"
+   "du Fusain"             "de la Civette"         "de la Buglosse"        "du Sénevé"              "de la Houlette"
+   ;; Prairial
+   "de la Luzerne"         "de l'Hémérocalle"      "du Trèfle"             "de l'Angélique"         "du Canard"
+   "de la Mélisse"         "du Fromental"          "du Martagon"           "du Serpolet"            "de la Faux"
+   "de la Fraise"          "de la Bétoine"         "du Pois"               "de l'Acacia"            "de la Caille"
+   "de l'Œillet"           "du Sureau"             "du Pavot"              "du Tilleul"             "de la Fourche"
+   "du Barbeau"            "de la Camomille"       "du Chèvrefeuille"      "du Caille-lait"         "de la Tanche"
+   "du Jasmin"             "de la Verveine"        "du Thym"               "de la Pivoine"          "du Chariot"
+   ;; Messidor
+   "du Seigle"             "de l'Avoine"           "de l'Oignon"           "de la Véronique"        "du Mulet"
+   "du Romarin"            "du Concombre"          "de l'Échalotte"        "de l'Absinthe"          "de la Faucille"
+   "de la Coriandre"       "de l'Artichaut"        "de la Giroflée"        "de la Lavande"          "du Chamois"
+   "du Tabac"              "de la Groseille"       "de la Gesse"           "de la Cerise"           "du Parc"
+   "de la Menthe"          "du Cumin"              "du Haricot"            "de l'Orcanète"          "de la Pintade"
+   "de la Sauge"           "de l'Ail"              "de la Vesce"           "du Blé"                 "de la Chalémie"
+   ;; Thermidor
+   "de l'Épautre"          "du Bouillon-blanc"     "du Melon"              "de l'Ivraie"            "du Bélier"
+   "de la Prèle"           "de l'Armoise"          "du Carthame"           "de la Mûre"             "de l'Arrosoir"
+   "du Panis"              "du Salicor"            "de l'Abricot"          "du Basilic"             "de la Brebis"
+   "de la Guimauve"        "du Lin"                "de l'Amande"           "de la Gentiane"         "de l'Écluse"
+   "de la Carline"         "du Câprier"            "de la Lentille"        "de l'Aunée"             "de la Loutre"
+   "de la Myrte"           "du Colza"              "du Lupin"              "du Coton"               "du Moulin"
+   ;; Fructidor
+   "de la Prune"           "du Millet"             "du Lycoperdon"         "de l'Escourgeon"        "du Saumon"
+   "de la Tubéreuse"       "du Sucrion"            "de l'Apocyn"           "de la Réglisse"         "de l'Échelle"
+   "de la Pastèque"        "du Fenouil"            "de l'Épine-vinette"    "de la Noix"             "de la Truite"
+   "du Citron"             "de la Cardère"         "du Nerprun"            "du Tagette"             "de la Hotte"
+   "de l'Églantier"        "de la Noisette"        "du Houblon"            "du Sorgho"              "de l'Écrevisse"
+   "de la Bagarade"        "de la Verge-d'or"      "du Maïs"               "du Marron"              "du Panier"
+   ;; jour complémentaire
+   "de la Vertu"           "du Génie"              "du Travail"            "de la Raison"           "des Récompenses"
+   "de la Révolution"]
+  "Array of multibyte day feasts in the French calendar.")
+
 (defun calendar-french-accents-p ()
   "Return non-nil if diacritical marks are available."
   (and (or window-system
@@ -76,7 +263,9 @@
 
 (defun calendar-french-day-name-array ()
   "Return the array of day names."
-  calendar-french-day-name-array)
+  (if (calendar-french-accents-p)
+      calendar-french-multibyte-day-name-array
+  calendar-french-day-name-array))
 
 (defun calendar-french-special-days-array ()
   "Return the special day names, depending on whether accents are available."
@@ -84,6 +273,23 @@
       calendar-french-multibyte-special-days-array
     calendar-french-special-days-array))
 
+(defun calendar-french-feasts-array ()
+  "Return the day feasts, depending on whether accents are available."
+  (if (calendar-french-accents-p)
+      calendar-french-multibyte-feasts-array
+    calendar-french-feasts-array))
+
+(defun calendar-french-trim-feast (feast)
+  "Remove the article from the feast, e.g. \"du Raisin\" -> \"Raisin\"
+or \"de la Vertu\" -> \"Vertu\""
+  (cond
+     ((equal (substring feast 0 3) "du ")    (substring feast 3))
+     ((equal (substring feast 0 6) "de la ") (substring feast 6))
+     ((equal (substring feast 0 5) "de l'")  (substring feast 5))
+     ((equal (substring feast 0 4) "des ")   (substring feast 4))
+     (t feast))
+)
+
 (defun calendar-french-leap-year-p (year)
   "True if YEAR is a leap year on the French Revolutionary calendar.
 For Gregorian years 1793 to 1805, the years of actual operation of the
@@ -171,18 +377,15 @@
          (d (calendar-extract-day french-date)))
     (cond
      ((< y 1) "")
-     ((= m 13) (format (if (calendar-french-accents-p)
-                           "Jour %s de l'Année %d de la Révolution"
-                         "Jour %s de l'Anne'e %d de la Re'volution")
-                       (aref (calendar-french-special-days-array) (1- d))
-                       y))
      (t (format
          (if (calendar-french-accents-p)
-             "%d %s an %d de la Révolution"
-           "%d %s an %d de la Re'volution")
+             "%s %d %s an %d de la Révolution, jour %s"
+           "%s %d %s an %d de la Re'volution, jour %s")
+         (aref (calendar-french-day-name-array) (% (1- d) 10))
          d
          (aref (calendar-french-month-name-array) (1- m))
-         y)))))
+         y
+         (aref (calendar-french-feasts-array) (+ -31 (* 30 m) d)) )))))
 
 ;;;###cal-autoload
 (defun calendar-french-print-date ()
@@ -199,7 +402,7 @@
 Echo French Revolutionary date unless NOECHO is non-nil."
   (interactive
    (let* ((months (calendar-french-month-name-array))
-          (special-days (calendar-french-special-days-array))
+          (feasts (calendar-french-feasts-array))
           (year (progn
                   (calendar-read
                    (if (calendar-french-accents-p)
@@ -215,29 +418,35 @@
            (mapcar 'list
                    (append months
                            (if (calendar-french-leap-year-p year)
-                               (mapcar
-                                (lambda (x) (concat "Jour " x))
-                                calendar-french-special-days-array)
+                               (mapcar 'calendar-french-trim-feast
+                                feasts)
                              (reverse
                               (cdr ; we don't want rev. day in a non-leap yr
                                (reverse
-                                (mapcar
-                                 (lambda (x)
-                                   (concat "Jour " x))
-                                 special-days))))))))
+                                (mapcar 'calendar-french-trim-feast
+                                 feasts))))))))
           (completion-ignore-case t)
+          (month-prompt (if (calendar-french-accents-p)
+                        "Mois ou \"jour complémentaire\" ou fête: "
+                        "Mois ou \"jour comple'mentaire\" ou fe^te: "))
           (month (cdr (assoc-string
                        (completing-read
-                        "Mois ou Sansculottide: "
+                        month-prompt
                         month-list
                         nil t)
                        (calendar-make-alist month-list 1 'car) t)))
-          (day (if (> month 12)
-                   (- month 12)
+          (last-day (if (> month 13) (calendar-french-last-day-of-month 13 year)
+                         (calendar-french-last-day-of-month month year)))
+          (day (if (> month 13)
+                   (- month 13)
                  (calendar-read
-                  "Jour (1-30): "
-                  (lambda (x) (and (<= 1 x) (<= x 30))))))
-          (month (if (> month 12) 13 month)))
+                  (format "Jour (1-%d): " last-day)
+                  (lambda (x) (and (<= 1 x) (<= x last-day))))))
+          (month (if (> month 13) 1 month))) ; all days in Vendémiaire and numbered 1 to 365
+                                             ; e.g., "Pomme" gives 31 Vendémiaire automatically normalized to 1 Brumaire
+                                             ; "Céleri" gives 32 Vnd normalized to 2 Bru,
+                                             ; "Raiponce" gives 61 Vnd normalized to 1 Frimaire, etc
+                                             ; until "Récompences" which gives 365 Vnd normalized to 5 jour complémentaire
      (list (list month day year))))
   (calendar-goto-date (calendar-gregorian-from-absolute
                        (calendar-french-to-absolute date)))
@@ -256,4 +465,8 @@
 
 (provide 'cal-french)
 
+;; Local Variables:
+;; coding: utf-8
+;; End:
+
 ;;; cal-french.el ends here

^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#19174: Wishlist/suggestion for emacs/lisp/calendar/cal-french.el
  2021-06-08 17:47       ` Jean Forget
@ 2021-06-09 10:07         ` Lars Ingebrigtsen
  2021-06-10  5:56           ` bug#19174: JEAN FORGET Jean Forget
  0 siblings, 1 reply; 15+ messages in thread
From: Lars Ingebrigtsen @ 2021-06-09 10:07 UTC (permalink / raw)
  To: Jean Forget; +Cc: Glenn Morris, 19174

Jean Forget <J2N-FORGET@orange.fr> writes:

>>> So are you interested by a patch for version 25.1 only?
>> Sure.
> Here it is.

Thanks.  This is too big to install in Emacs without assigning a
copyright to the FSF.  Would you be willing to do so?

If so, the form below is how to get started.


Please email the following information to assign@gnu.org, and we
will send you the assignment form for your past and future changes.

Please use your full legal name (in ASCII characters) as the subject
line of the message.
----------------------------------------------------------------------
REQUEST: SEND FORM FOR PAST AND FUTURE CHANGES

[What is the name of the program or package you're contributing to?]
Emacs

[Did you copy any files or text written by someone else in these changes?
Even if that material is free software, we need to know about it.]

[Do you have an employer who might have a basis to claim to own
your changes?  Do you attend a school which might make such a claim?]

[For the copyright registration, what country are you a citizen of?]

[What year were you born?]

[Please write your email address here.]

[Please write your postal address here.]

[Which files have you changed so far, and which new files have you written
so far?]





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#19174: Wishlist/suggestion for emacs/lisp/calendar/cal-french.el
  2014-11-24 21:01 bug#19174: Wishlist/suggestion for emacs/lisp/calendar/cal-french.el Jean Forget
  2014-11-26 19:14 ` Glenn Morris
  2021-05-28  2:00 ` Lars Ingebrigtsen
@ 2021-06-09 14:11 ` Mattias Engdegård
  2021-06-10  5:40   ` Jean Forget
  2 siblings, 1 reply; 15+ messages in thread
From: Mattias Engdegård @ 2021-06-09 14:11 UTC (permalink / raw)
  To: Jean Forget; +Cc: Glenn Morris, Lars Ingebrigtsen, 19174

[-- Attachment #1: Type: text/html, Size: 1053 bytes --]

[-- Attachment #2: cal-french-updated.diff --]
[-- Type: application/octet-stream, Size: 14153 bytes --]

diff --git a/lisp/calendar/cal-french.el b/lisp/calendar/cal-french.el
index 639bae700c..cc18a2a5d8 100644
--- a/lisp/calendar/cal-french.el
+++ b/lisp/calendar/cal-french.el
@@ -40,12 +40,13 @@ 'calendar-french-multibyte-month-name-array
 
 (defconst calendar-french-month-name-array
   ["Vendémiaire" "Brumaire" "Frimaire" "Nivôse" "Pluviôse" "Ventôse"
-   "Germinal" "Floréal" "Prairial" "Messidor" "Thermidor" "Fructidor"]
+   "Germinal" "Floréal" "Prairial" "Messidor" "Thermidor" "Fructidor"
+   "jour complémentaire"]
   "Array of month names in the French calendar.")
 
 (defconst calendar-french-day-name-array
   ["Primidi" "Duodi" "Tridi" "Quartidi" "Quintidi" "Sextidi" "Septidi"
-   "Octidi" "Nonidi" "Decadi"]
+   "Octidi" "Nonidi" "Décadi"]
   "Array of day names in the French calendar.")
 
 (define-obsolete-variable-alias 'calendar-french-multibyte-special-days-array
@@ -56,6 +57,144 @@ calendar-french-special-days-array
    "de la Révolution"]
   "Array of special day names in the French calendar.")
 
+(defconst calendar-french-feasts-array
+  [;; Vendémiaire
+   "du Raisin"             "du Safran"             "de la Châtaigne"
+   "de la Colchique"       "du Cheval"             "de la Balsamine"
+   "de la Carotte"         "de l'Amarante"         "du Panais"
+   "de la Cuve"            "de la Pomme de terre"  "de l'Immortelle"
+   "du Potiron"            "du Réséda"             "de l'Âne"
+   "de la Belle de nuit"   "de la Citrouille"      "du Sarrasin"
+   "du Tournesol"          "du Pressoir"           "du Chanvre"
+   "de la Pêche"           "du Navet"              "de l'Amaryllis"
+   "du Bœuf"               "de l'Aubergine"        "du Piment"
+   "de la Tomate"          "de l'Orge"             "du Tonneau"
+   ;; Brumaire
+   "de la Pomme"           "du Céleri"             "de la Poire"
+   "de la Betterave"       "de l'Oie"              "de l'Héliotrope"
+   "de la Figue"           "de la Scorsonère"      "de l'Alisier"
+   "de la Charrue"         "du Salsifis"           "de la Macre"
+   "du Topinambour"        "de l'Endive"           "du Dindon"
+   "du Chervis"            "du Cresson"            "de la Dentelaire"
+   "de la Grenade"         "de la Herse"           "de la Bacchante"
+   "de l'Azerole"          "de la Garance"         "de l'Orange"
+   "du Faisan"             "de la Pistache"        "du Macjon"
+   "du Coing"              "du Cormier"            "du Rouleau"
+   ;; Frimaire
+   "de la Raiponce"        "du Turneps"            "de la Chicorée"
+   "de la Nèfle"           "du Cochon"             "de la Mâche"
+   "du Chou-fleur"         "du Miel"               "du Genièvre"
+   "de la Pioche"          "de la Cire"            "du Raifort"
+   "du Cèdre"              "du Sapin"              "du Chevreuil"
+   "de l'Ajonc"            "du Cyprès"             "du Lierre"
+   "de la Sabine"          "du Hoyau"              "de l'Érable-sucre"
+   "de la Bruyère"         "du Roseau"             "de l'Oseille"
+   "du Grillon"            "du Pignon"             "du Liège"
+   "de la Truffe"          "de l'Olive"            "de la Pelle"
+   ;; Nivôse
+   "de la Tourbe"          "de la Houille"         "du Bitume"
+   "du Soufre"             "du Chien"              "de la Lave"
+   "de la Terre végétale"  "du Fumier"             "du Salpêtre"
+   "du Fléau"              "du Granit"             "de l'Argile"
+   "de l'Ardoise"          "du Grès"               "du Lapin"
+   "du Silex"              "de la Marne"           "de la Pierre à chaux"
+   "du Marbre"             "du Van"                "de la Pierre à plâtre"
+   "du Sel"                "du Fer"                "du Cuivre"
+   "du Chat"               "de l'Étain"            "du Plomb"
+   "du Zinc"               "du Mercure"            "du Crible"
+   ;; Pluviôse
+   "de la Lauréole"        "de la Mousse"          "du Fragon"
+   "du Perce-neige"        "du Taureau"            "du Laurier-thym"
+   "de l'Amadouvier"       "du Mézéréon"           "du Peuplier"
+   "de la Cognée"          "de l'Ellébore"         "du Brocoli"
+   "du Laurier"            "de l'Avelinier"        "de la Vache"
+   "du Buis"               "du Lichen"             "de l'If"
+   "de la Pulmonaire"      "de la Serpette"        "du Thlaspi"
+   "du Thymelé"            "du Chiendent"          "de la Traînasse"
+   "du Lièvre"             "de la Guède"           "du Noisetier"
+   "du Cyclamen"           "de la Chélidoine"      "du Traîneau"
+   ;; Ventôse
+   "du Tussilage"          "du Cornouiller"        "du Violier"
+   "du Troène"             "du Bouc"               "de l'Asaret"
+   "de l'Alaterne"         "de la Violette"        "du Marsault"
+   "de la Bêche"           "du Narcisse"           "de l'Orme"
+   "de la Fumeterre"       "du Vélar"              "de la Chèvre"
+   "de l'Épinard"          "du Doronic"            "du Mouron"
+   "du Cerfeuil"           "du Cordeau"            "de la Mandragore"
+   "du Persil"             "du Cochléaria"         "de la Pâquerette"
+   "du Thon"               "du Pissenlit"          "de la Sylvie"
+   "du Capillaire"         "du Frêne"              "du Plantoir"
+   ;; Germinal
+   "de la Primevère"       "du Platane"            "de l'Asperge"
+   "de la Tulipe"          "de la Poule"           "de la Blette"
+   "du Bouleau"            "de la Jonquille"       "de l'Aulne"
+   "du Couvoir"            "de la Pervenche"       "du Charme"
+   "de la Morille"         "du Hêtre"              "de l'Abeille"
+   "de la Laitue"          "du Mélèze"             "de la Ciguë"
+   "du Radis"              "de la Ruche"           "du Gainier"
+   "de la Romaine"         "du Marronnier"         "de la Roquette"
+   "du Pigeon"             "du Lilas"              "de l'Anémone"
+   "de la Pensée"          "de la Myrtille"        "du Greffoir"
+   ;; Floréal
+   "de la Rose"            "du Chêne"              "de la Fougère"
+   "de l'Aubépine"         "du Rossignol"          "de l'Ancolie"
+   "du Muguet"             "du Champignon"         "de la Jacinthe"
+   "du Rateau"             "de la Rhubarbe"        "du Sainfoin"
+   "du Bâton-d'or"         "du Chamérisier"        "du Ver à soie"
+   "de la Consoude"        "de la Pimprenelle"     "de la Corbeille-d'or"
+   "de l'Arroche"          "du Sarcloir"           "du Statice"
+   "de la Fritillaire"     "de la Bourrache"       "de la Valériane"
+   "de la Carpe"           "du Fusain"             "de la Civette"
+   "de la Buglosse"        "du Sénevé"             "de la Houlette"
+   ;; Prairial
+   "de la Luzerne"         "de l'Hémérocalle"      "du Trèfle"
+   "de l'Angélique"        "du Canard"             "de la Mélisse"
+   "du Fromental"          "du Martagon"           "du Serpolet"
+   "de la Faux"            "de la Fraise"          "de la Bétoine"
+   "du Pois"               "de l'Acacia"           "de la Caille"
+   "de l'Œillet"           "du Sureau"             "du Pavot"
+   "du Tilleul"            "de la Fourche"         "du Barbeau"
+   "de la Camomille"       "du Chèvrefeuille"      "du Caille-lait"
+   "de la Tanche"          "du Jasmin"             "de la Verveine"
+   "du Thym"               "de la Pivoine"         "du Chariot"
+   ;; Messidor
+   "du Seigle"             "de l'Avoine"           "de l'Oignon"
+   "de la Véronique"       "du Mulet"              "du Romarin"
+   "du Concombre"          "de l'Échalotte"        "de l'Absinthe"
+   "de la Faucille"        "de la Coriandre"       "de l'Artichaut"
+   "de la Giroflée"        "de la Lavande"         "du Chamois"
+   "du Tabac"              "de la Groseille"       "de la Gesse"
+   "de la Cerise"          "du Parc"               "de la Menthe"
+   "du Cumin"              "du Haricot"            "de l'Orcanète"
+   "de la Pintade"         "de la Sauge"           "de l'Ail"
+   "de la Vesce"           "du Blé"                "de la Chalémie"
+   ;; Thermidor
+   "de l'Épautre"          "du Bouillon-blanc"     "du Melon"
+   "de l'Ivraie"           "du Bélier"             "de la Prèle"
+   "de l'Armoise"          "du Carthame"           "de la Mûre"
+   "de l'Arrosoir"         "du Panis"              "du Salicor"
+   "de l'Abricot"          "du Basilic"            "de la Brebis"
+   "de la Guimauve"        "du Lin"                "de l'Amande"
+   "de la Gentiane"        "de l'Écluse"           "de la Carline"
+   "du Câprier"            "de la Lentille"        "de l'Aunée"
+   "de la Loutre"          "de la Myrte"           "du Colza"
+   "du Lupin"              "du Coton"              "du Moulin"
+   ;; Fructidor
+   "de la Prune"           "du Millet"             "du Lycoperdon"
+   "de l'Escourgeon"       "du Saumon"             "de la Tubéreuse"
+   "du Sucrion"            "de l'Apocyn"           "de la Réglisse"
+   "de l'Échelle"          "de la Pastèque"        "du Fenouil"
+   "de l'Épine-vinette"    "de la Noix"            "de la Truite"
+   "du Citron"             "de la Cardère"         "du Nerprun"
+   "du Tagette"            "de la Hotte"           "de l'Églantier"
+   "de la Noisette"        "du Houblon"            "du Sorgho"
+   "de l'Écrevisse"        "de la Bagarade"        "de la Verge-d'or"
+   "du Maïs"               "du Marron"             "du Panier"
+   ;; jour complémentaire
+   "de la Vertu"           "du Génie"              "du Travail"
+   "de la Raison"          "des Récompenses"       "de la Révolution"]
+  "Array of day feasts in the French calendar.")
+
 (defun calendar-french-accents-p ()
   (declare (obsolete nil "28.1"))
   t)
@@ -75,6 +214,16 @@ calendar-french-special-days-array
   (declare (obsolete "use the variable of the same name instead" "28.1"))
   calendar-french-special-days-array)
 
+(defun calendar-french-trim-feast (feast)
+  "Remove the article from the feast, e.g. \"du Raisin\" -> \"Raisin\"
+or \"de la Vertu\" -> \"Vertu\""
+  (cond
+   ((equal (substring feast 0 3) "du ")    (substring feast 3))
+   ((equal (substring feast 0 6) "de la ") (substring feast 6))
+   ((equal (substring feast 0 5) "de l'")  (substring feast 5))
+   ((equal (substring feast 0 4) "des ")   (substring feast 4))
+   (t feast)))
+
 (defun calendar-french-leap-year-p (year)
   "True if YEAR is a leap year on the French Revolutionary calendar.
 For Gregorian years 1793 to 1805, the years of actual operation of the
@@ -162,14 +311,13 @@ calendar-french-date-string
          (d (calendar-extract-day french-date)))
     (cond
      ((< y 1) "")
-     ((= m 13) (format "Jour %s de l'Année %d de la Révolution"
-                       (aref calendar-french-special-days-array (1- d))
-                       y))
      (t (format
-         "%d %s an %d de la Révolution"
+         "%s %d %s an %d de la Révolution, jour %s"
+         (aref calendar-french-day-name-array (% (1- d) 10))
          d
          (aref calendar-french-month-name-array (1- m))
-         y)))))
+         y
+         (aref calendar-french-feasts-array (+ -31 (* 30 m) d)))))))
 
 ;;;###cal-autoload
 (defun calendar-french-print-date ()
@@ -186,7 +334,7 @@ calendar-french-goto-date
 Echo French Revolutionary date unless NOECHO is non-nil."
   (interactive
    (let* ((months calendar-french-month-name-array)
-          (special-days calendar-french-special-days-array)
+          (feasts calendar-french-feasts-array)
           (year (progn
                   (calendar-read-sexp
                    "Année de la Révolution (>0)"
@@ -199,29 +347,31 @@ calendar-french-goto-date
            (mapcar 'list
                    (append months
                            (if (calendar-french-leap-year-p year)
-                               (mapcar
-                                (lambda (x) (concat "Jour " x))
-                                calendar-french-special-days-array)
+                               (mapcar #'calendar-french-trim-feast feasts)
                              (reverse
                               (cdr ; we don't want rev. day in a non-leap yr
                                (reverse
-                                (mapcar
-                                 (lambda (x)
-                                   (concat "Jour " x))
-                                 special-days))))))))
+                                (mapcar #'calendar-french-trim-feast
+                                        feasts))))))))
           (completion-ignore-case t)
           (month (cdr (assoc-string
                        (completing-read
-                        "Mois ou Sansculottide: "
+                        "Mois ou \"jour complémentaire\" ou fête: "
                         month-list
                         nil t)
                        (calendar-make-alist month-list 1 'car) t)))
-          (day (if (> month 12)
-                   (- month 12)
+          (last-day (calendar-french-last-day-of-month (min month 13) year))
+          (day (if (> month 13)
+                   (- month 13)
                  (calendar-read-sexp
-                  "Jour (1-30)"
-                  (lambda (x) (and (<= 1 x) (<= x 30))))))
-          (month (if (> month 12) 13 month)))
+                  (format "Jour (1-%d): " last-day)
+                  (lambda (x) (<= 1 x last-day)))))
+          ;; All days in Vendémiaire and numbered 1 to 365 e.g., "Pomme"
+          ;; gives 31 Vendémiaire automatically normalized to 1 Brumaire
+          ;; "Céleri" gives 32 Vnd normalized to 2 Bru, "Raiponce" gives
+          ;; 61 Vnd normalized to 1 Frimaire, etc until "Récompences" which
+          ;; gives 365 Vnd normalized to 5 jour complémentaire.
+          (month (if (> month 13) 1 month)))
      (list (list month day year))))
   (calendar-goto-date (calendar-gregorian-from-absolute
                        (calendar-french-to-absolute date)))

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* bug#19174: Wishlist/suggestion for emacs/lisp/calendar/cal-french.el
  2021-06-09 14:11 ` bug#19174: Wishlist/suggestion for emacs/lisp/calendar/cal-french.el Mattias Engdegård
@ 2021-06-10  5:40   ` Jean Forget
  2021-06-10  9:09     ` Mattias Engdegård
  0 siblings, 1 reply; 15+ messages in thread
From: Jean Forget @ 2021-06-10  5:40 UTC (permalink / raw)
  To: Mattias Engdegård; +Cc: Glenn Morris, Lars Ingebrigtsen, 19174

Le 09/06/2021 à 16:11, Mattias Engdegård a écrit :
> I was curious about what the changes would entail, so I took the liberty 
> to adapt the patch to master; diff attached. (Sorry if I duplicated 
> someone's work.)
> 
> The addition of individual day names is obviously an improvement. As for 
> the rest, you should probably explain and defend them (which is not as 
> terrible as it sounds; we just want to know the reason).
> 
> For example, should the complementary days really be shown with day 
> numbers and day-of-week names, as they don't really belong to a week or 
> month? Shouldn't days, months etc be written in lower case since that's 
> the convention for French?
> 

Several years ago, somebody gave me a PDF file giving historical
events for each day of the French Revolutionary calendar.
I converted it to HTML and here is the result (English version):

http://datetime.mongueurs.net/Histoire/tit/titre-g.en.html

When you read the pages for the additional days, you see that
they are printed with a day number and a day-of-week name. See

http://datetime.mongueurs.net/Histoire/s-c/01-g.en.html

About lower case vs upper case: The French convention for
Revolutionary names may be different from the French convention
for Gregorian names. Most often, the revolutionary month names
and day names are printed with an initial capital letter.
Yet, there are exceptions. See the front page (link above)
which mentions the "9 floréal an 7" with a lower case "f".

See the links from

https://metacpan.org/pod/DateTime::Calendar::FrenchRevolutionary#Internet

(sorry, my email program has split the URL in two lines).

Jean Forget





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#19174: JEAN FORGET
  2021-06-09 10:07         ` Lars Ingebrigtsen
@ 2021-06-10  5:56           ` Jean Forget
  0 siblings, 0 replies; 15+ messages in thread
From: Jean Forget @ 2021-06-10  5:56 UTC (permalink / raw)
  To: assign; +Cc: Glenn Morris, Lars Ingebrigtsen, 19174

Le 09/06/2021 à 12:07, Lars Ingebrigtsen a écrit :
> Jean Forget <J2N-FORGET@orange.fr> writes:
> 
>>>> So are you interested by a patch for version 25.1 only?
>>> Sure.
>> Here it is.
> 
> Thanks.  This is too big to install in Emacs without assigning a
> copyright to the FSF.  Would you be willing to do so?
> 
> If so, the form below is how to get started.
> 
> 
> Please email the following information to assign@gnu.org, and we
> will send you the assignment form for your past and future changes.
> 
> Please use your full legal name (in ASCII characters) as the subject
> line of the message.
> ----------------------------------------------------------------------
> REQUEST: SEND FORM FOR PAST AND FUTURE CHANGES
> 
[What is the name of the program or package you're contributing to?]
Emacs

[Did you copy any files or text written by someone else in these changes?
Even if that material is free software, we need to know about it.]

The list of feasts was generated from Perl programs in
https://github.com/jforget/French-Revolution-calendar-utilities
and
https://github.com/jforget/DateTime-Calendar-FrenchRevolutionary

The origin of these names is
https://archive.org/details/decretdelaconven00fran_41
(with the help of Gérald Sédrati-Dinet).

[Do you have an employer who might have a basis to claim to own
your changes?  Do you attend a school which might make such a claim?]

No

[For the copyright registration, what country are you a citizen of?]

France

[What year were you born?]

1961

[Please write your email address here.]

J2N-FORGET@orange.fr

[Please write your postal address here.]
Jean Forget
23 rue d'Essling
F-92400 Courbevoie

[Which files have you changed so far, and which new files have you written
so far?]

lisp/calendar/cal-french.el





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#19174: Wishlist/suggestion for emacs/lisp/calendar/cal-french.el
  2021-06-10  5:40   ` Jean Forget
@ 2021-06-10  9:09     ` Mattias Engdegård
  2021-06-15  5:55       ` Jean Forget
  0 siblings, 1 reply; 15+ messages in thread
From: Mattias Engdegård @ 2021-06-10  9:09 UTC (permalink / raw)
  To: Jean Forget; +Cc: Glenn Morris, Lars Ingebrigtsen, 19174

10 juni 2021 kl. 07.40 skrev Jean Forget <J2N-FORGET@orange.fr>:

> http://datetime.mongueurs.net/Histoire/tit/titre-g.en.html
> 
> When you read the pages for the additional days, you see that
> they are printed with a day number and a day-of-week name.

Thank you, that is a primary source! Of course we know little about the context: it may have been written that way for sake of a uniform presentation. However, being no scholar of the republican calendar I will leave that judgement to you.

> About lower case vs upper case: The French convention for
> Revolutionary names may be different from the French convention
> for Gregorian names. Most often, the revolutionary month names
> and day names are printed with an initial capital letter.
> Yet, there are exceptions. See the front page (link above)
> which mentions the "9 floréal an 7" with a lower case "f".

Yes, it is a fair assumption that the usage conventions were less rigid in those days, and it can have been a matter of whether the words occurred in a title or in running text. The (French) Wikipédia article uses predominantly lower case but it obviously follows modern conventions. Again, your call.

Feel free to base your changes on my previously posted diff, but give it a good read-through so that the changes are indeed exactly those that you intended. Also, we'd be happy if you wrote some tests; test/lisp/calendar/cal-french-tests.el would be a suitable place.






^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#19174: Wishlist/suggestion for emacs/lisp/calendar/cal-french.el
  2021-06-10  9:09     ` Mattias Engdegård
@ 2021-06-15  5:55       ` Jean Forget
  2021-06-15 10:29         ` Mattias Engdegård
  0 siblings, 1 reply; 15+ messages in thread
From: Jean Forget @ 2021-06-15  5:55 UTC (permalink / raw)
  To: Mattias Engdegård; +Cc: Glenn Morris, Lars Ingebrigtsen, 19174

[-- Attachment #1: Type: text/plain, Size: 2574 bytes --]

Le 10/06/2021 à 11:09, Mattias Engdegård a écrit :
> 10 juni 2021 kl. 07.40 skrev Jean Forget <J2N-FORGET@orange.fr>:
> 
>> http://datetime.mongueurs.net/Histoire/tit/titre-g.en.html
>>
>> When you read the pages for the additional days, you see that
>> they are printed with a day number and a day-of-week name.
> 
> Thank you, that is a primary source! Of course we know little about the context: it may have been written that way for sake of a uniform presentation. However, being no scholar of the republican calendar I will leave that judgement to you.
> 
>> About lower case vs upper case: The French convention for
>> Revolutionary names may be different from the French convention
>> for Gregorian names. Most often, the revolutionary month names
>> and day names are printed with an initial capital letter.
>> Yet, there are exceptions. See the front page (link above)
>> which mentions the "9 floréal an 7" with a lower case "f".
> 
> Yes, it is a fair assumption that the usage conventions were less rigid in those days, and it can have been a matter of whether the words occurred in a title or in running text. The (French) Wikipédia article uses predominantly lower case but it obviously follows modern conventions. Again, your call.
> 
> Feel free to base your changes on my previously posted diff, but give it a good read-through so that the changes are indeed exactly those that you intended. Also, we'd be happy if you wrote some tests; test/lisp/calendar/cal-french-tests.el would be a suitable place.
> 

About tests: I am much more used to Perl usages and habits than Lisp.
So the attached Emacs-Lisp file behaves like a Perl module test file.
I have not yet looked at what a real E-Lisp test file looks like.

About lower case vs caps: in my previous message, I have forgotten
to mention another reason I used caps. As I am more a programmer than
an historian, I have opted for ease of programming (not for me, but
for Emacs users). It is easy to convert a capitalized string to
lowercase, it is more difficult to convert a lowercase string to
capitalised, especially with composite words such as "jour de la
Pomme de terre" or "jour du Laurier-thym". If I provide capitalised
strings, the Emacs user can choose between doing nothing and getting
a capitalised string or doing a basic and easy "to-lower" transformation
and getting a lowercase string.

About reading your posted diff: I have not had the time to read it
for now. Also, I may install a recent Emacs version on a virtual
machine, apply your diff and check that it works.

Jean Forget

[-- Attachment #2: verif-calfrench.el --]
[-- Type: text/x-emacs-lisp, Size: 10712 bytes --]

#!/usr/bin/emacs --script
; -*- encoding: utf-8; indent-tabs-mode: nil -*-
;
; Generated test file for the Emacs cal-french.el program.
; Fichier de test généré pour tester le programme cal-french.el de Emacs
;
; Copyright (C) 2014, 2021 Jean Forget
;
; Author: Jean Forget
; Maintainer: Jean Forget
; Keywords: French Revolution, calendar
;
; This program is free software; you can redistribute it and modify
; it under the terms of Emacs:
; the GNU General Public License as published by
; the Free Software Foundation; version 3, or (at your option)
; any later version,
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with GNU Emacs; see the file COPYING. If not, see <http://www.gnu.org/licenses/>.
(require 'cal-french)
(defvar cal-french-check-num 0)
(defun ymd-to-mdy (date)
  "Convert the date from the logical format to the funny format"
  (let ((y (car date))
        (m (cadr date))
        (d (nth 2 date)))
        (list m d y))
)
(defun cal-french-check-unit (date expected-string)
  "Unit check for cal-french.el"
  (let ((actual-string (calendar-french-date-string (ymd-to-mdy date))))
         (setq cal-french-check-num (1+ cal-french-check-num))
         (cond ((equal expected-string actual-string)
                    (princ (format "ok %d
" cal-french-check-num)))
               (t
                    (princ (format "not ok %d got %s expected %s
" cal-french-check-num actual-string expected-string)))
         )
  )
)
(defun cal-french-check ()
   "Self-check for cal-french.el"
    (cal-french-check-unit '(1792  9 22) "Primidi 1 Vendémiaire an 1 de la Révolution, jour du Raisin")
    (cal-french-check-unit '(1793 10 23) "Duodi 2 Brumaire an 2 de la Révolution, jour du Céleri")
    (cal-french-check-unit '(1794  7 27) "Nonidi 9 Thermidor an 2 de la Révolution, jour de la Mûre")
    (cal-french-check-unit '(1794 11 23) "Tridi 3 Frimaire an 3 de la Révolution, jour de la Chicorée")
    (cal-french-check-unit '(1795 10  5) "Tridi 13 Vendémiaire an 4 de la Révolution, jour du Potiron")
    (cal-french-check-unit '(1795 12 25) "Quartidi 4 Nivôse an 4 de la Révolution, jour du Soufre")
    (cal-french-check-unit '(1797  1 24) "Quintidi 5 Pluviôse an 5 de la Révolution, jour du Taureau")
    (cal-french-check-unit '(1798  2 24) "Sextidi 6 Ventôse an 6 de la Révolution, jour de l'Asaret")
    (cal-french-check-unit '(1799 11  9) "Octidi 18 Brumaire an 8 de la Révolution, jour de la Dentelaire")
    (cal-french-check-unit '(1801  3 29) "Octidi 8 Germinal an 9 de la Révolution, jour de la Jonquille")
    (cal-french-check-unit '(1804  4 30) "Décadi 10 Floréal an 12 de la Révolution, jour du Rateau")
    (cal-french-check-unit '(1807  6  1) "Duodi 12 Prairial an 15 de la Révolution, jour de la Bétoine")
    (cal-french-check-unit '(1810  7  3) "Quartidi 14 Messidor an 18 de la Révolution, jour de la Lavande")
    (cal-french-check-unit '(1813  8  4) "Sextidi 16 Thermidor an 21 de la Révolution, jour de la Guimauve")
    (cal-french-check-unit '(1816  9  4) "Octidi 18 Fructidor an 24 de la Révolution, jour du Nerprun")
    (cal-french-check-unit '(2000  1  1) "Duodi 12 Nivôse an 208 de la Révolution, jour de l'Argile")
    (cal-french-check-unit '(2021  7 11) "Tridi 23 Messidor an 229 de la Révolution, jour des Haricots")
    (cal-french-check-unit '(2001  5 11) "Duodi 22 Floréal an 209 de la Révolution, jour de la Fritillaire")
    (cal-french-check-unit '(1792  9 22) "Primidi 1 Vendémiaire an 1 de la Révolution, jour du Raisin")
    (cal-french-check-unit '(1793  9 21) "Quintidi 5 jour complémentaire an 1 de la Révolution, jour des Récompenses")
    (cal-french-check-unit '(1793  9 22) "Primidi 1 Vendémiaire an 2 de la Révolution, jour du Raisin")
    (cal-french-check-unit '(1794  9 21) "Quintidi 5 jour complémentaire an 2 de la Révolution, jour des Récompenses")
    (cal-french-check-unit '(1794  9 22) "Primidi 1 Vendémiaire an 3 de la Révolution, jour du Raisin")
    (cal-french-check-unit '(1795  9 22) "Sextidi 6 jour complémentaire an 3 de la Révolution, jour de la Révolution")
    (cal-french-check-unit '(1795  9 23) "Primidi 1 Vendémiaire an 4 de la Révolution, jour du Raisin")
    (cal-french-check-unit '(1796  9 21) "Quintidi 5 jour complémentaire an 4 de la Révolution, jour des Récompenses")
    (cal-french-check-unit '(1796  9 22) "Primidi 1 Vendémiaire an 5 de la Révolution, jour du Raisin")
    (cal-french-check-unit '(1797  9 21) "Quintidi 5 jour complémentaire an 5 de la Révolution, jour des Récompenses")
    (cal-french-check-unit '(1797  9 22) "Primidi 1 Vendémiaire an 6 de la Révolution, jour du Raisin")
    (cal-french-check-unit '(1799  9 22) "Sextidi 6 jour complémentaire an 7 de la Révolution, jour de la Révolution")
    (cal-french-check-unit '(1799  9 23) "Primidi 1 Vendémiaire an 8 de la Révolution, jour du Raisin")
    (cal-french-check-unit '(1800  9 22) "Quintidi 5 jour complémentaire an 8 de la Révolution, jour des Récompenses")
    (cal-french-check-unit '(1800  9 23) "Primidi 1 Vendémiaire an 9 de la Révolution, jour du Raisin")
    (cal-french-check-unit '(1801  9 22) "Quintidi 5 jour complémentaire an 9 de la Révolution, jour des Récompenses")
    (cal-french-check-unit '(1801  9 23) "Primidi 1 Vendémiaire an 10 de la Révolution, jour du Raisin")
    (cal-french-check-unit '(1823  9 22) "Quintidi 5 jour complémentaire an 31 de la Révolution, jour des Récompenses")
    (cal-french-check-unit '(1823  9 23) "Primidi 1 Vendémiaire an 32 de la Révolution, jour du Raisin")
    (cal-french-check-unit '(1824  9 22) "Sextidi 6 jour complémentaire an 32 de la Révolution, jour de la Révolution")
    (cal-french-check-unit '(1824  9 23) "Primidi 1 Vendémiaire an 33 de la Révolution, jour du Raisin")
    (cal-french-check-unit '(1825  9 22) "Quintidi 5 jour complémentaire an 33 de la Révolution, jour des Récompenses")
    (cal-french-check-unit '(1825  9 23) "Primidi 1 Vendémiaire an 34 de la Révolution, jour du Raisin")
    (cal-french-check-unit '(1892  9 21) "Quintidi 5 jour complémentaire an 100 de la Révolution, jour des Récompenses")
    (cal-french-check-unit '(1892  9 22) "Primidi 1 Vendémiaire an 101 de la Révolution, jour du Raisin")
    (cal-french-check-unit '(1900  9 22) "Sextidi 6 jour complémentaire an 108 de la Révolution, jour de la Révolution")
    (cal-french-check-unit '(1900  9 23) "Primidi 1 Vendémiaire an 109 de la Révolution, jour du Raisin")
    (cal-french-check-unit '(1992  9 21) "Quintidi 5 jour complémentaire an 200 de la Révolution, jour des Récompenses")
    (cal-french-check-unit '(1992  9 22) "Primidi 1 Vendémiaire an 201 de la Révolution, jour du Raisin")
    (cal-french-check-unit '(2000  9 21) "Sextidi 6 jour complémentaire an 208 de la Révolution, jour de la Révolution")
    (cal-french-check-unit '(2000  9 22) "Primidi 1 Vendémiaire an 209 de la Révolution, jour du Raisin")
    (cal-french-check-unit '(2092  9 20) "Quintidi 5 jour complémentaire an 300 de la Révolution, jour des Récompenses")
    (cal-french-check-unit '(2092  9 21) "Primidi 1 Vendémiaire an 301 de la Révolution, jour du Raisin")
    (cal-french-check-unit '(2100  9 21) "Sextidi 6 jour complémentaire an 308 de la Révolution, jour de la Révolution")
    (cal-french-check-unit '(2100  9 22) "Primidi 1 Vendémiaire an 309 de la Révolution, jour du Raisin")
    (cal-french-check-unit '(2192  9 21) "Sextidi 6 jour complémentaire an 400 de la Révolution, jour de la Révolution")
    (cal-french-check-unit '(2192  9 22) "Primidi 1 Vendémiaire an 401 de la Révolution, jour du Raisin")
    (cal-french-check-unit '(2193  9 21) "Quintidi 5 jour complémentaire an 401 de la Révolution, jour des Récompenses")
    (cal-french-check-unit '(2199  9 22) "Primidi 1 Vendémiaire an 408 de la Révolution, jour du Raisin")
    (cal-french-check-unit '(2200  9 22) "Sextidi 6 jour complémentaire an 408 de la Révolution, jour de la Révolution")
    (cal-french-check-unit '(2791  9 23) "Primidi 1 Vendémiaire an 1000 de la Révolution, jour du Raisin")
    (cal-french-check-unit '(2792  9 22) "Primidi 1 Vendémiaire an 1001 de la Révolution, jour du Raisin")
    (cal-french-check-unit '(3000  1  1) "Duodi 12 Nivôse an 1208 de la Révolution, jour de l'Argile")
    (cal-french-check-unit '(3001  1  1) "Primidi 11 Nivôse an 1209 de la Révolution, jour du Granit")
    (cal-french-check-unit '(3791  9 22) "Primidi 1 Vendémiaire an 2000 de la Révolution, jour du Raisin")
    (cal-french-check-unit '(3792  9 22) "Primidi 1 Vendémiaire an 2001 de la Révolution, jour du Raisin")
    (cal-french-check-unit '(4000  1  1) "Duodi 12 Nivôse an 2208 de la Révolution, jour de l'Argile")
    (cal-french-check-unit '(4001  1  1) "Duodi 12 Nivôse an 2209 de la Révolution, jour de l'Argile")
    (cal-french-check-unit '(4320  9 10) "Quartidi 24 Fructidor an 2528 de la Révolution, jour du Sorgho")
    (cal-french-check-unit '(4320  9 11) "Quintidi 25 Fructidor an 2528 de la Révolution, jour de l'Écrevisse")
    (cal-french-check-unit '(4791  9 23) "Primidi 1 Vendémiaire an 3000 de la Révolution, jour du Raisin")
    (cal-french-check-unit '(4792  9 22) "Primidi 1 Vendémiaire an 3001 de la Révolution, jour du Raisin")
    (cal-french-check-unit '(5000  1  1) "Duodi 12 Nivôse an 3208 de la Révolution, jour de l'Argile")
    (cal-french-check-unit '(5001  1  1) "Primidi 11 Nivôse an 3209 de la Révolution, jour du Granit")
    (cal-french-check-unit '(5791  9 22) "Primidi 1 Vendémiaire an 4000 de la Révolution, jour du Raisin")
    (cal-french-check-unit '(5792  9 21) "Primidi 1 Vendémiaire an 4001 de la Révolution, jour du Raisin")
    (cal-french-check-unit '(6000  1  1) "Tridi 13 Nivôse an 4208 de la Révolution, jour de l'Ardoise")
    (cal-french-check-unit '(6001  1  1) "Tridi 13 Nivôse an 4209 de la Révolution, jour de l'Ardoise")
    (cal-french-check-unit '(6791  9 22) "Primidi 1 Vendémiaire an 5000 de la Révolution, jour du Raisin")
    (cal-french-check-unit '(6792  9 21) "Primidi 1 Vendémiaire an 5001 de la Révolution, jour du Raisin")
    (cal-french-check-unit '(7791  9 21) "Primidi 1 Vendémiaire an 6000 de la Révolution, jour du Raisin")
    (cal-french-check-unit '(7792  9 21) "Primidi 1 Vendémiaire an 6001 de la Révolution, jour du Raisin")
)
(message "%s" "c est parti
")
(cal-french-check)

^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#19174: Wishlist/suggestion for emacs/lisp/calendar/cal-french.el
  2021-06-15  5:55       ` Jean Forget
@ 2021-06-15 10:29         ` Mattias Engdegård
  2021-06-15 13:58           ` Lars Ingebrigtsen
  0 siblings, 1 reply; 15+ messages in thread
From: Mattias Engdegård @ 2021-06-15 10:29 UTC (permalink / raw)
  To: Jean Forget; +Cc: Glenn Morris, Lars Ingebrigtsen, 19174

[-- Attachment #1: Type: text/plain, Size: 714 bytes --]

15 juni 2021 kl. 07.55 skrev Jean Forget <J2N-FORGET@orange.fr>:

> About tests: I am much more used to Perl usages and habits than Lisp.
> So the attached Emacs-Lisp file behaves like a Perl module test file.
> I have not yet looked at what a real E-Lisp test file looks like.

That's fine, nobody expects you to know that! Attached is your test translated into the standard style; it would go in `lisp/test/calendar/cal-french-tests.el`.

> It is easy to convert a capitalized string to
> lowercase, it is more difficult to convert a lowercase string to
> capitalised, especially with composite words such as "jour de la
> Pomme de terre" or "jour du Laurier-thym".

That's perfectly reasonable.


[-- Attachment #2: cal-french-tests.el --]
[-- Type: application/octet-stream, Size: 7842 bytes --]

;;; cal-french-tests.el --- tests for cal-french.el  -*- lexical-binding: t -*-

;; Copyright (C) 2021 Free Software Foundation, Inc.

;; This file is part of GNU Emacs.

;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.

;;; Code:

(require 'ert)
(require 'cal-french)

(defconst cal-french-test-cases
  '(
 (1792  9 22 "Primidi 1 Vendémiaire an 1 de la Révolution, jour du Raisin")
 (1793 10 23 "Duodi 2 Brumaire an 2 de la Révolution, jour du Céleri")
 (1794  7 27 "Nonidi 9 Thermidor an 2 de la Révolution, jour de la Mûre")
 (1794 11 23 "Tridi 3 Frimaire an 3 de la Révolution, jour de la Chicorée")
 (1795 10  5 "Tridi 13 Vendémiaire an 4 de la Révolution, jour du Potiron")
 (1795 12 25 "Quartidi 4 Nivôse an 4 de la Révolution, jour du Soufre")
 (1797  1 24 "Quintidi 5 Pluviôse an 5 de la Révolution, jour du Taureau")
 (1798  2 24 "Sextidi 6 Ventôse an 6 de la Révolution, jour de l'Asaret")
 (1799 11  9 "Octidi 18 Brumaire an 8 de la Révolution, jour de la Dentelaire")
 (1801  3 29 "Octidi 8 Germinal an 9 de la Révolution, jour de la Jonquille")
 (1804  4 30 "Décadi 10 Floréal an 12 de la Révolution, jour du Rateau")
 (1807  6  1 "Duodi 12 Prairial an 15 de la Révolution, jour de la Bétoine")
 (1810  7  3 "Quartidi 14 Messidor an 18 de la Révolution, jour de la Lavande")
 (1813  8  4 "Sextidi 16 Thermidor an 21 de la Révolution, jour de la Guimauve")
 (1816  9  4 "Octidi 18 Fructidor an 24 de la Révolution, jour du Nerprun")
 (2000  1  1 "Duodi 12 Nivôse an 208 de la Révolution, jour de l'Argile")
 (2021  7 11 "Tridi 23 Messidor an 229 de la Révolution, jour des Haricots")
 (2001  5 11 "Duodi 22 Floréal an 209 de la Révolution, jour de la Fritillaire")
 (1792  9 22 "Primidi 1 Vendémiaire an 1 de la Révolution, jour du Raisin")
 (1793  9 21 "Quintidi 5 jour complémentaire an 1 de la Révolution, jour des Récompenses")
 (1793  9 22 "Primidi 1 Vendémiaire an 2 de la Révolution, jour du Raisin")
 (1794  9 21 "Quintidi 5 jour complémentaire an 2 de la Révolution, jour des Récompenses")
 (1794  9 22 "Primidi 1 Vendémiaire an 3 de la Révolution, jour du Raisin")
 (1795  9 22 "Sextidi 6 jour complémentaire an 3 de la Révolution, jour de la Révolution")
 (1795  9 23 "Primidi 1 Vendémiaire an 4 de la Révolution, jour du Raisin")
 (1796  9 21 "Quintidi 5 jour complémentaire an 4 de la Révolution, jour des Récompenses")
 (1796  9 22 "Primidi 1 Vendémiaire an 5 de la Révolution, jour du Raisin")
 (1797  9 21 "Quintidi 5 jour complémentaire an 5 de la Révolution, jour des Récompenses")
 (1797  9 22 "Primidi 1 Vendémiaire an 6 de la Révolution, jour du Raisin")
 (1799  9 22 "Sextidi 6 jour complémentaire an 7 de la Révolution, jour de la Révolution")
 (1799  9 23 "Primidi 1 Vendémiaire an 8 de la Révolution, jour du Raisin")
 (1800  9 22 "Quintidi 5 jour complémentaire an 8 de la Révolution, jour des Récompenses")
 (1800  9 23 "Primidi 1 Vendémiaire an 9 de la Révolution, jour du Raisin")
 (1801  9 22 "Quintidi 5 jour complémentaire an 9 de la Révolution, jour des Récompenses")
 (1801  9 23 "Primidi 1 Vendémiaire an 10 de la Révolution, jour du Raisin")
 (1823  9 22 "Quintidi 5 jour complémentaire an 31 de la Révolution, jour des Récompenses")
 (1823  9 23 "Primidi 1 Vendémiaire an 32 de la Révolution, jour du Raisin")
 (1824  9 22 "Sextidi 6 jour complémentaire an 32 de la Révolution, jour de la Révolution")
 (1824  9 23 "Primidi 1 Vendémiaire an 33 de la Révolution, jour du Raisin")
 (1825  9 22 "Quintidi 5 jour complémentaire an 33 de la Révolution, jour des Récompenses")
 (1825  9 23 "Primidi 1 Vendémiaire an 34 de la Révolution, jour du Raisin")
 (1892  9 21 "Quintidi 5 jour complémentaire an 100 de la Révolution, jour des Récompenses")
 (1892  9 22 "Primidi 1 Vendémiaire an 101 de la Révolution, jour du Raisin")
 (1900  9 22 "Sextidi 6 jour complémentaire an 108 de la Révolution, jour de la Révolution")
 (1900  9 23 "Primidi 1 Vendémiaire an 109 de la Révolution, jour du Raisin")
 (1992  9 21 "Quintidi 5 jour complémentaire an 200 de la Révolution, jour des Récompenses")
 (1992  9 22 "Primidi 1 Vendémiaire an 201 de la Révolution, jour du Raisin")
 (2000  9 21 "Sextidi 6 jour complémentaire an 208 de la Révolution, jour de la Révolution")
 (2000  9 22 "Primidi 1 Vendémiaire an 209 de la Révolution, jour du Raisin")
 (2092  9 20 "Quintidi 5 jour complémentaire an 300 de la Révolution, jour des Récompenses")
 (2092  9 21 "Primidi 1 Vendémiaire an 301 de la Révolution, jour du Raisin")
 (2100  9 21 "Sextidi 6 jour complémentaire an 308 de la Révolution, jour de la Révolution")
 (2100  9 22 "Primidi 1 Vendémiaire an 309 de la Révolution, jour du Raisin")
 (2192  9 21 "Sextidi 6 jour complémentaire an 400 de la Révolution, jour de la Révolution")
 (2192  9 22 "Primidi 1 Vendémiaire an 401 de la Révolution, jour du Raisin")
 (2193  9 21 "Quintidi 5 jour complémentaire an 401 de la Révolution, jour des Récompenses")
 (2199  9 22 "Primidi 1 Vendémiaire an 408 de la Révolution, jour du Raisin")
 (2200  9 22 "Sextidi 6 jour complémentaire an 408 de la Révolution, jour de la Révolution")
 (2791  9 23 "Primidi 1 Vendémiaire an 1000 de la Révolution, jour du Raisin")
 (2792  9 22 "Primidi 1 Vendémiaire an 1001 de la Révolution, jour du Raisin")
 (3000  1  1 "Duodi 12 Nivôse an 1208 de la Révolution, jour de l'Argile")
 (3001  1  1 "Primidi 11 Nivôse an 1209 de la Révolution, jour du Granit")
 (3791  9 22 "Primidi 1 Vendémiaire an 2000 de la Révolution, jour du Raisin")
 (3792  9 22 "Primidi 1 Vendémiaire an 2001 de la Révolution, jour du Raisin")
 (4000  1  1 "Duodi 12 Nivôse an 2208 de la Révolution, jour de l'Argile")
 (4001  1  1 "Duodi 12 Nivôse an 2209 de la Révolution, jour de l'Argile")
 (4320  9 10 "Quartidi 24 Fructidor an 2528 de la Révolution, jour du Sorgho")
 (4320  9 11 "Quintidi 25 Fructidor an 2528 de la Révolution, jour de l'Écrevisse")
 (4791  9 23 "Primidi 1 Vendémiaire an 3000 de la Révolution, jour du Raisin")
 (4792  9 22 "Primidi 1 Vendémiaire an 3001 de la Révolution, jour du Raisin")
 (5000  1  1 "Duodi 12 Nivôse an 3208 de la Révolution, jour de l'Argile")
 (5001  1  1 "Primidi 11 Nivôse an 3209 de la Révolution, jour du Granit")
 (5791  9 22 "Primidi 1 Vendémiaire an 4000 de la Révolution, jour du Raisin")
 (5792  9 21 "Primidi 1 Vendémiaire an 4001 de la Révolution, jour du Raisin")
 (6000  1  1 "Tridi 13 Nivôse an 4208 de la Révolution, jour de l'Ardoise")
 (6001  1  1 "Tridi 13 Nivôse an 4209 de la Révolution, jour de l'Ardoise")
 (6791  9 22 "Primidi 1 Vendémiaire an 5000 de la Révolution, jour du Raisin")
 (6792  9 21 "Primidi 1 Vendémiaire an 5001 de la Révolution, jour du Raisin")
 (7791  9 21 "Primidi 1 Vendémiaire an 6000 de la Révolution, jour du Raisin")
 (7792  9 21 "Primidi 1 Vendémiaire an 6001 de la Révolution, jour du Raisin")
    )) 

(ert-deftest cal-french-tests ()
  (pcase-dolist (`(,y ,m ,d ,str) cal-french-test-cases)
    (should (equal (calendar-french-date-string (list m d y)) str))))

(provide 'cal-french-tests)

^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#19174: Wishlist/suggestion for emacs/lisp/calendar/cal-french.el
  2021-06-15 10:29         ` Mattias Engdegård
@ 2021-06-15 13:58           ` Lars Ingebrigtsen
  2021-07-23 13:27             ` Lars Ingebrigtsen
  0 siblings, 1 reply; 15+ messages in thread
From: Lars Ingebrigtsen @ 2021-06-15 13:58 UTC (permalink / raw)
  To: Mattias Engdegård; +Cc: Jean Forget, Glenn Morris, 19174

Mattias Engdegård <mattiase@acm.org> writes:

> That's fine, nobody expects you to know that! Attached is your test
> translated into the standard style; it would go in
> `lisp/test/calendar/cal-french-tests.el`.

OK, then we just have to wait for Jean's copyright paperwork to
complete, and then we can push the patch (and test cases) to Emacs 28, I
guess...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#19174: Wishlist/suggestion for emacs/lisp/calendar/cal-french.el
  2021-06-15 13:58           ` Lars Ingebrigtsen
@ 2021-07-23 13:27             ` Lars Ingebrigtsen
  0 siblings, 0 replies; 15+ messages in thread
From: Lars Ingebrigtsen @ 2021-07-23 13:27 UTC (permalink / raw)
  To: Mattias Engdegård; +Cc: Jean Forget, Glenn Morris, 19174

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Mattias Engdegård <mattiase@acm.org> writes:
>
>> That's fine, nobody expects you to know that! Attached is your test
>> translated into the standard style; it would go in
>> `lisp/test/calendar/cal-french-tests.el`.
>
> OK, then we just have to wait for Jean's copyright paperwork to
> complete, and then we can push the patch (and test cases) to Emacs 28, I
> guess...

And the paperwork was completed a month ago, so I've now pushed Jean's
patch with Mattias' changes to the trunk.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2021-07-23 13:27 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-24 21:01 bug#19174: Wishlist/suggestion for emacs/lisp/calendar/cal-french.el Jean Forget
2014-11-26 19:14 ` Glenn Morris
2021-05-28  2:00 ` Lars Ingebrigtsen
2021-06-07 19:32   ` Jean Forget
2021-06-08  9:34     ` Lars Ingebrigtsen
2021-06-08 17:47       ` Jean Forget
2021-06-09 10:07         ` Lars Ingebrigtsen
2021-06-10  5:56           ` bug#19174: JEAN FORGET Jean Forget
2021-06-09 14:11 ` bug#19174: Wishlist/suggestion for emacs/lisp/calendar/cal-french.el Mattias Engdegård
2021-06-10  5:40   ` Jean Forget
2021-06-10  9:09     ` Mattias Engdegård
2021-06-15  5:55       ` Jean Forget
2021-06-15 10:29         ` Mattias Engdegård
2021-06-15 13:58           ` Lars Ingebrigtsen
2021-07-23 13:27             ` Lars Ingebrigtsen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.