Commit 5eb1e2b5 authored by David Byers's avatar David Byers
Browse files

Bug 924 more or less done. Customization is still not implemented.

parent 308fd481
2002-12-09 David Byers <david.byers@swipnet.se>
Work on bug 924:
* vars.el.in (kom-show-namedays): Updated documentation.
* commands1.el (kom-display-time): Display namedays in all
languages.
* names.el: New file.
Added namedays for swedish, pre-1901 swedish, finnish,
finlandssvenska and finnish orthodox. Thanks to Linus Sjöberg and
Hans Persson for the data.
(lyskom-nameday): Moved here from commands1.el. Made
language-independent (the code had hard-coded swedish strings).
(lyskom-define-namedays): New function.
Bug 923:
* vars.el.in (kom-url-transformation-rules): New variable.
......
......@@ -86,6 +86,7 @@ SOURCES = komtypes.el \
parse.el \
cache.el \
view-mode.el \
names.el \
commands1.el \
commands2.el \
review.el \
......
......@@ -2351,7 +2351,7 @@ If MARK-NO is nil, review all marked texts."
;;;
;;; +++ FIXME specialhack för svenska. Borde det generaliseras?
;;;
(when (and (eq lyskom-language 'sv) kom-show-namedays)
(when kom-show-namedays
(let ((tmp (lyskom-nameday time)))
(when tmp
(lyskom-insert "\n")
......@@ -2366,398 +2366,7 @@ If MARK-NO is nil, review all marked texts."
; (nameday (lyskom-nameday time))
; (special (lyskom-special-date time)))
; ))
(defvar lyskom-nameday-alist
'((1 . ((1 . ())
(2 . ("Svea"))
(3 . ("Alfred" "Alfrida"))
(4 . ("Rut"))
(5 . ("Hanna" "Hannele"))
(6 . ("Kasper" "Melker" "Baltsar"))
(7 . ("August" "Augusta"))
(8 . ("Erland"))
(9 . ("Gunnar" "Gunder"))
(10 . ("Sigurd" "Sigbritt"))
(11 . ("Jan" "Jannike"))
(12 . ("Frideborg" "Fridolf"))
(13 . ("Knut"))
(14 . ("Felix" "Felicia"))
(15 . ("Laura" "Lorentz"))
(16 . ("Hjalmar" "Helmer"))
(17 . ("Anton" "Tony"))
(18 . ("Hilda" "Hildur"))
(19 . ("Henrik"))
(20 . ("Fabian" "Sebastian"))
(21 . ("Agnes" "Agneta"))
(22 . ("Vincent" "Viktor"))
(23 . ("Frej" "Freja"))
(24 . ("Erika"))
(25 . ("Paul" "Pål"))
(26 . ("Bodil" "Boel"))
(27 . ("Göte" "Göta"))
(28 . ("Karl" "Karla"))
(29 . ("Diana"))
(30 . ("Gunilla" "Gunhild"))
(31 . ("Ivar" "Joar"))))
(2 . ((1 . ("Max" "Maximilian"))
(2 . ())
(3 . ("Disa" "Hjördis"))
(4 . ("Ansgar" "Anselm"))
(5 . ("Agata" "Agda"))
(6 . ("Dorotea" "Doris"))
(7 . ("Rikard" "Dick"))
(8 . ("Berta" "Bert"))
(9 . ("Fanny" "Franciska"))
(10 . ("Iris"))
(11 . ("Yngve" "Inge"))
(12 . ("Evelina" "Evy"))
(13 . ("Agne" "Ove"))
(14 . ("Valentin"))
(15 . ("Sigfrid"))
(16 . ("Julia" "Julius"))
(17 . ("Alexandra" "Sandra"))
(18 . ("Frida" "Fritiof"))
(19 . ("Gabriella" "Ella"))
(20 . ("Vivianne"))
(21 . ("Hilding"))
(22 . ("Pia"))
(23 . ("Torsten" "Torun"))
(24 . ("Mattias" "Mats"))
(25 . ("Sigvard" "Sivert"))
(26 . ("Torgny" "Torkel"))
(27 . ("Lage"))
(28 . ("Maria"))))
(3 . ((1 . ("Albin" "Elvira"))
(2 . ("Ernst" "Erna"))
(3 . ("Gunborg" "Gunvor"))
(4 . ("Adrian" "Adriana"))
(5 . ("Tora" "Tove"))
(6 . ("Ebba" "Ebbe"))
(7 . ("Camilla"))
(8 . ("Siv"))
(9 . ("Torbjörn" "Torleif"))
(10 . ("Edla" "Ada"))
(11 . ("Edvin" "Egon"))
(12 . ("Viktoria"))
(13 . ("Greger"))
(14 . ("Matilda" "Maud"))
(15 . ("Kristoffer" "Christel"))
(16 . ("Herbert" "Gilbert"))
(17 . ("Gertrud"))
(18 . ("Edvard" "Edmund"))
(19 . ("Josef" "Josefina"))
(20 . ("Joakim" "Kim"))
(21 . ("Bengt"))
(22 . ("Kennet" "Kent"))
(23 . ("Gerda" "Gerd"))
(24 . ("Gabriel" "Rafael"))
(25 . ())
(26 . ("Emanuel"))
(27 . ("Rudolf" "Ralf"))
(28 . ("Malkolm" "Morgan"))
(29 . ("Jonas" "Jens"))
(30 . ("Holger" "Holmfrid"))
(31 . ("Ester"))))
(4 . ((1 . ("Harald" "Hervor"))
(2 . ("Gudmund" "Ingesund"))
(3 . ("Ferdinand" "Nanna"))
(4 . ("Marianne" "Marlene"))
(5 . ("Irene" "Irja"))
(6 . ("Vilhelm" "Helmi"))
(7 . ("Irma" "Irmelin"))
(8 . ("Nadja" "Tanja"))
(9 . ("Otto" "Ottilia"))
(10 . ("Ingvar" "Ingvor"))
(11 . ("Ulf" "Ylva"))
(12 . ("Liv"))
(13 . ("Artur" "Douglas"))
(14 . ("Tiburtius"))
(15 . ("Olivia" "Oliver"))
(16 . ("Patrik" "Patricia"))
(17 . ("Elias" "Elis"))
(18 . ("Valdemar" "Volmar"))
(19 . ("Olaus" "Ola"))
(20 . ("Amalia" "Amelie"))
(21 . ("Anneli" "Annika"))
(22 . ("Allan" "Glenn"))
(23 . ("Georg" "Göran"))
(24 . ("Vega"))
(25 . ("Markus"))
(26 . ("Teresia" "Terese"))
(27 . ("Engelbrekt"))
(28 . ("Ture" "Tyra"))
(29 . ("Tyko"))
(30 . ("Mariana"))))
(5 . ((1 . ("Valborg"))
(2 . ("Filip" "Filippa"))
(3 . ("John" "Jane"))
(4 . ("Monika" "Mona"))
(5 . ("Gotthard" "Erhard"))
(6 . ("Marit" "Rita"))
(7 . ("Carina" "Carita"))
(8 . ("Åke"))
(9 . ("Reidar" "Reidun"))
(10 . ("Esbjörn" "Styrbjörn"))
(11 . ("Märta" "Märit"))
(12 . ("Charlotta" "Lotta"))
(13 . ("Linnea" "Linn"))
(14 . ("Halvard" "Halvar"))
(15 . ("Sofia" "Sonja"))
(16 . ("Ronald" "Ronny"))
(17 . ("Rebecka" "Ruben"))
(18 . ("Erik"))
(19 . ("Maj" "Majken"))
(20 . ("Karolina" "Carola"))
(21 . ("Konstantin" "Conny"))
(22 . ("Hemming" "Henning"))
(23 . ("Desideria" "Desiree"))
(24 . ("Ivan" "Vanja"))
(25 . ("Urban"))
(26 . ("Vilhelmina" "Vilma"))
(27 . ("Beda" "Blenda"))
(28 . ("Ingeborg" "Borghild"))
(29 . ("Yvonne" "Jeanette"))
(30 . ("Vera" "Veronika"))
(31 . ("Petronella" "Pernilla"))))
(6 . ((1 . ("Gun" "Gunnel"))
(2 . ("Rutger" "Roger"))
(3 . ("Ingemar" "Gudmar"))
(4 . ("Solbritt" "Solveig"))
(5 . ("Bo"))
(6 . ("Gustav" "Gösta"))
(7 . ("Robert" "Robin"))
(8 . ("Eivor" "Majvor"))
(9 . ("Börje" "Birger"))
(10 . ("Svante" "Boris"))
(11 . ("Bertil" "Berthold"))
(12 . ("Eskil"))
(13 . ("Aina" "Aino"))
(14 . ("Håkan" "Hakon"))
(15 . ("Margit" "Margot"))
(16 . ("Axel" "Axelina"))
(17 . ("Torborg" "Torvald"))
(18 . ("Björn" "Bjarne"))
(19 . ("Germund" "Görel"))
(20 . ("Linda"))
(21 . ("Alf" "Alvar"))
(22 . ("Paulina" "Paula"))
(23 . ("Adolf" "Alice"))
(24 . ())
(25 . ("David" "Salomon"))
(26 . ("Rakel" "Lea"))
(27 . ("Selma" "Fingal"))
(28 . ("Leo"))
(29 . ("Peter" "Petra"))
(30 . ("Elof" "Leif"))))
(7 . ((1 . ("Aron" "Mirjam"))
(2 . ("Rosa" "Rosita"))
(3 . ("Aurora"))
(4 . ("Ulrika" "Ulla"))
(5 . ("Laila" "Ritva"))
(6 . ("Esaias" "Jessika"))
(7 . ("Klas"))
(8 . ("Kjell"))
(9 . ("Jörgen" "Örjan"))
(10 . ("Andre" "Andrea"))
(11 . ("Eleonora" "Ellinor"))
(12 . ("Herman" "Hermine"))
(13 . ("Joel" "Judit"))
(14 . ("Folke"))
(15 . ("Ragnhild" "Ragnvald"))
(16 . ("Reinhold" "Reine"))
(17 . ("Bruno"))
(18 . ("Fredrik" "Fritz"))
(19 . ("Sara"))
(20 . ("Margareta" "Greta"))
(21 . ("Johanna"))
(22 . ("Magdalena" "Madeleine"))
(23 . ("Emma"))
(24 . ("Kristina" "Kerstin"))
(25 . ("Jakob"))
(26 . ("Jesper"))
(27 . ("Marta"))
(28 . ("Botvid" "Seved"))
(29 . ("Olof"))
(30 . ("Algot"))
(31 . ("Helena" "Elin"))))
(8 . ((1 . ("Per"))
(2 . ("Karin" "Kajsa"))
(3 . ("Tage"))
(4 . ("Arne" "Arnold"))
(5 . ("Ulrik" "Alrik"))
(6 . ("Alfons" "Inez"))
(7 . ("Dennis" "Denise"))
(8 . ("Silvia" "Sylvia"))
(9 . ("Roland"))
(10 . ("Lars"))
(11 . ("Susanna"))
(12 . ("Klara"))
(13 . ("Kaj"))
(14 . ("Uno"))
(15 . ("Stella" "Estelle"))
(16 . ("Brynolf"))
(17 . ("Verner" "Valter"))
(18 . ("Ellen" "Lena"))
(19 . ("Magnus" "Måns"))
(20 . ("Bernhard" "Bernt"))
(21 . ("Jon" "Jonna"))
(22 . ("Henrietta" "Henrika"))
(23 . ("Signe" "Signhild"))
(24 . ("Bartolomeus"))
(25 . ("Lovisa" "Louise"))
(26 . ("Östen"))
(27 . ("Rolf" "Raoul"))
(28 . ("Gurli" "Leila"))
(29 . ("Hans" "Hampus"))
(30 . ("Albert" "Albertina"))
(31 . ("Arvid" "Vidar"))))
(9 . ((1 . ("Samuel"))
(2 . ("Justus" "Justina"))
(3 . ("Alfhild" "Alva"))
(4 . ("Gisela"))
(5 . ("Adela" "Heidi"))
(6 . ("Lilian" "Lilly"))
(7 . ("Regina" "Roy"))
(8 . ("Alma" "Hulda"))
(9 . ("Anita" "Annette"))
(10 . ("Tord" "Turid"))
(11 . ("Dagny" "Helny"))
(12 . ("Åsa" "Åslög"))
(13 . ("Sture"))
(14 . ("Ida"))
(15 . ("Sigrid" "Siri"))
(16 . ("Dag" "Daga"))
(17 . ("Hildegard" "Magnhild"))
(18 . ("Orvar"))
(19 . ("Fredrika"))
(20 . ("Elise" "Lisa"))
(21 . ("Matteus"))
(22 . ("Maurits" "Moritz"))
(23 . ("Tekla" "Tea"))
(24 . ("Gerhard" "Gert"))
(25 . ("Tryggve"))
(26 . ("Enar" "Einar"))
(27 . ("Dagmar" "Rigmor"))
(28 . ("Lennart" "Leonard"))
(29 . ("Mikael" "Mikaela"))
(30 . ("Helge"))))
(10 . ((1 . ("Ragnar" "Ragna"))
(2 . ("Ludvig" "Love"))
(3 . ("Evald" "Osvald"))
(4 . ("Frans" "Frank"))
(5 . ("Bror"))
(6 . ("Jenny" "Jennifer"))
(7 . ("Birgitta" "Britta"))
(8 . ("Nils"))
(9 . ("Ingrid" "Inger"))
(10 . ("Harry" "Harriet"))
(11 . ("Erling" "Jarl"))
(12 . ("Valfrid" "Manfred"))
(13 . ("Berit" "Birgit"))
(14 . ("Stellan"))
(15 . ("Hedvig" "Hillevi"))
(16 . ("Finn"))
(17 . ("Antonia" "Toini"))
(18 . ("Lukas"))
(19 . ("Tore" "Tor"))
(20 . ("Sibylla"))
(21 . ("Ursula" "Yrsa"))
(22 . ("Marika" "Marita"))
(23 . ("Severin" "Sören"))
(24 . ("Evert" "Eilert"))
(25 . ("Inga" "Ingalill"))
(26 . ("Amanda" "Rasmus"))
(27 . ("Sabina"))
(28 . ("Simon" "Simone"))
(29 . ("Viola"))
(30 . ("Elsa" "Isabella"))
(31 . ("Edit" "Edgar"))))
(11 . ((1 . ())
(2 . ("Tobias"))
(3 . ("Hubert" "Hugo"))
(4 . ("Sverker"))
(5 . ("Eugen" "Eugenia"))
(6 . ("Gustav" "Adolf"))
(7 . ("Ingegerd" "Ingela"))
(8 . ("Vendela"))
(9 . ("Teodor" "Teodora"))
(10 . ("Martin" "Martina"))
(11 . ("Mårten"))
(12 . ("Konrad" "Kurt"))
(13 . ("Kristian" "Krister"))
(14 . ("Emil" "Emilia"))
(15 . ("Leopold"))
(16 . ("Vibeke" "Viveka"))
(17 . ("Naemi" "Naima"))
(18 . ("Lillemor" "Moa"))
(19 . ("Elisabet" "Lisbet"))
(20 . ("Pontus" "Marina"))
(21 . ("Helga" "Olga"))
(22 . ("Cecilia" "Sissela"))
(23 . ("Klemens"))
(24 . ("Gudrun" "Rune"))
(25 . ("Katarina" "Katja"))
(26 . ("Linus"))
(27 . ("Astrid" "Asta"))
(28 . ("Malte"))
(29 . ("Sune"))
(30 . ("Andreas" "Anders"))))
(12 . ((1 . ("Oskar" "Ossian"))
(2 . ("Beata" "Beatrice"))
(3 . ("Lydia"))
(4 . ("Barbara" "Barbro"))
(5 . ("Sven"))
(6 . ("Nikolaus" "Niklas"))
(7 . ("Angela" "Angelika"))
(8 . ("Virginia"))
(9 . ("Anna"))
(10 . ("Malin" "Malena"))
(11 . ("Daniel" "Daniela"))
(12 . ("Alexander" "Alexis"))
(13 . ("Lucia"))
(14 . ("Sten" "Sixten"))
(15 . ("Gottfrid"))
(16 . ("Assar"))
(17 . ("Stig"))
(18 . ("Abraham"))
(19 . ("Isak"))
(20 . ("Israel" "Moses"))
(21 . ("Tomas"))
(22 . ("Natanael" "Jonatan"))
(23 . ("Adam"))
(24 . ("Eva"))
(25 . ())
(26 . ("Stefan" "Staffan"))
(27 . ("Johannes" "Johan"))
(28 . ("Benjamin"))
(29 . ("Natalia" "Natalie"))
(30 . ("Abel" "Set"))
(31 . ("Sylvester"))))))
(defun lyskom-nameday (&optional now)
(let* ((time (or now (lyskom-current-server-time)))
(mlist (cdr (assq (time->mon time) lyskom-nameday-alist)))
(dlist (cdr (assq (time->mday time) mlist))))
(cond ((null dlist) nil)
((eq 1 (length dlist))
(lyskom-format "%#1s har namnsdag i dag." (car dlist)))
((eq 2 (length dlist))
(lyskom-format "%#1s och %#2s har namnsdag i dag."
(elt dlist 0) (elt dlist 1)))
(t (format "%s och %s har namnsdag i dag."
(mapconcat 'identity (lyskom-butlast dlist 1) ", ")
(elt dlist (1- (length dlist))))))))
;;; ================================================================
......
......@@ -1845,6 +1845,10 @@ environment to one that uses \"%#2s\" to encode text.
")
(has-nameday-1 . "Today's name is %#1s.")
(has-nameday-2 . "Today's names are %#1s and %#2s.")
))
......
This diff is collapsed.
......@@ -1859,6 +1859,9 @@ teckenkodning.
")
(has-nameday-1 . "%#1s har namnsdag i dag.")
(has-nameday-2 . "%#1s och %#2s har namnsdag i dag.")
))
......
......@@ -1225,8 +1225,10 @@ time in some places. If nil, only include minutes and hours."
server)
(def-kom-var kom-show-namedays nil
"*Non-nil means display namedays when running in Swedish.
This variable will eventually be replaced with something else."
"*Non-nil means display namedays.
If set to t, display namedays for the selected language (if there
are any defined). If set to a symbol, display namedays from that
list (list available lists with M-x lyskom-list-nameday-lists)."
server)
(def-kom-var kom-ssh-relay-host nil
......
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