changeset 728:4d00488244c1

[xemacs-hg @ 2002-01-10 09:50:43 by stephent] Add ISO 8859/15 support. <877kqq8rkj.fsf@tleepslib.sk.tsukuba.ac.jp>
author stephent
date Thu, 10 Jan 2002 09:50:50 +0000
parents c00528d80f25
children 217aff1c578d
files lisp/ChangeLog lisp/coding.el lisp/mule/european.el src/ChangeLog src/mule-charset.c src/mule-charset.h
diffstat 6 files changed, 94 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Thu Jan 10 00:24:29 2002 +0000
+++ b/lisp/ChangeLog	Thu Jan 10 09:50:50 2002 +0000
@@ -1,3 +1,11 @@
+2002-01-10  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* coding.el: Fix typo in comment.
+
+2002-01-10  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* mule/european.el (Latin-9): Add ISO 8859/15 support.
+
 2002-01-09  Simon Josefsson  <jas@extundo.com>
 
 	* files.el (auto-mode-alist): Support Sieve (*.siv, *.sieve).
--- a/lisp/coding.el	Thu Jan 10 00:24:29 2002 +0000
+++ b/lisp/coding.el	Thu Jan 10 09:50:50 2002 +0000
@@ -305,4 +305,4 @@
 (define-obsolete-variable-alias
   'pathname-coding-system 'file-name-coding-system)
 
-;;; mule-coding.el ends here
+;;; coding.el ends here
--- a/lisp/mule/european.el	Thu Jan 10 00:24:29 2002 +0000
+++ b/lisp/mule/european.el	Thu Jan 10 09:50:50 2002 +0000
@@ -3,6 +3,7 @@
 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.
 ;; Licensed to the Free Software Foundation.
 ;; Copyright (C) 1997 MORIOKA Tomohiko
+;; Copyright (C) 2002 Free Software Foundation
 
 ;; Keywords: multilingual, European
 
@@ -25,7 +26,7 @@
 
 ;;; Commentary:
 
-;; For Europeans, five character sets ISO8859-1,2,3,4,9 are supported.
+;; Support six Latin coded character sets ISO8859-1,2,3,4,9,15.
 
 ;; #### latin.el would be a better name for this file.
 
@@ -39,6 +40,19 @@
 (modify-syntax-entry ?,AW(B "_")
 (modify-syntax-entry ?,Aw(B "_")
 
+;; For syntax of Latin-9 characters.
+;; Based on Latin-1 and differences from Jukka Korpela
+;; http://www.cs.tut.fi/~jkorpela/latin9.html
+(loop for c in '(?,b&(B ?,b((B ?,b4(B ?,b8(B ?,b<(B ?,b=(B ?,b>(B)
+      do (modify-syntax-entry c "w"))
+
+(loop for c from 64 to 127              ; from ',b@(B' to ',b(B'
+      do (modify-syntax-entry (make-char 'latin-iso8859-1 c) "w"))
+
+(modify-syntax-entry (make-char 'latin-iso8859-15 32) "w") ; no-break space
+(modify-syntax-entry ?,bW(B "_")
+(modify-syntax-entry ?,bw(B "_")
+
 ;; For syntax of Latin-2
 (loop for c in '(?,B!(B ?,B#(B ?,B%(B ?,B&(B ?,B)(B ?,B*(B ?,B+(B ?,B,(B ?,B.(B ?,B/(B ?,B1(B ?,B3(B ?,B5(B ?,B6(B ?,B9(B ?,B:(B ?,B;(B ?,B<(B)
       do (modify-syntax-entry c "w"))
@@ -149,6 +163,52 @@
  '("European"))
 
 
+;; Latin-9 (ISO-8859-15)
+;; Latin-1 plus Euro, plus a few accented characters
+
+;; (make-charset 'latin-iso8859-15
+;;   "Latin-9, aka Latin-1 with Euro etc"
+;;   '(short-name "Latin 9"
+;;     long-name  "Latin-9 (typically GR of ISO 8859/15)"
+;;     registry   "iso8859-15"
+;;     dimension  1
+;;     columns    1
+;;     chars      96
+;;     final      ?b                  ; ISO-IR-203
+;;     graphic    1
+;;     direction  l2r))
+
+(make-coding-system
+ 'iso-8859-15 'iso2022
+  "ISO 4873 conforming 8-bit code (ASCII + Latin 9; aka Latin-1 with Euro)"
+  `(mnemonic "MIME/Ltn-9"		; bletch
+    eol-type nil
+    charset-g0 ascii
+    charset-g1 latin-iso8859-15
+    charset-g2 t
+    charset-g3 t
+    ))
+
+(defun setup-latin9-environment ()
+  "Set up multilingual environment (MULE) for European Latin-9 users."
+  (interactive)
+  (set-language-environment "Latin-9"))
+
+(set-language-info-alist
+ "Latin-9" '((charset ascii latin-iso8859-15)
+	     (coding-system iso-8859-15)
+	     (coding-priority iso-8859-15)
+	     (input-method . "latin-1-prefix")  ; FIXME!!
+	     (sample-text
+	      . "Hello, Hej, Tere, Hei, Bonjour, Gr,A|_(B Gott, Ciao, ,A!(BHola!, my ")
+	     (documentation . "\
+This language environment is a generic one for Latin-9 (ISO-8859-15)
+character set which supports the Euro sign and the following languages:
+ Danish, Dutch, English, Faeroese, Finnish, French, German, Icelandic,
+ Irish, Italian, Norwegian, Portuguese, Spanish, and Swedish."))
+  '("European"))
+ 
+
 ;; Latin-2 (ISO-8859-2)
 
 ;; (make-coding-system
--- a/src/ChangeLog	Thu Jan 10 00:24:29 2002 +0000
+++ b/src/ChangeLog	Thu Jan 10 09:50:50 2002 +0000
@@ -1,3 +1,12 @@
+2002-01-10  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* mule-charset.c (global):
+	(syms_of_mule_charset):
+	(complex_vars_of_mule_charset):
+	Declare and initialize Vcharset_latin_iso8859_15.
+
+	* mule-charset.h (LEADING_BYTE_OFFICIAL_1): Add LATIN_ISO8859_15.
+
 2002-01-08  Stephen J. Turnbull  <stephen@xemacs.org>
 
 	* XEmacs 21.5.4 "bamboo" is released.
--- a/src/mule-charset.c	Thu Jan 10 00:24:29 2002 +0000
+++ b/src/mule-charset.c	Thu Jan 10 09:50:50 2002 +0000
@@ -50,6 +50,7 @@
 Lisp_Object Vcharset_latin_jisx0201;
 Lisp_Object Vcharset_cyrillic_iso8859_5;
 Lisp_Object Vcharset_latin_iso8859_9;
+Lisp_Object Vcharset_latin_iso8859_15;
 Lisp_Object Vcharset_japanese_jisx0208_1978;
 Lisp_Object Vcharset_chinese_gb2312;
 Lisp_Object Vcharset_japanese_jisx0208;
@@ -135,6 +136,7 @@
   Qlatin_jisx0201,
   Qcyrillic_iso8859_5,
   Qlatin_iso8859_9,
+  Qlatin_iso8859_15,
   Qjapanese_jisx0208_1978,
   Qchinese_gb2312,
   Qjapanese_jisx0208,
@@ -1305,6 +1307,7 @@
   DEFSYMBOL (Qlatin_jisx0201);
   DEFSYMBOL (Qcyrillic_iso8859_5);
   DEFSYMBOL (Qlatin_iso8859_9);
+  DEFSYMBOL (Qlatin_iso8859_15);
   DEFSYMBOL (Qjapanese_jisx0208_1978);
   DEFSYMBOL (Qchinese_gb2312);
   DEFSYMBOL (Qjapanese_jisx0208);
@@ -1476,6 +1479,15 @@
 		  build_string ("ISO8859-9 (Latin-5)"),
 		  build_string ("ISO8859-9 (Latin-5)"),
 		  build_string ("iso8859-9"));
+  staticpro (&Vcharset_latin_iso8859_15);
+  Vcharset_latin_iso8859_15 =
+    make_charset (LEADING_BYTE_LATIN_ISO8859_15, Qlatin_iso8859_15, 2,
+		  CHARSET_TYPE_96, 1, 1, 'b',
+		  CHARSET_LEFT_TO_RIGHT,
+		  build_string ("Latin-9"),
+		  build_string ("ISO8859-15 (Latin-9)"),
+		  build_string ("ISO8859-15 (Latin-9)"),
+		  build_string ("iso8859-15"));
   staticpro (&Vcharset_japanese_jisx0208_1978);
   Vcharset_japanese_jisx0208_1978 =
     make_charset (LEADING_BYTE_JAPANESE_JISX0208_1978, Qjapanese_jisx0208_1978, 3,
--- a/src/mule-charset.h	Thu Jan 10 00:24:29 2002 +0000
+++ b/src/mule-charset.h	Thu Jan 10 09:50:50 2002 +0000
@@ -350,12 +350,12 @@
   LEADING_BYTE_KATAKANA_JISX0201, /* 0x89 Right half of JIS X0201-1976 */
   LEADING_BYTE_LATIN_JISX0201,    /* 0x8A Left  half of JIS X0201-1976 */
   LEADING_BYTE_CYRILLIC_ISO8859_5,/* 0x8B Right half of ISO 8859-5 */
-  LEADING_BYTE_LATIN_ISO8859_9    /* 0x8C Right half of ISO 8859-9 */
-                                  /* 0x8D unused */
+  LEADING_BYTE_LATIN_ISO8859_9,   /* 0x8C Right half of ISO 8859-9 */
+  LEADING_BYTE_LATIN_ISO8859_15   /* 0x8D Right half of ISO 8859-15 */
 };
 
 #define MIN_LEADING_BYTE_OFFICIAL_1	LEADING_BYTE_LATIN_ISO8859_1
-#define MAX_LEADING_BYTE_OFFICIAL_1	LEADING_BYTE_LATIN_ISO8859_9
+#define MAX_LEADING_BYTE_OFFICIAL_1	LEADING_BYTE_LATIN_ISO8859_15
 
 /** The following are for 2-byte characters in an official charset. **/
 enum LEADING_BYTE_OFFICIAL_2