;;; tibet-util.el --- utilities for Tibetan -*- coding: iso-2022-7bit; -*-
-;; Copyright (C) 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+;; Copyright (C) 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
;; Free Software Foundation, Inc.
;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007
+;; 2005, 2006, 2007, 2008
;; National Institute of Advanced Industrial Science and Technology (AIST)
;; Registration Number H14PRO021
;; 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)
+;; 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,
;;;###autoload
(defun tibetan-composition-function (pos &optional string)
- (setq pos (1- pos))
(if string
- ;; Not yet implemented.
- nil
- (if (>= pos (point-min))
- (save-excursion
- (goto-char pos)
+ (if auto-compose-current-font
+ (if (eq (string-match "[\e$(7!0\e(B-\e$,1GQ\e(B]+" pos) pos)
+ (or (font-shape-text 0 (match-end 0) auto-compose-current-font
+ string)
+ pos)))
+ (goto-char pos)
+ (if auto-compose-current-font
+ (if (looking-at "[\e$(7!0\e(B-\e$,1GQ\e(B]+")
+ (or (font-shape-text pos (match-end 0) auto-compose-current-font)
+ pos)
(if (looking-at tibetan-composable-pattern)
(prog1 (match-end 0)
(tibetan-compose-region pos (match-end 0))))))))