-;;; european.el --- European languages -*- coding: iso-2022-7bit; -*-
+;;; european.el --- support for European languages -*- coding: iso-2022-7bit; -*-
-;; Copyright (C) 1995, 1997 Electrotechnical Laboratory, JAPAN.
+;; Copyright (C) 1995, 1997, 2001 Electrotechnical Laboratory, JAPAN.
;; Licensed to the Free Software Foundation.
;; Keywords: multilingual, European
German, Greenlandic, Icelandic, Irish Gaelic (new orthography),
Italian, Latin, Luxemburgish, Norwegian, Portuguese, Rhaeto-Romanic,
Scottish Gaelic, Spanish, and Swedish.
-We also have a German specific language environment \"German\".
+We also have specific language environments for the following languages:
+ For Dutch, \"Dutch\".
+ For German, \"German\".
+ For Spanish, \"Spanish\".
+ For French, \"French\".
Latin-1 also covers several written languages outside Europe, including
Indonesian/Malay, Tagalog (Philippines), Swahili and Afrikaans."))
(nonascii-translation . latin-iso8859-4)
(unibyte-syntax . "latin-4")
(unibyte-display . iso-8859-4)
- (input-method . "latin-4-prefix")
+ (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,
(nonascii-translation . latin-iso8859-9)
(unibyte-syntax . "latin-5")
(unibyte-display . iso-latin-5)
- (input-method . "latin-5-prefix")
+ (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
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 default input method is set to \"german-postfix\"."))
+but the default input method is set to \"german-postfix\"."))
+ '("European"))
+
+(set-language-info-alist
+ "French" '((tutorial . "TUTORIAL.fr")
+ (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)
+ (input-method . "latin-1-prefix")
+ (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\"."))
'("European"))
(set-language-info-alist
(documentation . t))
'("European"))
+(set-language-info-alist
+ "Spanish" '((tutorial . "TUTORIAL.es")
+ (charset ascii latin-iso8859-1)
+ (coding-system iso-latin-1)
+ (coding-priority iso-latin-1)
+ (input-method . "spanish-postfix")
+ (nonascii-translation . iso-latin-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\",
+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-priority iso-latin-1)
+ (nonascii-translation . iso-latin-1)
+ (unibyte-syntax . "latin-1")
+ (unibyte-display . iso-latin-1)
+ (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."))
+ '("European"))
+
;; For Turkish, the character set ISO-8859-9 (Latin-5) is used. But,
;; before the introduction of ISO-8859-9 in 1988, ISO-8859-3 (Latin-3)
;; was used for Turkish. Those who use Latin-3 for Turkish should use
(unibyte-syntax . "latin-2")
(unibyte-display . iso-8859-2)
(tutorial . "TUTORIAL.pl")
- (sample-text . "\e,B1!fFjJ3#qQsS6&?/<,\e(B")
+ (sample-text . "P\e,Bs\e(Bjd\e,B<\e(B, ki\e,Bq\e(B-\e,B?\e(Be t\e,Bj\e(B chmurno\e,B6f\e(B w g\e,B31\e(Bb flaszy")
(documentation . t))
'("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
-;; 255 for actual characters. Emacs decode them to one of the
+;; 255 for actual characters. Emacs decodes them to one of the
;; following character sets.
;; ascii, latin-iso8859-1, mule-unicode-0100-24ff,
;; mule-unicode-2500-33ff, mule-unicode-e000-ffff
'mac-roman 4 ?M "Mac Roman Encoding"
'(decode-mac-roman . encode-mac-roman)
'((safe-chars . mac-roman-encoder)
- (valid-codes (0 . 255))))
+ (valid-codes (0 . 255))
+ (mime-charset . macintosh))) ; per IANA, rfc1345
+
+(defconst diacritic-composition-pattern "\\C^\\c^+")
+
+;;;###autoload
+(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)
+ (compose-region (match-beginning 0) (match-end 0)))))
+
+;;;###autoload
+(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))
+ (compose-string string idx (match-end 0))
+ (setq idx (match-end 0))))
+ string)
+
+;;;###autoload
+(defun diacritic-compose-buffer ()
+ "Compose diacritic characters in the current buffer."
+ (interactive)
+ (diacritic-compose-region (point-min) (point-max)))
+
+;;;###autoload
+(defun diacritic-post-read-conversion (len)
+ (diacritic-compose-region (point) (+ (point) len))
+ len)
+
+;;;###autoload
+(defun diacritic-composition-function (from to pattern &optional string)
+ "Compose diacritic text in the region FROM and TO.
+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))))
+
+;; Register a function to compose Unicode diacrtics and marks.
+(let ((patterns '(("\\C^\\c^+" . diacrtic-composition-function))))
+ (let ((c #x300))
+ (while (<= c #x362)
+ (aset composition-function-table (decode-char 'ucs c) patterns)
+ (setq c (1+ c)))
+ (setq c #x20d0)
+ (while (<= c #x20e3)
+ (aset composition-function-table (decode-char 'ucs c) patterns)
+ (setq c (1+ c)))))
(provide 'european)