;; 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 3, 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/>.
;;; Commentary:
lao-str)))
;;;###autoload
-(defun lao-composition-function (pos &optional string)
- (setq pos (1- pos))
- (with-category-table lao-category-table
- (if string
- (if (and (>= pos 0)
- (eq (string-match lao-composition-pattern string pos) pos))
- (prog1 (match-end 0)
- (compose-string string pos (match-end 0))))
- (if (>= pos (point-min))
+(defun lao-composition-function (from to font-object string)
+ (or (and font-object
+ (font-shape-text from to font-object string))
+ (with-category-table lao-category-table
+ (if string
+ (if (eq (string-match lao-composition-pattern string from) to)
+ (prog1 (match-end 0)
+ (compose-string string from (match-end 0))))
(save-excursion
- (goto-char pos)
+ (goto-char from)
(if (looking-at lao-composition-pattern)
(prog1 (match-end 0)
- (compose-region pos (match-end 0)))))))))
+ (compose-region from (match-end 0)))))))))
;;;###autoload
(defun lao-compose-region (from to)
;;
(provide 'lao-util)
-;;; arch-tag: 1f828781-3cb8-4695-88af-8f33222338ce
+;; arch-tag: 1f828781-3cb8-4695-88af-8f33222338ce
;;; lao-util.el ends here