Spelling fixes.
[bpt/emacs.git] / lisp / language / tibetan.el
index 57614c0..c80b22c 100644 (file)
@@ -1,20 +1,24 @@
 ;;; tibetan.el --- support for Tibetan language -*- coding: iso-2022-7bit; -*-
 
-;; Copyright (C) 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
-;;   Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2001-2011  Free Software Foundation, Inc.
 ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-;;   2006, 2007, 2008
+;;   2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
 ;;   Registration Number H14PRO021
+;; Copyright (C) 2003
+;;   National Institute of Advanced Industrial Science and Technology (AIST)
+;;   Registration Number H13PRO009
 
-;; Keywords: multilingual, Tibetan
+;; Author: Toru TOMABECHI <Toru.Tomabechi@orient.unil.ch>
+;; Created: Feb. 17. 1997
+;; Keywords: multilingual, Tibetan, i18n
 
 ;; 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 3, 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
 ;; 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/>.
 
-;; Author: Toru TOMABECHI, <Toru.Tomabechi@orient.unil.ch>
-
-;; Created: Feb. 17. 1997
+;;; History:
 
-;; History:
 ;; 1997.03.13 Modification for special signs and punctuations.
 
 ;;; Commentary:
 ;;;
 
 
-(make-coding-system
- 'tibetan-iso-8bit 2 ?Q
- "8-bit encoding for ASCII (MSB=0) and TIBETAN (MSB=1)."
- '(ascii tibetan nil nil
-   nil nil)
- '((safe-charsets ascii tibetan)
-   (post-read-conversion . tibetan-post-read-conversion)
-   (pre-write-conversion . tibetan-pre-write-conversion)))
+(define-coding-system 'tibetan-iso-8bit
+  "8-bit encoding for ASCII (MSB=0) and TIBETAN (MSB=1)."
+  :coding-type 'iso-2022
+  :mnemonic ?Q
+  :designation [ascii tibetan nil nil]
+  :charset-list '(ascii tibetan))
 
 (define-coding-system-alias 'tibetan 'tibetan-iso-8bit)
 
             (input-method . "tibetan-wylie")
             (features tibet-util)
             (documentation . t)
-            (sample-text
-             . (tibetan-compose-string
-                (copy-sequence
-"Tibetan (\e4\e$(7"7r'"]\e0"7"]\e1\e4"2\e0"2\e1!;\e4%P\e0"G#!"Q\e1\e4"2\e0"2\e1!;\e(B) \e$(7!4!5!5!>\e4"7\e0"7\e1\e4$P\e0"!#C"Q\e1!;\e4"Er'"S\e0"E"S\e1\e4"G\e0"G\e1!;\e4"7\e0"7\e1\e4"2r'"[\e0"2"[\e1!;\e4"Dr'"[\e0"D"[\e1\e4"#\e0"#\e1\e4"G\e0"G\e1!>\e4"Ir'"]r'"_\e0"I"]"_\e1!;\e4"9\e0"9"Q\e1!;\e4"/r'"S\e0"/"S\e1!;\e4"5\e0"5"Q\e1\e4#2x!#9r'"[\e0"2#9"[\e1!;\e4"Hx!"Rx!"Ur'"c\e0"H"A"U"c\e1!>\e(B")))))
-
+            (sample-text . "Tibetan (\e$(7"7"]"2!;"G#!"Q"2!;\e(B) \e$(7!4!5!5!>"7"!#C"Q!;"E"S"G!;"7"2"[!;"D"["#"G!>"I"]"_!;"9"Q!;"/"S!;"5"Q"2#9"[!;"H"A"U"c!>\e(B")))
 
 ;; `\e$(7"A\e(B' is included in the pattern for subjoined consonants because we
 ;; treat it specially in tibetan-add-components.
 ;; \e$(7"A\e(B is removed from the class of subjoined. Tomabechi 2000/06/08
 ;; (for Unicode support)
 (defconst tibetan-composable-pattern
-  "[\e$(7"!\e(B-\e$(7"J"K\e(B][\e$(7#!\e(B-\e$(7#J#K#L#M\e(B]*[\e$(7"Q"R"S\e(B-\e$(7"^"a"b"e\e(B]*[\e$(7"_"c"d"g\e(B-\e$(7"l!I!e!g\e(B]*"
+  "[\e$(7"!\e(B-\e$(7"J"K\e(B][\e$(7#!\e(B-\e$(7#J#K#L#M\e(B]*[\e$,1FP\e$(7"Q"R"S\e(B-\e$(7"^"a"b"e\e(B]*[\e$(7"_"c"d"g\e(B-\e$(7"l!I!e!g\e(B]*"
   "Regexp matching a composable sequence of Tibetan characters.")
 
-;; Register a function to compose Tibetan characters.
-(aset composition-function-table (make-char 'tibetan)
-      (list (cons tibetan-composable-pattern 'tibetan-composition-function)))
-
 ;;;
 ;;; Definitions of conversion data.
 ;;;
     ))
 
 ;;; alist for Tibetan composite vowels (long i, vocalic r, etc.)
-;;; New varialble. created by Tomabechi 2000/06/08
+;;; New variable. created by Tomabechi 2000/06/08
 (defconst tibetan-composite-vowel-alist
   '(;; LONG A
     ;; ("\e$(7"R\e(B" . ((bc . tc) ?\e$(7"R\e(B))
@@ -578,6 +567,7 @@ The result of matching is to be used for indexing alists at conversion
 from a roman transcription to the corresponding Tibetan character.")
 
 (defvar tibetan-precomposed-regexp
+  (purecopy
   (let ((l tibetan-precomposed-transcription-alist)
        temp)
     (setq temp "^\\(")
@@ -588,12 +578,13 @@ from a roman transcription to the corresponding Tibetan character.")
       (setq temp
            (concat temp "\\|" (car (car l))))
       (setq l (cdr l)))
-    (concat temp "\\)"))
+    (concat temp "\\)")))
   "Regexp string to match a romanized Tibetan complex consonant.
 The result of matching is to be used for indexing alists when the input key
 from an input method is converted to the corresponding precomposed glyph.")
 
 (defvar tibetan-precomposition-rule-regexp
+  (purecopy
   (let ((l tibetan-precomposition-rule-alist)
        temp)
     (setq temp "\\(")
@@ -602,7 +593,7 @@ from an input method is converted to the corresponding precomposed glyph.")
     (while l
       (setq temp (concat temp "\\|" (car (car l))))
       (setq l (cdr l)))
-    (concat temp "\\)"))
+    (concat temp "\\)")))
   "Regexp string to match a sequence of Tibetan consonantic components, i.e.,
 one base consonant and one or more subjoined consonants.
 The result of matching is to be used for indexing alist when the component
@@ -612,7 +603,11 @@ This also matches some punctuation characters which need conversion.")
 (defvar tibetan-decomposed nil)
 (defvar tibetan-decomposed-temp nil)
 
+;; For automatic composition.
+(set-char-table-range
+ composition-function-table '(#xF00 . #xFD1)
+ (list (vector tibetan-composable-pattern 0 'font-shape-gstring)))
+
 (provide 'tibetan)
 
-;;; arch-tag: 8d37c8d7-f95d-450f-9ec2-819e61fc79a7
 ;;; tibetan.el ends here