]> code.delx.au - gnu-emacs/blobdiff - lisp/language/european.el
Merge from origin/emacs-25
[gnu-emacs] / lisp / language / european.el
index 400bbe829c00c5df486d1b06da22f3ee5a53f0a0..11c5e03c97f779c019558159a73034ff71b3a0b2 100644 (file)
@@ -1,9 +1,8 @@
-;;; european.el --- support for European languages -*- coding: iso-2022-7bit; -*-
+;;; european.el --- support for European languages -*- coding: utf-8; -*-
 
-;; Copyright (C) 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
-;;   Free Software Foundation, Inc.
+;; Copyright (C) 1997-1998, 2000-2016 Free Software Foundation, Inc.
 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007
+;;   2005, 2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
 ;;   Registration Number H14PRO021
 ;; Copyright (C) 2003
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; 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 2, or (at your option)
-;; any later version.
+;; 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
@@ -25,9 +24,7 @@
 ;; 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, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
@@ -46,7 +43,7 @@
             (unibyte-display . iso-latin-1)
             (input-method . "latin-1-prefix")
             (sample-text
-             . "Hello, Hej, Tere, Hei, Bonjour, Gr\e$(D+d)N\e(B Gott, Ciao, \e$(D"B\e(BHola!")
+             . "Hello, Hej, Tere, Hei, Bonjour, Grüß Gott, Ciao, ¡Hola!")
             (documentation . "\
 This language environment is a generic one for the Latin-1 (ISO-8859-1)
 character set which supports the following European languages:
@@ -149,8 +146,8 @@ These languages are supported with the Latin-3 (ISO-8859-3) character set:
             (input-method . "latin-4-postfix")
             (documentation . "\
 These languages are supported with the Latin-4 (ISO-8859-4) character set:
- Danish, English, Estonian, Finnish, German, Greenlandic, Lappish,
- Latvian, Lithuanian, and Norwegian."))
+ Danish, English, Estonian, Finnish, German, Greenlandic, Latvian,
+ Lithuanian, Norwegian, and Sami."))
  '("European"))
 
 \f
@@ -229,7 +226,7 @@ See also the Turkish environment."))
   "ISO 2022 based 8-bit encoding for Latin-8 (MIME:ISO-8859-14)."
   :coding-type 'charset
   ;; `W' for `Welsh', since `C' for `Celtic' is taken.
-  :mnemonic ?W                         
+  :mnemonic ?W
   :charset-list '(iso-8859-14)
   :mime-charset 'iso-8859-14)
 
@@ -244,7 +241,7 @@ See also the Turkish environment."))
             (unibyte-display . iso-latin-8)
             (input-method . "latin-8-prefix")
             ;; Fixme: Welsh/Ga{e}lic greetings
-            (sample-text . "\e,_"\e(B \e$(D+q\e(B \e$(D*t\e(B")
+            (sample-text . "ḃ ŵ Ŷ")
             (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
@@ -274,7 +271,7 @@ covered by other ISO-8859 character sets:
             (unibyte-display . iso-latin-9)
             (input-method . "latin-9-prefix")
             (sample-text
-             . "AVE. \e$(D*^+^*v+v)-)M*s\e(B \e$(Q)!\e(B")
+             . "AVE. ŠšŽžŒœŸ €")
             (documentation . "\
 This language environment is a generic one for the Latin-9 (ISO-8859-15)
 character set which supports the same languages as Latin-1 with the
@@ -284,7 +281,7 @@ Latin-9 is sometimes nicknamed `Latin-0'."))
 
 (set-language-info-alist
  "Esperanto" '((tutorial . "TUTORIAL.eo")
-              (charset ascii latin-iso8859-3)
+              (charset iso-8859-3)
               (coding-system iso-latin-3)
               (coding-priority iso-latin-3)
               (nonascii-translation . latin-iso8859-3)
@@ -327,6 +324,14 @@ Latin-9 is sometimes nicknamed `Latin-0'."))
   :mime-charset 'windows-1257)
 (define-coding-system-alias 'cp1257 'windows-1257)
 
+(define-coding-system 'cp775
+  "DOS codepage 775 (PC Baltic, MS-DOS Baltic Rim)"
+  :coding-type 'charset
+  :mnemonic ?D
+  :charset-list '(cp775)
+  :mime-charset 'cp775)
+(define-coding-system-alias 'ibm775 'cp775)
+
 (define-coding-system 'cp850
   "DOS codepage 850 (Western European)"
   :coding-type 'charset
@@ -422,7 +427,7 @@ but it selects the Dutch tutorial and input method."))
            (unibyte-display . iso-latin-1)
            (sample-text . "\
 German (Deutsch Nord)  Guten Tag
-German (Deutsch S\e$(D+d\e(Bd)   Gr\e$(D+d)N\e(B Gott")
+German (Deutsch Süd)  Grüß Gott")
            (documentation . "\
 This language environment is almost the same as Latin-1,
 but sets the default input method to \"german-postfix\".
@@ -437,7 +442,7 @@ Additionally, it selects the German tutorial."))
            (nonascii-translation . iso-8859-1)
            (unibyte-display . iso-latin-1)
            (input-method . "latin-1-prefix")
-           (sample-text . "French (Fran\e$(D+.\e(Bais)   Bonjour, Salut")
+           (sample-text . "French (Français)  Bonjour, Salut")
            (documentation . "\
 This language environment is almost the same as Latin-1,
 but it selects the French tutorial and input method."))
@@ -466,7 +471,7 @@ Additionally, it selects the Italian tutorial."))
              (input-method . "slovenian")
              (unibyte-display . iso-8859-2)
              (tutorial . "TUTORIAL.sl")
-             (sample-text . "\e$(D*v\e(Belimo vam uspe\e$(D+^\e(Ben dan!")
+             (sample-text . "Želimo vam uspešen dan!")
              (documentation . "\
 This language environment is almost the same as Latin-2,
 but it selects the Slovenian tutorial and input method."))
@@ -480,7 +485,7 @@ but it selects the Slovenian tutorial and input method."))
            (input-method . "spanish-postfix")
            (nonascii-translation . iso-8859-1)
            (unibyte-display . iso-latin-1)
-           (sample-text . "Spanish (Espa\e$(D+P\e(Bol)   \e$(D"B\e(BHola!")
+           (sample-text . "Spanish (Español)  ¡Hola!")
            (documentation . "\
 This language environment is almost the same as Latin-1,
 but it sets the default input method to \"spanish-postfix\",
@@ -499,25 +504,25 @@ and it selects the Spanish tutorial."))
             (nonascii-translation . iso-8859-9)
             (unibyte-display . iso-latin-5)
             (input-method . "turkish-postfix")
-            (sample-text . "Turkish (T\e$(D+d\e(Brk\e$(D+.\e(Be)   Merhaba")
+            (sample-text . "Turkish (Türkçe) Merhaba")
             (setup-function . turkish-case-conversion-enable)
             (setup-function . turkish-case-conversion-disable)
             (documentation . "Support for Turkish.
 Differs from the Latin-5 environment in using the `turkish-postfix' input
-method and applying Turkish case rules for the characters i, I, \e$(D)E\e(B, \e$(D*D\e(B.")))
+method and applying Turkish case rules for the characters i, I, ı, İ.")))
 
 (defun turkish-case-conversion-enable ()
-  "Set up Turkish case conversion of `i' and `I' into `\e$(D*D\e(B' and `\e$(D)E\e(B'."
+  "Set up Turkish case conversion of `i' and `I' into `İ' and `ı'."
   (let ((table (standard-case-table)))
-    (set-case-syntax-pair ?\e$(D*D\e(B ?i table)
-    (set-case-syntax-pair ?I ?\e$(D)E\e(B table)))
+    (set-case-syntax-pair ?İ ?i table)
+    (set-case-syntax-pair ?I ?ı table)))
 
 (defun turkish-case-conversion-disable ()
   "Set up normal (non-Turkish) case conversion of `i' into `I'."
   (let ((table (standard-case-table)))
     (set-case-syntax-pair ?I ?i table)
-    (set-case-syntax ?\e$(D*D\e(B "w" table)
-    (set-case-syntax ?\e$(D)E\e(B "w" table)))
+    (set-case-syntax ?İ "w" table)
+    (set-case-syntax ?ı "w" table)))
 
 ;; Polish ISO 8859-2 environment.
 ;; Maintainer: Wlodek Bzyl <matwb@univ.gda.pl>
@@ -531,7 +536,7 @@ method and applying Turkish case rules for the characters i, I, \e$(D)E\e(B, \e$(D*
           (nonascii-translation . iso-8859-2)
           (unibyte-display . iso-8859-2)
           (tutorial . "TUTORIAL.pl")
-          (sample-text . "P\e$(D+Q\e(Bjd\e$(D+u\e(B, ki\e$(D+M\e(B-\e$(D+w\e(Be t\e$(D+8\e(B chmurno\e$(D+\++\e(B w g\e$(D)H+(\e(Bb flaszy")
+          (sample-text . "Pójdź, kiń-że tę chmurność w głąb flaszy")
           (documentation . t))
  '("European"))
 
@@ -609,13 +614,36 @@ method and applying Turkish case rules for the characters i, I, \e$(D)E\e(B, \e$(D*
            (documentation . "Support for Brazilian Portuguese."))
  '("European"))
 
+(set-language-info-alist
+ "Catalan" '((charset iso-8859-1)
+            (coding-system iso-8859-1 iso-8859-15)
+            (coding-priority iso-8859-1)
+            (input-method . "catalan-prefix")
+            (nonascii-translation . iso-8859-1)
+            (unibyte-display . iso-8859-1)
+            (setup-function
+             . (lambda ()
+                 (modify-syntax-entry ?· "w" (standard-syntax-table))))
+            (exit-function
+             . (lambda ()
+                 (modify-syntax-entry ?· "_" (standard-syntax-table))))
+            (sample-text . "\
+Catalan (Català)  Avui demà i ahir s'esfullarà una rosa.")
+            (documentation . "\
+This language environment uses the ISO-8859-1 character set,
+sets the default input method to \"catalan-prefix\", and sets
+the syntax of the middle dot character `·' to word."))
+  '("European"))
+
+
 \f
 (define-coding-system 'mac-roman
   "Mac Roman Encoding (MIME:MACINTOSH)."
   :coding-type 'charset
-  :mnemonic ?M 
+  :mnemonic ?M
   :charset-list '(mac-roman)
   :mime-charset 'macintosh)
+(define-coding-system-alias 'macintosh 'mac-roman)
 
 (define-coding-system 'next
   "NeXTstep encoding"
@@ -639,121 +667,6 @@ method and applying Turkish case rules for the characters i, I, \e$(D)E\e(B, \e$(D*
   :charset-list '(adobe-standard-encoding)
   :mime-charset 'adobe-standard-encoding)
 
-\f
-;; For automatic composing of diacritics and combining marks.
-(dolist (range '( ;; combining diacritical marks
-                (#x0300 #x0314 (tc . bc))
-                (#x0315        (tr . bl))
-                (#x0316 #x0319 (bc . tc))
-                (#x031A        (tr . cl))
-                (#x031B #x0320 (bc . tc))
-                (#x0321        (Br . tr))
-                (#x0322        (Br . tl))
-                (#x0323 #x0333 (bc . tc))
-                (#x0334 #x0338 (Bc . Bc))
-                (#x0339 #x033C (bc . tc))
-                (#x033D #x033F (tc . bc))
-                (#x0340        (tl . bc))
-                (#x0341        (tr . bc))
-                (#x0342 #x0344 (tc . bc))
-                (#x0345        (bc . tc))
-                (#x0346        (tc . bc))
-                (#x0347 #x0349 (bc . tc))
-                (#x034A #x034C (tc . bc))
-                (#x034D #x034E (bc . tc))
-                ;; combining diacritical marks for symbols
-                (#x20D0 #x20D1 (tc . bc))
-                (#x20D2 #x20D3 (Bc . Bc))
-                (#x20D4 #x20D7 (tc . bc))
-                (#x20D8 #x20DA (Bc . Bc))
-                (#x20DB #x20DC (tc . bc))
-                (#x20DD #x20E0 (Bc . Bc))
-                (#x20E1        (tc . bc))
-                (#x20E2 #x20E3 (Bc . Bc))))
-  (let* ((from (car range))
-        (to (if (= (length range) 3)
-                (nth 1 range)
-              from))
-        (composition (car (last range))))
-    (while (<= from to)
-      (put-char-code-property from 'diacritic-composition composition)
-      (aset composition-function-table from 'diacritic-composition-function)
-      (setq from (1+ from)))))
-
-(defconst diacritic-composition-pattern "\\C^\\c^+")
-
-(defun diacritic-compose-region (beg end)
-  "Compose diacritic characters in the region.
-When called from a program, expects two arguments,
-positions (integers or markers) specifying the region."
-  (interactive "r")
-  (save-restriction
-    (narrow-to-region beg end)
-    (goto-char (point-min))
-    (while (re-search-forward diacritic-composition-pattern nil t)
-      (if (= (char-syntax (char-after (match-beginning 0))) ?w)
-         (compose-region (match-beginning 0) (match-end 0))))))
-
-(defun diacritic-compose-string (string)
-  "Compose diacritic characters in STRING and return the resulting string."
-  (let ((idx 0))
-    (while (setq idx (string-match diacritic-composition-pattern string idx))
-      (if (= (char-syntax (aref string idx)) ?w)
-         (compose-string string idx (match-end 0)))
-      (setq idx (match-end 0))))
-  string)
-
-(defun diacritic-compose-buffer ()
-  "Compose diacritic characters in the current buffer."
-  (interactive)
-  (diacritic-compose-region (point-min) (point-max)))
-
-(defun diacritic-composition-function (pos &optional string)
-  "Compose diacritic text around POS.
-Optional 2nd argument STRING, if non-nil, is a string containing text
-to compose.
-
-The return value is the end position of composed characters,
-or nil if no characters are composed."
-  (setq pos (1- pos))
-  (if string
-      (if (>= pos 0)
-         (let ((ch (aref string pos))
-               start end components ch composition)
-           (when (= (char-syntax ch) ?w)
-             (setq start pos
-                   end (length string)
-                   components (list ch)
-                   pos (1+ pos))
-             (while (and
-                     (< pos end)
-                     (setq ch (aref string pos)
-                           composition
-                           (get-char-code-property ch
-                                                   'diacritic-composition)))
-               (setq components (cons ch (cons composition components))
-                     pos (1+ pos)))
-             (compose-string string start pos (nreverse components))
-             pos)))
-    (if (>= pos (point-min))
-       (let ((ch (char-after pos))
-             start end components composition)
-         (when (= (char-syntax ch) ?w)
-           (setq start pos
-                 end (point-max)
-                 components (list ch)
-                 pos (1+ pos))
-           (while (and
-                   (< pos end)
-                   (setq ch (char-after pos)
-                         composition
-                         (get-char-code-property ch 'diacritic-composition)))
-             (setq components (cons ch (cons composition components))
-                   pos (1+ pos)))
-           (compose-region start pos (nreverse components))
-           pos)))))
-
 (provide 'european)
 
-;;; arch-tag: 9e018b12-fb02-4120-907b-9adeaf84b5c2
 ;;; european.el ends here