Merge from emacs-24 branch
[bpt/emacs.git] / lisp / language / european.el
index 0fc5e05..259c067 100644 (file)
@@ -1,9 +1,8 @@
 ;;; european.el --- support for European languages -*- coding: iso-2022-7bit; -*-
 
-;; Copyright (C) 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
-;;   2008  Free Software Foundation, Inc.
+;; Copyright (C) 1997-1998, 2000-2012  Free Software Foundation, Inc.
 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007, 2008
+;;   2005, 2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
 ;;   Registration Number H14PRO021
 ;; Copyright (C) 2003
@@ -147,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
@@ -227,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)
 
@@ -282,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)
@@ -325,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
@@ -611,9 +618,10 @@ method and applying Turkish case rules for the characters i, I, \e$(D)E\e(B, \e$(D*
 (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"
@@ -637,121 +645,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 to font-object 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