Convert consecutive FSF copyright years to ranges.
[bpt/emacs.git] / lisp / language / vietnamese.el
dissimilarity index 88%
index 8f24316..e0f92cb 100644 (file)
-;;; vietnamese.el --- support for Vietnamese -*- coding: iso-2022-7bit; -*-
-
-;; Copyright (C) 1998, 2001, 2002, 2003, 2004, 2005, 2006, 2007
-;;   Free Software Foundation, Inc.
-;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007
-;;   National Institute of Advanced Industrial Science and Technology (AIST)
-;;   Registration Number H14PRO021
-
-;; Keywords: multilingual, Vietnamese
-
-;; This file is part of GNU Emacs.
-
-;; 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.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;; 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.
-
-;;; Commentary:
-
-;; For Vietnames, the character sets VISCII, VSCII and TCVN-5712 are
-;; supported.
-
-;;; Code:
-
-(defvar viet-viscii-decode-table
-  [;; VISCII is a full 8-bit code.
-   0 1 ?\e,2F\e(B 3 4 ?\e,2G\e(B ?\e,2g\e(B 7 8 9 10 11 12 13 14 15
-   16 17 18 19 ?\e,2V\e(B 21 22 23 24 ?\e,2[\e(B 26 27 28 29 ?\e,2\\e(B 31
-   32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
-   48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
-   64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
-   80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
-   96 97 98 99 100 101 102 103 104 105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,1X\e(B ?\e,2y\e(B ?\e,2z\e(B ?\e,1[\e(B ?\e,1\\e(B ?\e,2}\e(B ?\e,1^\e(B ?\e,1_\e(B
-   ?\e,1`\e(B ?\e,1a\e(B ?\e,1b\e(B ?\e,1c\e(B ?\e,1d\e(B ?\e,1e\e(B ?\e,1f\e(B ?\e,1g\e(B ?\e,1h\e(B ?\e,1i\e(B ?\e,1j\e(B ?\e,1k\e(B ?\e,1l\e(B ?\e,1m\e(B ?\e,1n\e(B ?\e,1o\e(B
-   ?\e,1p\e(B ?\e,1q\e(B ?\e,1r\e(B ?\e,1s\e(B ?\e,1t\e(B ?\e,1u\e(B ?\e,1v\e(B ?\e,1w\e(B ?\e,1x\e(B ?\e,1y\e(B ?\e,1z\e(B ?\e,1{\e(B ?\e,1|\e(B ?\e,1}\e(B ?\e,1~\e(B ?\e,2f\e(B ]
-  "Vietnamese VISCII decoding table.")
-
-(let ((table (make-translation-table-from-vector viet-viscii-decode-table)))
-  (define-translation-table 'viet-viscii-nonascii-translation-table table)
-  (define-translation-table 'viet-viscii-encode-table
-    (char-table-extra-slot table 0)))
-
-;;;
-;;; VSCII is a pre-version of TCVN-5712 and deprecated
-;;;
-(defvar viet-vscii-decode-table
-  [;; VSCII is a full 8-bit code.
-   0 ?\e,2z\e(B ?\e,2x\e(B 3 ?\e,2W\e(B ?\e,2X\e(B ?\e,2f\e(B 7 8 9 10 11 12 13 14 15
-   16 ?\e,2Q\e(B ?\e,2_\e(B ?\e,2O\e(B ?\e,2V\e(B ?\e,2[\e(B ?\e,2}\e(B ?\e,2\\e(B 24 25 26 27 28 29 30 31
-   32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
-   48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
-   64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
-   80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
-   96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
-   112 113 114 115 116 117 118 119 120 121 122 123 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?\e,21\e(B ?\e,1v\e(B ?\e,1u\e(B ?\e,1s\e(B ?\e,1w\e(B ?\e,10\e(B ?\e,11\e(B ?\e,12\e(B ?\e,1/\e(B ?\e,15\e(B ?\e,16\e(B ?\e,17\e(B ?\e,1^\e(B ?\e,1>\e(B ?\e,1~\e(B ?\e,1y\e(B
-   ?\e,22\e(B ?\e,1|\e(B ?\e,1{\e(B ?\e,1z\e(B ?\e,1x\e(B ?\e,1W\e(B ?\e,1X\e(B ?\e,1f\e(B ?\e,1Q\e(B ?\e,1q\e(B ?\e,1O\e(B ?\e,1V\e(B ?\e,1[\e(B ?\e,1}\e(B ?\e,1\\e(B ?\e,2/\e(B]
-  "Vietnamese VSCII decoding table.")
-
-(let ((table (make-translation-table-from-vector viet-vscii-decode-table)))
-  (define-translation-table 'viet-vscii-nonascii-translation-table table)
-  (define-translation-table 'viet-vscii-encode-table
-    (char-table-extra-slot table 0)))
-
-;; Does not support combining characters in the range [176, 180]
-(defvar viet-tcvn-decode-table
-  [;; TCVN is a full 8-bit code.
-   0 ?\e,2z\e(B ?\e,2x\e(B 3 ?\e,2W\e(B ?\e,2X\e(B ?\e,2f\e(B 7 8 9 10 11 12 13 14 15
-   16 ?\e,2Q\e(B ?\e,2q\e(B ?\e,2O\e(B ?\e,2V\e(B ?\e,2[\e(B ?\e,2}\e(B ?\e,2\\e(B 24 25 26 27 28 29 30 31
-   32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
-   48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
-   64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
-   80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
-   96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
-   112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
-   ?\e,2`\e(B ?\e,2d\e(B ?\e,2c\e(B ?\e,2a\e(B ?\e,2U\e(B ?\e,2#\e(B ?\e,2'\e(B ?\e,2h\e(B ?\e,2k\e(B ?\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e(B ?\e,17\e(B ?\e,1^\e(B ?\e,1>\e(B ?\e,1~\e(B ?\e,1y\e(B
-   ?\e,22\e(B ?\e,1|\e(B ?\e,1{\e(B ?\e,1z\e(B ?\e,1x\e(B ?\e,1W\e(B ?\e,1X\e(B ?\e,1f\e(B ?\e,1Q\e(B ?\e,1q\e(B ?\e,1O\e(B ?\e,1V\e(B ?\e,1[\e(B ?\e,1}\e(B ?\e,1\\e(B ?\e,2/\e(B]
-  "Vietnamese TCVN-5712 decoding table.")
-
-(let ((table (make-translation-table-from-vector viet-tcvn-decode-table)))
-  (define-translation-table 'viet-tcvn-nonascii-translation-table table)
-  (define-translation-table 'viet-tcvn-encode-table
-    (char-table-extra-slot table 0)))
-
-;; (defvar viet-vps-decode-table
-;;   [;; VPS is a full 8-bit code.
-;;    0 1 ?\e,2U\e(B ?\e,2'\e(B ?\e,2#\e(B ?\e,2)\e(B ?\e,2.\e(B 7 8 9 10 11 12 13 14 15
-;;    ?\e,28\e(B ?\e,2w\e(B ?\e,25\e(B ?\e,2~\e(B ?\e,2x\e(B ?\e,2q\e(B 22 23 24 ?\e,2\\e(B 26 27 ?\e,2g\e(B ?\e,2f\e(B 30 31
-;;    32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
-;;    48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
-;;    64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
-;;    80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
-;;    96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
-;;    112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
-;;    ?\e,2`\e(B ?\e,2d\e(B ?\e,2c\e(B ?\e,2$\e(B ?\e,2%\e(B ?\e,2&\e(B ?\e,1w\e(B ?\e,12\e(B ?\e,2e\e(B ?\e,1*\e(B ?\e,1+\e(B ?\e,1,\e(B ?\e,1.\e(B ?\e,2!\e(B ?\e,2"\e(B ?\e,2F\e(B
-;;    ?\e,2*\e(B 145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?\e,2p\e(B ?\e,1r\e(B ?\e,1s\e(B ?\e,1t\e(B ?\e,1u\e(B 246 ?\e,2=\e(B ?\e,1x\e(B ?\e,1y\e(B ?\e,1z\e(B ?\e,1|\e(B 252 ?\e,2V\e(B ?\e,2(\e(B ?\e,1O\e(B]
-;;   "Vietnamese VPS decoding table.")
-;;
-;; (let ((table (make-translation-table-from-vector viet-vps-decode-table)))
-;;   (define-translation-table 'viet-vps-nonascii-translation-table table)
-;;   (define-translation-table 'viet-vps-encode-table
-;;     (char-table-extra-slot table 0)))
-
-(define-ccl-program ccl-decode-viscii
-  `(3
-    ((loop
-      (r0 = 0)
-      (read r1)
-      (translate-character viet-viscii-nonascii-translation-table r0 r1)
-      (write-multibyte-character r0 r1)
-      (repeat))))
-  "CCL program to decode VISCII 1.1")
-
-(define-ccl-program ccl-encode-viscii
-  `(1
-    ((loop
-      (read-multibyte-character r0 r1)
-      (translate-character viet-viscii-encode-table r0 r1)
-      (write-repeat r1))))
-  "CCL program to encode VISCII 1.1")
-
-(define-ccl-program ccl-encode-viscii-font
-  `(0
-    ;; In:  R0:vietnamese-viscii-lower/vietnamese-viscii-upper
-    ;;      R1:position code
-    ;; Out: R1:font code point
-    (translate-character viet-viscii-encode-table r0 r1))
-  "CCL program to encode Vietnamese chars to VISCII 1.1 font")
-
-(define-ccl-program ccl-decode-vscii
-  `(3
-    ((loop
-      (r0 = 0)
-      (read r1)
-      (translate-character viet-vscii-nonascii-translation-table r0 r1)
-      (write-multibyte-character r0 r1)
-      (repeat))))
-  "CCL program to decode VSCII-1.")
-
-(define-ccl-program ccl-encode-vscii
-  `(1
-    ((loop
-      (read-multibyte-character r0 r1)
-      (translate-character viet-vscii-encode-table r0 r1)
-      (write-repeat r1))))
-  "CCL program to encode VSCII-1.")
-
-(define-ccl-program ccl-encode-vscii-font
-  `(0
-    ;; In:  R0:vietnamese-viscii-lower/vietnamese-viscii-upper
-    ;;      R1:position code
-    ;; Out: R1:font code point
-    (translate-character viet-vscii-encode-table r0 r1))
-  "CCL program to encode Vietnamese chars to VSCII-1 font.")
-
-(define-ccl-program ccl-decode-tcvn
-  `(3
-    ((loop
-      (r0 = 0)
-      (read r1)
-      (translate-character viet-tcvn-nonascii-translation-table r0 r1)
-      (write-multibyte-character r0 r1)
-      (repeat))))
-  "CCL program to decode TCVN-5712.")
-
-(define-ccl-program ccl-encode-tcvn
-  `(1
-    ((loop
-      (read-multibyte-character r0 r1)
-      (translate-character viet-tcvn-encode-table r0 r1)
-      (write-repeat r1))))
-  "CCL program to encode TCVN-5712.")
-
-(define-ccl-program ccl-encode-tcvn-font
-  `(0
-    ;; In:  R0:vietnamese-viscii-lower/vietnamese-viscii-upper
-    ;;      R1:position code
-    ;; Out: R1:font code point
-    (translate-character viet-tcvn-encode-table r0 r1))
-  "CCL program to encode Vietnamese chars to TCVN-5712 font.")
-
-;; (define-ccl-program ccl-decode-vps
-;;   `(3
-;;     ((loop
-;;      (r0 = 0)
-;;      (read r1)
-;;      (translate-character viet-vps-nonascii-translation-table r0 r1)
-;;      (write-multibyte-character r0 r1)
-;;      (repeat))))
-;;   "CCL program to decode VPS.")
-;;
-;; (define-ccl-program ccl-encode-vps
-;;   `(1
-;;     ((loop
-;;      (read-multibyte-character r0 r1)
-;;      (translate-character viet-vps-encode-table r0 r1)
-;;      (write-repeat r1))))
-;;   "CCL program to encode VPS.")
-;;
-;; (define-ccl-program ccl-encode-vps-font
-;;   `(0
-;;     ;; In:  R0:vietnamese-viscii-lower/vietnamese-viscii-upper
-;;     ;;      R1:position code
-;;     ;; Out: R1:font code point
-;;     (translate-character viet-vps-encode-table r0 r1))
-;;   "CCL program to encode Vietnamese chars to VPS font.")
-
-(make-coding-system
- 'vietnamese-viscii 4 ?V
- "8-bit encoding for Vietnamese VISCII 1.1 (MIME:VISCII)"
- '(ccl-decode-viscii . ccl-encode-viscii)
- '((safe-charsets ascii vietnamese-viscii-lower vietnamese-viscii-upper)
-   (mime-charset . viscii)
-   (valid-codes (0 . 255))))
-
-(define-coding-system-alias 'viscii 'vietnamese-viscii)
-
-(make-coding-system
- 'vietnamese-vscii 4 ?v
- "8-bit encoding for Vietnamese VSCII-1"
- '(ccl-decode-vscii . ccl-encode-vscii)
- '((safe-charsets ascii vietnamese-viscii-lower vietnamese-viscii-upper)
-   (valid-codes (0 . 255))))
-
-(define-coding-system-alias 'vscii 'vietnamese-vscii)
-
-(make-coding-system
- 'vietnamese-tcvn 4 ?t
- "8-bit encoding for Vietnamese TCVN-5712"
- '(ccl-decode-tcvn . ccl-encode-tcvn)
- '((safe-charsets ascii vietnamese-viscii-lower vietnamese-viscii-upper)
-   (valid-codes (0 . 255))))
-
-(define-coding-system-alias 'tcvn 'vietnamese-tcvn)
-(define-coding-system-alias 'tcvn-5712 'vietnamese-tcvn)
-
-;; (make-coding-system
-;;  'vietnamese-vps 4 ?p
-;;  "8-bit encoding for Vietnamese VPS"
-;;  '(ccl-decode-vps . ccl-encode-vps)
-;;  '((safe-charsets ascii vietnamese-viscii-lower vietnamese-viscii-upper)
-;;    (valid-codes (0 . 255))))
-;;
-;; (define-coding-system-alias 'vps 'vietnamese-vps)
-
-(make-coding-system
- 'vietnamese-viqr 0 ?q
- "Vietnamese latin transcription (VIQR)"
- nil
- '((safe-charsets ascii vietnamese-viscii-lower vietnamese-viscii-upper)
-   (post-read-conversion . viqr-post-read-conversion)
-   (pre-write-conversion . viqr-pre-write-conversion)
-   (charset-origin-alist
-    (vietnamese-viscii-lower "VISCII" viet-encode-viscii-char)
-    (vietnamese-viscii-upper "VISCII" viet-encode-viscii-char))))
-
-
-(define-coding-system-alias 'viqr 'vietnamese-viqr)
-
-(setq font-ccl-encoder-alist
-      (cons '("viscii" . ccl-encode-viscii-font) font-ccl-encoder-alist))
-
-(setq font-ccl-encoder-alist
-      (cons '("vscii" . ccl-encode-vscii-font) font-ccl-encoder-alist))
-
-(setq font-ccl-encoder-alist
-      (cons '("tcvn" . ccl-encode-tcvn-font) font-ccl-encoder-alist))
-
-(set-language-info-alist
- "Vietnamese" `((charset vietnamese-viscii-lower vietnamese-viscii-upper)
-               (nonascii-translation
-                . ,(get 'viet-viscii-nonascii-translation-table
-                        'translation-table))
-               (coding-system vietnamese-viscii vietnamese-vscii vietnamese-tcvn
-                              vietnamese-viqr)
-               (coding-priority vietnamese-viscii)
-               (input-method . "vietnamese-viqr")
-               (unibyte-display . vietnamese-viscii)
-               (features viet-util)
-               (sample-text . "Vietnamese (Ti\e,1*\e(Bng Vi\e,1.\e(Bt)     Ch\e,1`\e(Bo b\e,1U\e(Bn")
-               (documentation . "\
-For Vietnamese, Emacs uses special charsets internally.
-They can be decoded from and encoded to VISCII, VSCII, TCVN-5712, and
-VIQR.  VSCII is deprecated in favour of TCVN-5712.  Current setting
-puts higher priority to the coding system VISCII than TCVN-5712.  If
-you prefer TCVN-5712, please do: (prefer-coding-system 'vietnamese-tcvn).
-There are two Vietnamese input methods: VIQR and Telex, VIQR is the
-default setting.")
-               ))
-
-(provide 'vietnamese)
-
-;;; arch-tag: 5bd4f1aa-2d4e-4f33-b7d8-0679c6a19ee6
-;;; vietnamese.el ends here
+;;; vietnamese.el --- support for Vietnamese -*- coding: iso-2022-7bit; -*-
+
+;; Copyright (C) 1998, 2001-2011
+;;   Free Software Foundation, Inc.
+;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+;;   2005, 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, Vietnamese, i18n
+
+;; This file is part of GNU Emacs.
+
+;; 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 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
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; For Vietnames, the character sets VISCII, VSCII and TCVN-5712 are
+;; supported.
+
+;;; Code:
+
+(define-coding-system 'vietnamese-viscii
+  "8-bit encoding for Vietnamese VISCII 1.1 (MIME:VISCII)."
+  :coding-type 'charset
+  :mnemonic ?V
+  :charset-list '(viscii)
+  :mime-charset 'viscii
+  :suitable-for-file-name t)
+
+(define-coding-system-alias 'viscii 'vietnamese-viscii)
+
+(define-coding-system 'vietnamese-vscii
+  "8-bit encoding for Vietnamese VSCII-1."
+  :coding-type 'charset
+  :mnemonic ?v
+  :charset-list '(vscii)
+  :suitable-for-file-name t)
+
+(define-coding-system-alias 'vscii 'vietnamese-vscii)
+
+;; (make-coding-system
+;;  'vietnamese-vps 4 ?p
+;;  "8-bit encoding for Vietnamese VPS"
+;;  '(ccl-decode-vps . ccl-encode-vps)
+;;  '((safe-charsets ascii vietnamese-viscii-lower vietnamese-viscii-upper)
+;;    (valid-codes (0 . 255))))
+;;
+;; (define-coding-system-alias 'vps 'vietnamese-vps)
+
+(define-coding-system 'vietnamese-viqr
+  "Vietnamese latin transcription (VIQR)."
+  :coding-type 'utf-8
+  :mnemonic ?q
+  :charset-list '(ascii viscii)
+  :post-read-conversion 'viqr-post-read-conversion
+  :pre-write-conversion 'viqr-pre-write-conversion)
+
+(define-coding-system-alias 'viqr 'vietnamese-viqr)
+
+(set-language-info-alist
+ "Vietnamese" `((charset viscii)
+               (coding-system vietnamese-viscii vietnamese-vscii
+                               vietnamese-tcvn vietnamese-viqr windows-1258)
+               (nonascii-translation . viscii)
+               (coding-priority vietnamese-viscii)
+               (input-method . "vietnamese-viqr")
+               (unibyte-display . vietnamese-viscii)
+               (features viet-util)
+               (sample-text . "Vietnamese (Ti\e,1*\e(Bng Vi\e,1.\e(Bt)     Ch\e,1`\e(Bo b\e,1U\e(Bn")
+               (documentation . "\
+For Vietnamese, Emacs uses special charsets internally.
+They can be decoded from and encoded to VISCII, VSCII, TCVN-5712, VIQR
+and windows-1258.  VSCII is deprecated in favour of TCVN-5712.  The
+Current setting gives higher priority to the coding system VISCII than
+TCVN-5712.  If you prefer TCVN-5712, please do: (prefer-coding-system
+'vietnamese-tcvn).  There are two Vietnamese input methods: VIQR and
+Telex, VIQR is the default setting.")))
+
+(define-coding-system 'windows-1258
+  "windows-1258 encoding for Vietnamese (MIME: WINDOWS-1258)"
+  :coding-type 'charset
+  :mnemonic ?*
+  :charset-list '(windows-1258)
+  :mime-charset 'windows-1258)
+(define-coding-system-alias 'cp1258 'windows-1258)
+
+(define-coding-system 'vietnamese-tcvn
+  "8-bit encoding for Vietnamese TCVN-5712"
+  :coding-type 'charset
+  :mnemonic ?t
+  :charset-list '(tcvn-5712)
+  :suitable-for-file-name t)
+(define-coding-system-alias 'tcvn 'vietnamese-tcvn)
+(define-coding-system-alias 'tcvn-5712 'vietnamese-tcvn)
+
+(provide 'vietnamese)
+
+;;; vietnamese.el ends here