# HG changeset patch # User Kenichi Handa # Date 1069747661 0 # Node ID 91f056b94e706ca239e088b1f756866be5c1b8dc # Parent 6f848cbaeb524ccb0c35327ba826849d5e842a4f (auto-compose-chars): Fix previous change. diff -r 6f848cbaeb52 -r 91f056b94e70 lisp/composite.el --- a/lisp/composite.el Mon Nov 24 08:29:16 2003 +0000 +++ b/lisp/composite.el Tue Nov 25 08:07:41 2003 +0000 @@ -405,16 +405,27 @@ This function is the default value of `auto-composition-function' (which see)." (save-buffer-state nil - (save-match-data - (let ((start pos) - (limit (if string (length string) (point-max))) - ch func newpos) - (setq limit (or (text-property-any pos limit 'auto-composed t string) - limit)) - (catch 'tag - (if string + (save-excursion + (save-match-data + (let ((start pos) + (limit (if string (length string) (point-max))) + ch func newpos) + (setq limit (or (text-property-any pos limit 'auto-composed t string) + limit)) + (catch 'tag + (if string + (while (< pos limit) + (setq ch (aref string pos)) + (if (= ch ?\n) + (throw 'tag nil)) + (setq func (aref composition-function-table ch)) + (if (and (functionp func) + (setq newpos (funcall func pos string)) + (> newpos pos)) + (setq pos newpos) + (setq pos (1+ pos)))) (while (< pos limit) - (setq ch (aref string pos)) + (setq ch (char-after pos)) (if (= ch ?\n) (throw 'tag nil)) (setq func (aref composition-function-table ch)) @@ -422,18 +433,8 @@ (setq newpos (funcall func pos string)) (> newpos pos)) (setq pos newpos) - (setq pos (1+ pos)))) - (while (< pos limit) - (setq ch (char-after pos)) - (if (= ch ?\n) - (throw 'tag nil)) - (setq func (aref composition-function-table ch)) - (if (and (functionp func) - (setq newpos (funcall func pos string)) - (> newpos pos)) - (setq pos newpos) - (setq pos (1+ pos)))))) - (put-text-property start pos 'auto-composed t string))))) + (setq pos (1+ pos)))))) + (put-text-property start pos 'auto-composed t string)))))) (setq auto-composition-function 'auto-compose-chars)