]> code.delx.au - gnu-emacs/blobdiff - lisp/language/viet-util.el
(url-http-mark-connection-as-free, url-http-find-free-connection):
[gnu-emacs] / lisp / language / viet-util.el
index 9c66584655697297345c012636f0a28df3855221..20cf226dc00933d3f49fee77c3b077c83e12a2be 100644 (file)
@@ -1,7 +1,9 @@
-;;; viet-util.el ---  utilities for Vietnamese
+;;; viet-util.el --- utilities for Vietnamese  -*- coding: iso-2022-7bit; -*-
 
-;; Copyright (C) 1995 Free Software Foundation, Inc.
-;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.
+;; Copyright (C) 1998  Free Software Foundation, Inc.
+;; Copyright (C) 1995, 1997
+;;   National Institute of Advanced Industrial Science and Technology (AIST)
+;;   Registration Number H14PRO021
 
 ;; Keywords: mule, multilingual, Vietnamese
 
 
 ;; 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., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Commentary:
 
 ;; Vietnamese uses ASCII characters and additional 134 unique
 ;; characters (these are Latin alphabets with various diacritical and
-;; tone marks).  As far as I know, Vietnamese now has 4 different ways
-;; for representing these characters: VISCII, VSCII, VIQR, and
-;; Unicode.  VISCII and VSCII are simple 1-byte code which assigns 134
-;; unique characters in control-code area (0x00..0x1F) and right half
-;; area (0x80..0xFF).  VIQR is a menmonic encoding specification
-;; representing diacritical marks by following ASCII characters.
+;; tone marks).  As far as I know, Vietnamese now has 5 different ways
+;; for representing these characters: VISCII, TCVN-5712, VPS, VIQR,
+;; and Unicode.  VISCII, TCVN-5712 and VPS are simple 1-byte code
+;; which assigns 134 unique characters in control-code area
+;; (0x00..0x1F) and right half area (0x80..0xFF).  VIQR is a menmonic
+;; encoding specification representing diacritical marks by following
+;; ASCII characters.
 
 ;;; Code:
 
-(defun setup-vietnamese-environment ()
-  "Setup multilingual environment (MULE) for Vietnamese."
-  (interactive)
-  (setup-8-bit-environment nil 'viscii  '("Vietnamese" . "quail-viqr")))
+(defvar viet-viscii-nonascii-translation-table)
+
+;;;###autoload
+(defun viet-encode-viscii-char (char)
+  "Return VISCII character code of CHAR if appropriate."
+  (aref (char-table-extra-slot viet-viscii-nonascii-translation-table 0)
+       char))
 
 ;; VIQR is a menmonic encoding specification for Vietnamese.
 ;; It represents diacritical marks by ASCII characters as follows:
 
 ;;;###autoload
 (defun viet-decode-viqr-region (from to)
-  "Convert `VIQR' mnemonics of the current region to Vietnamese characaters.
+  "Convert `VIQR' mnemonics of the current region to Vietnamese characters.
 When called from a program, expects two arguments,
 positions (integers or markers) specifying the stretch of the region."
   (interactive "r")
@@ -237,13 +243,13 @@ positions (integers or markers) specifying the stretch of the region."
 
 ;;;###autoload
 (defun viet-decode-viqr-buffer ()
-  "Convert `VIQR' mnemonics of the current buffer to Vietnamese characaters."
+  "Convert `VIQR' mnemonics of the current buffer to Vietnamese characters."
   (interactive)
   (viet-decode-viqr-region (point-min) (point-max)))
 
 ;;;###autoload
 (defun viet-encode-viqr-region (from to)
-  "Convert Vietnamese characaters of the current region to `VIQR' mnemonics.
+  "Convert Vietnamese characters of the current region to `VIQR' mnemonics.
 When called from a program, expects two arguments,
 positions (integers or markers) specifying the stretch of the region."
   (interactive "r")
@@ -260,7 +266,7 @@ positions (integers or markers) specifying the stretch of the region."
 
 ;;;###autoload
 (defun viet-encode-viqr-buffer ()
-  "Convert Vietnamese characaters of the current buffer to `VIQR' mnemonics."
+  "Convert Vietnamese characters of the current buffer to `VIQR' mnemonics."
   (interactive)
   (viet-encode-viqr-region (point-min) (point-max)))
 
@@ -276,10 +282,8 @@ positions (integers or markers) specifying the stretch of the region."
 
 ;;;###autoload
 (defun viqr-pre-write-conversion (from to)
-  (let ((old-buf (current-buffer))
-       (work-buf (get-buffer-create " *viet-work*")))
-    (set-buffer work-buf)
-    (erase-buffer)
+  (let ((old-buf (current-buffer)))
+    (set-buffer (generate-new-buffer " *temp*"))
     (if (stringp from)
        (insert from)
       (insert-buffer-substring old-buf from to))
@@ -288,9 +292,7 @@ positions (integers or markers) specifying the stretch of the region."
     nil))
 
 ;;;
-(provide 'language/viet-util)
+(provide 'viet-util)
 
-;;; Local Variables:
-;;; generated-autoload-file: "../loaddefs.el"
-;;; End:
+;;; arch-tag: 082a4d3b-168f-45b4-b3e1-82bfa1b5a194
 ;;; viet-util.el ends here