]> code.delx.au - gnu-emacs/blobdiff - lisp/language/european.el
("Latin-6", "Croatian"): New.
[gnu-emacs] / lisp / language / european.el
index 64664a544e5ab5242cc8bd0b218743c17d827b3f..233c099b734baad89c69b96c69f9b40b1db41e67 100644 (file)
@@ -2,7 +2,7 @@
 
 ;; Copyright (C) 1995, 1997, 2001 Electrotechnical Laboratory, JAPAN.
 ;; Licensed to the Free Software Foundation.
-;; Copyright (C) 2001 Free Software Foundation, Inc.
+;; Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
 
 ;; Keywords: multilingual, European
 
@@ -34,9 +34,9 @@
 
 (make-coding-system
  'iso-latin-1 2 ?1
- "ISO 2022 based 8-bit encoding for Latin-1 (MIME:ISO-8859-1)"
+ "ISO 2022 based 8-bit encoding for Latin-1 (MIME:ISO-8859-1)."
  '(ascii latin-iso8859-1 nil nil
-   nil nil nil nil nil nil nil nil nil nil nil nil t)
+   nil nil nil nil nil nil nil nil nil nil nil t t)
  '((safe-charsets ascii latin-iso8859-1)
    (mime-charset . iso-8859-1)))
 
@@ -76,9 +76,9 @@ Indonesian/Malay, Tagalog (Philippines), Swahili and Afrikaans."))
 
 (make-coding-system
  'iso-latin-2 2 ?2
- "ISO 2022 based 8-bit encoding (MIME:ISO-8859-2)"
+ "ISO 2022 based 8-bit encoding for Latin-2 (MIME:ISO-8859-2)."
  '(ascii latin-iso8859-2 nil nil
-   nil nil nil nil nil nil nil)
+   nil nil nil nil nil nil nil nil nil nil nil t)
  '((safe-charsets ascii latin-iso8859-2)
    (mime-charset . iso-8859-2)))
 
@@ -101,6 +101,7 @@ character set which supports the following languages:
  and Swedish.
 We also have specific language environments for the following languages:
   For Czech, \"Czech\".
+  For Croatian, \"Croatian\".
   For Romanian, \"Romanian\".
   For Slovak, \"Slovak\"."))
  '("European"))
@@ -110,9 +111,9 @@ We also have specific language environments for the following languages:
 
 (make-coding-system
  'iso-latin-3 2 ?3
- "ISO 2022 based 8-bit encoding (MIME:ISO-8859-3)"
+ "ISO 2022 based 8-bit encoding for Latin-3 (MIME:ISO-8859-3)."
  '(ascii latin-iso8859-3 nil nil
-   nil nil nil nil nil nil nil)
+   nil nil nil nil nil nil nil nil nil nil nil t)
  '((safe-charsets ascii latin-iso8859-3)
    (mime-charset . iso-8859-3)))
 
@@ -138,9 +139,9 @@ These languages are supported with the Latin-3 (ISO-8859-3) character set:
 
 (make-coding-system
  'iso-latin-4 2 ?4
- "ISO 2022 based 8-bit encoding (MIME:ISO-8859-4)"
+ "ISO 2022 based 8-bit encoding for Latin-4 (MIME:ISO-8859-4)."
  '(ascii latin-iso8859-4 nil nil
-   nil nil nil nil nil nil nil)
+   nil nil nil nil nil nil nil nil nil nil nil t)
  '((safe-charsets ascii latin-iso8859-4)
    (mime-charset . iso-8859-4)))
 
@@ -166,9 +167,9 @@ These languages are supported with the Latin-4 (ISO-8859-4) character set:
 
 (make-coding-system
  'iso-latin-5 2 ?9
- "ISO 2022 based 8-bit encoding (MIME:ISO-8859-9)"
+ "ISO 2022 based 8-bit encoding for Latin-5 (MIME:ISO-8859-9)."
  '(ascii latin-iso8859-9 nil nil
-   nil nil nil nil nil nil nil)
+   nil nil nil nil nil nil nil nil nil nil nil t)
  '((safe-charsets ascii latin-iso8859-9)
    (mime-charset . iso-8859-9)))
 
@@ -183,10 +184,7 @@ These languages are supported with the Latin-4 (ISO-8859-4) character set:
             (unibyte-syntax . "latin-5")
             (unibyte-display . iso-latin-5)
             (input-method . "latin-5-postfix")
-            (documentation . "\
-These languages are supported with the Latin-5 (ISO-8859-9) character set:
-Bulgarian, Byelorussian, (Slavic) Macedonian, Russian, Serbian and
-Ukranian."))                           ; says ISO 8859-1
+            (documentation . "Support for Turkish language."))
  '("European"))
 
 \f
@@ -195,9 +193,9 @@ Ukranian."))                                ; says ISO 8859-1
 (make-coding-system
  'iso-latin-8 2 ?W                     ; `W' for `Welsh', since `C'
                                        ; for `Celtic' is taken.
- "ISO 2022 based 8-bit encoding for Latin-8 (MIME:ISO-8859-14)"
+ "ISO 2022 based 8-bit encoding for Latin-8 (MIME:ISO-8859-14)."
  '(ascii latin-iso8859-14 nil nil
-   nil nil nil nil nil nil nil nil nil nil nil nil t)
+   nil nil nil nil nil nil nil nil nil nil nil t t)
  '((safe-charsets ascii latin-iso8859-14)
    (mime-charset . iso-8859-14)))
 
@@ -217,17 +215,17 @@ Ukranian."))                              ; says ISO 8859-1
             (documentation . "\
 This language environment is a generic one for the Latin-8 (ISO-8859-14)
 character set which supports the Celtic languages, including those not
-covered by other ISO-8859 character sets: Welsh, Manx Gaelic and
-Irish Gaelic (old orthography)."))
+covered by other ISO-8859 character sets:
+ Welsh, Manx Gaelic and Irish Gaelic (old orthography)."))
  '("European"))
 \f
 ;; Latin-9 (ISO-8859-15)
 
 (make-coding-system
  'iso-latin-9 2 ?0                     ; `0' for `Latin-0'
- "ISO 2022 based 8-bit encoding for Latin-9 (MIME:ISO-8859-15)"
+ "ISO 2022 based 8-bit encoding for Latin-9 (MIME:ISO-8859-15)."
  '(ascii latin-iso8859-15 nil nil
-   nil nil nil nil nil nil nil nil nil nil nil nil t)
+   nil nil nil nil nil nil nil nil nil nil nil t t)
  '((safe-charsets ascii latin-iso8859-15)
    (mime-charset . iso-8859-15)))
 
@@ -255,10 +253,10 @@ Latin-9 is sometimes nicknamed `Latin-0'."))
 (set-language-info-alist
  "German" '((tutorial . "TUTORIAL.de")
            (charset ascii latin-iso8859-1)
-           (coding-system iso-latin-1)
+           (coding-system iso-latin-1 iso-latin-9)
            (coding-priority iso-latin-1)
            (input-method . "german-postfix")
-           (nonascii-translation . iso-latin-1)
+           (nonascii-translation . latin-iso8859-1)
            (unibyte-syntax . "latin-1")
            (unibyte-display . iso-latin-1)
            (sample-text . "\
@@ -266,13 +264,14 @@ German (Deutsch Nord)     Guten Tag
 German (Deutsch S\e,A|\e(Bd)     Gr\e,A|_\e(B Gott")
            (documentation . "\
 This language environment is almost the same as Latin-1,
-but the default input method is set to \"german-postfix\"."))
+but sets the default input method to \"german-postfix\".
+Additionally, it selects the German tutorial."))
  '("European"))
 
 (set-language-info-alist
  "French" '((tutorial . "TUTORIAL.fr")
            (charset ascii latin-iso8859-1)
-           (coding-system iso-latin-1)
+           (coding-system iso-latin-1 iso-latin-9)
            (coding-priority iso-latin-1)
            (nonascii-translation . latin-iso8859-1)
            (unibyte-syntax . "latin-1")
@@ -281,7 +280,7 @@ but the default input method is set to \"german-postfix\"."))
            (sample-text . "French (Fran\e,Ag\e(Bais)     Bonjour, Salut")
            (documentation . "\
 This language environment is almost the same as Latin-1,
-but the tutorial is set to \"TUTORIAL.fr\"."))
+but it selects the French tutorial."))
  '("European"))
 
 (set-language-info-alist
@@ -289,7 +288,7 @@ but the tutorial is set to \"TUTORIAL.fr\"."))
              (coding-system . (iso-8859-2))
              (coding-priority . (iso-8859-2))
              (nonascii-translation . latin-iso8859-2)
-             (input-method . "latin-2-postfix")
+             (input-method . "slovenian")
              (unibyte-syntax . "latin-2")
              (unibyte-display . iso-8859-2)
              (tutorial . "TUTORIAL.sl")
@@ -300,31 +299,32 @@ but the tutorial is set to \"TUTORIAL.fr\"."))
 (set-language-info-alist
  "Spanish" '((tutorial . "TUTORIAL.es")
            (charset ascii latin-iso8859-1)
-           (coding-system iso-latin-1)
+           (coding-system iso-latin-1 iso-latin-9)
            (coding-priority iso-latin-1)
            (input-method . "spanish-postfix")
-           (nonascii-translation . iso-latin-1)
+           (nonascii-translation . latin-iso8859-1)
            (unibyte-syntax . "latin-1")
            (unibyte-display . iso-latin-1)
            (sample-text . "Spanish (Espa\e,Aq\e(Bol)     \e,A!\e(BHola!")
            (documentation . "\
 This language environment is almost the same as Latin-1,
-but the default input method is set to \"spanish-postfix\",
+but it sets the default input method to \"spanish-postfix\",
 and it selects the Spanish tutorial."))
  '("European"))
 
 (set-language-info-alist
  "Dutch" '((tutorial . "TUTORIAL.nl")
           (charset ascii latin-iso8859-1)
-          (coding-system iso-latin-1)
+          (coding-system iso-latin-1 iso-latin-9)
           (coding-priority iso-latin-1)
-          (nonascii-translation . iso-latin-1)
+          (nonascii-translation . latin-iso8859-1)
           (unibyte-syntax . "latin-1")
           (unibyte-display . iso-latin-1)
+          (input-method . "dutch")
           (sample-text . "Er is een aantal manieren waarop je dit kan doen")
           (documentation . "\
 This language environment is almost the same as Latin-1,
-but select's the Dutch tutorial."))
+but it selects the Dutch tutorial and input method."))
  '("European"))
 
 ;; For Turkish, the character set ISO-8859-9 (Latin-5) is used.  But,
@@ -334,7 +334,7 @@ but select's the Dutch tutorial."))
 
 (set-language-info-alist
  "Turkish" '((charset ascii latin-iso8859-9)
-            (coding-system iso-latin-5)
+            (coding-system iso-latin-5 iso-latin-3)
             (coding-priority iso-latin-5)
             (nonascii-translation . latin-iso8859-9)
             (unibyte-syntax . "latin-5")
@@ -363,14 +363,27 @@ but select's the Dutch tutorial."))
 (set-language-info-alist
  "Welsh" `((coding-system utf-8 latin-8) ; the input method is Unicode-based
           (coding-priority utf-8 latin-8)
+          (nonascii-translation . latin-iso8859-14)
           (input-method . "welsh")
           (documentation . "Support for Welsh, using Unicode."))
  '("European"))
 
+(set-language-info-alist
+ "Latin-6" `((coding-system latin-6)
+            (coding-priority latin-6)
+            (nonascii-translation . ,(get 'decode-iso-latin-6 'translation-table))
+            (input-method . latin-pre)
+            (input-method . latin-pre)
+            (features code-pages)
+            (documentation . "Support for Latin-6."))
+ '("European"))
+
 (set-language-info-alist
  "Latin-7" `((coding-system latin-7)
             (coding-priority latin-7)
-            ;; Fixme: input-method
+            (nonascii-translation . ,(get 'decode-iso-latin-7
+                                          'translation-table))
+            (input-method . latin-pre)
             (features code-pages)
             (documentation . "Support for Latin-7, e.g. Latvian, Lithuanian."))
  '("European"))
@@ -379,6 +392,8 @@ but select's the Dutch tutorial."))
  "Lithuanian" `((coding-system latin-7)
                (coding-priority latin-7)
                (input-method . "lithuanian-keyboard")
+               (nonascii-translation . ,(get 'decode-iso-latin-7
+                                             'translation-table))
                (features code-pages)
                (documentation . "Support for Lithuanian."))
  '("European"))
@@ -387,9 +402,34 @@ but select's the Dutch tutorial."))
  "Latvian" `((coding-system latin-7)
             (coding-priority latin-7)
             (input-method . "latvian-keyboard")
+            (nonascii-translation . ,(get 'decode-iso-latin-7
+                                          'translation-table))
             (features code-pages)
             (documentation . "Support for Latvian."))
  '("European"))
+
+(set-language-info-alist
+ "Swedish" '((tutorial . "TUTORIAL.sv")
+           (charset ascii latin-iso8859-1)
+           (coding-system iso-latin-1)
+           (coding-priority iso-latin-1)
+           (nonascii-translation . latin-iso8859-1)
+           (unibyte-syntax . "latin-1")
+           (unibyte-display . iso-latin-1)
+           (sample-text . "Goddag Hej")
+           (documentation . "Support for Swedish"))
+ '("European"))
+
+(set-language-info-alist
+ "Croatian" '((charset . (ascii latin-iso8859-2))
+             (coding-system . (iso-8859-2))
+             (coding-priority . (iso-8859-2))
+             (input-method . "croatian")
+             (nonascii-translation . latin-iso8859-2)
+             (unibyte-syntax . "latin-2")
+             (unibyte-display . iso-8859-2)
+             (documentation . "Support for Croatian with Latin-2 encoding."))
+ '("European"))
 \f
 ;; Definitions for the Mac Roman character sets and coding system.
 ;; The Mac Roman encoding uses all 128 code points in the range 128 to
@@ -563,16 +603,22 @@ but select's the Dutch tutorial."))
   `(1
     ((loop
       (read-multibyte-character r0 r1)
+      (translate-character ucs-mule-to-mule-unicode r0 r1)
       (translate-character mac-roman-encoder r0 r1)
+      (if (r0 != ,(charset-id 'ascii))
+         (if (r0 != ,(charset-id 'eight-bit-graphic))
+             (if (r0 != ,(charset-id 'eight-bit-control))
+                 (r1 = ??))))
       (write-repeat r1))))
   "CCL program to encode Mac Roman")
 
 (make-coding-system
- 'mac-roman 4 ?M "Mac Roman Encoding"
+ 'mac-roman 4 ?M
+ "Mac Roman Encoding (MIME:MACINTOSH)."
  '(decode-mac-roman . encode-mac-roman)
'((safe-chars . mac-roman-encoder)
-   (valid-codes (0 . 255))
-   (mime-charset . macintosh)))                ; per IANA, rfc1345
(list (cons 'safe-chars (get 'mac-roman-encoder 'translation-table))
+       '(valid-codes (0 . 255))
+       '(mime-charset . macintosh)))           ; per IANA, rfc1345
 
 (defconst diacritic-composition-pattern "\\C^\\c^+")
 
@@ -610,13 +656,12 @@ The text matches the regular expression PATTERN.
 Optional 4th argument STRING, if non-nil, is a string containing text
 to compose.
 
-The return value is number of composed characters."
-  (if (< (1+ from) to)
-      (prog1 (- to from)
-       (if string
-           (compose-string string from to)
-         (compose-region from to))
-       (- to from))))
+The return value is the number of composed characters."
+  (when (< (1+ from) to)
+      (if string
+         (compose-string string from to)
+       (compose-region from to))
+      (- to from)))
 
 ;; Register a function to compose Unicode diacrtics and marks.
 (let ((patterns '(("\\C^\\c^+" . diacritic-composition-function))))