annotate lisp/mule/mule-vietnamese.el @ 197:acd284d43ca1 r20-3b25

Import from CVS: tag r20-3b25
author cvs
date Mon, 13 Aug 2007 10:00:02 +0200
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
197
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
1 ;; Vietnamese language specific setup for Mule
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
2 ;; Copyright (C) 1992 Free Software Foundation, Inc.
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
3 ;; This file is part of Mule (MULtilingual Enhancement of GNU Emacs).
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
4 ;; This file contains European characters.
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
5
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
6 ;; Mule is free software distributed in the form of patches to GNU Emacs.
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
7 ;; You can redistribute it and/or modify
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
8 ;; it under the terms of the GNU General Public License as published by
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
9 ;; the Free Software Foundation; either version 1, or (at your option)
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
10 ;; any later version.
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
11
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
12 ;; Mule is distributed in the hope that it will be useful,
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
13 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
15 ;; GNU General Public License for more details.
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
16
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
17 ;; You should have received a copy of the GNU General Public License
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
18 ;; along with GNU Emacs; see the file COPYING. If not, write to the
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
19 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
20 ;; Boston, MA 02111-1307, USA.
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
21
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
22 ;;; 93.5.25 created for Mule Ver.0.9.8 by K.Handa <handa@etl.go.jp>
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
23 ;;; 93.7.22 modified for Mule Ver.0.9.8 by K.Handa <handa@etl.go.jp>
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
24
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
25 (defconst viqr-regexp
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
26 "[aeiouyAEIOUY]\\([(^+]?['`?~.]\\|[(^+]\\)\\|[Dd][Dd]")
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
27
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
28 ;;;###autoload
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
29 (defun vn-compose-viqr (from to)
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
30 "Convert 'VIQR' mnemonics of the current region to
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
31 pre-composed Vietnamese characaters."
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
32 (interactive "r")
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
33 (let (quail-current-package map key def)
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
34 (quail-use-package "viqr")
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
35 (setq map (quail-map))
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
36 (save-restriction
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
37 (narrow-to-region from to)
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
38 (goto-char (point-min))
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
39 (while (re-search-forward viqr-regexp 0 t)
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
40 (setq key (buffer-substring (match-beginning 0) (match-end 0)))
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
41 (setq def (lookup-key map key))
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
42 (if (numberp def)
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
43 (if (> def 2)
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
44 (setq key (substring key 0 (1- def))
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
45 def (lookup-key map key))))
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
46 (if (keymapp def)
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
47 (progn
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
48 (goto-char (match-beginning 0))
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
49 (delete-region (point) (+ (point) (length key)))
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
50 (insert (quail-get-candidate def t))))))))
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
51
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
52 ;;;###autoload
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
53 (defun vn-compose-viqr-buffer ()
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
54 (interactive)
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
55 (vn-compose-viqr (point-min) (point-max)))
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
56
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
57 ;;;###autoload
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
58 (defun vn-decompose-viqr (from to)
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
59 "Convert pre-composed Vietnamese characaters of the current region to
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
60 'VIQR' mnemonics."
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
61 (interactive "r")
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
62 (let (quail-current-package decode-map key def)
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
63 (quail-use-package "viqr")
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
64 (setq decode-map (quail-decode-map))
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
65 (save-restriction
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
66 (narrow-to-region from to)
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
67 (goto-char (point-min))
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
68 (while (re-search-forward "\\cv" 0 t)
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
69 (setq def (preceding-char))
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
70 (if (setq key (assq def decode-map))
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
71 (progn
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
72 (delete-char -1)
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
73 (insert (cdr key))))))))
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
74
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
75 ;;;###autoload
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
76 (defun vn-decompose-viqr-buffer ()
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
77 (interactive)
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
78 (vn-decompose-viqr (point-min) (point-max)))
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
79
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
80 ;;;
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
81 (provide 'viet)
acd284d43ca1 Import from CVS: tag r20-3b25
cvs
parents:
diff changeset
82 (provide 'vietnamese)