;;; tv-util.el --- support for Tai Viet -*- coding: utf-8 -*-
-;; Copyright (C) 2007
+;; Copyright (C) 2007, 2008, 2009
;; National Institute of Advanced Industrial Science and Technology (AIST)
;; Registration Number H13PRO009
;; 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 2, 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/>.
;;; Code
;; Regexp matching with a sequence of Tai Viet characters.
(defconst tai-viet-re
- (format "[\xaa80-\xaac2\xaadb-\xaadf]+"))
+ (format "[\xaa80-\xaac2\xaadb-\xaadf-]+"))
;; Char-table of information about glyph type of Tai Viet characters.
(defconst tai-viet-glyph-info
(specials '((right-overhang . "ꪊꪋꪌꪍꪏꪓꪖꪜꪞꪡꪤꪨ")
(left-overhang . "ꫂ")
(combining-vowel . "ꪴꪰꪲꪳꪷꪸꪾ")
- (combining-tone . "꪿꫁"))))
+ (combining-tone . "꪿꫁")
+ (misc . "-"))))
;; Set all TaiViet characters to `t'.
(set-char-table-range table (cons #xaa80 #xaac2) t)
(set-char-table-range table (cons #xaadb #xaadf) t)
;;;###autoload
-(defun tai-viet-composition-function (pos &optional string)
- (let (to)
- (if string
- (progn
- (if (string-match tai-viet-re string pos)
- (tai-viet-compose-string pos (match-end 0) string)
- (1+ pos)))
- (goto-char pos)
- (if (looking-at tai-viet-re)
- (tai-viet-compose-region pos (match-end 0))
- (1+ pos)))))
+(defun tai-viet-composition-function (from to font-object string)
+ (if string
+ (if (string-match tai-viet-re string from)
+ (tai-viet-compose-string from (match-end 0) string))
+ (goto-char from)
+ (if (looking-at tai-viet-re)
+ (tai-viet-compose-region from (match-end 0)))))
;;
(provide 'tai-viet-util)
+
+;; arch-tag: a45ac3fc-07d0-44d5-8841-2ebea7e11f5b