# HG changeset patch # User Kenichi Handa # Date 1064920169 0 # Node ID 44b83fad0b9b10cf63b50efad5e3370ecb30b8a4 # Parent 5addd0693c9dc04fc5d45c0b5aaf9aa55eeed368 (auto-composition-chunk-size): Variable deleted. (auto-compose-chars): Always stop after processing a newline. diff -r 5addd0693c9d -r 44b83fad0b9b lisp/composite.el --- a/lisp/composite.el Tue Sep 30 11:07:55 2003 +0000 +++ b/lisp/composite.el Tue Sep 30 11:09:29 2003 +0000 @@ -398,9 +398,6 @@ ;;(def-edebug-spec save-buffer-state let) ) -(defvar auto-composition-chunk-size 500 - "*Automatic composition uses chunks of this many characters, or smaller.") - (defun auto-compose-chars (pos string) "Compose characters after the buffer position POS. If STRING is non-nil, it is a string, and POS is an index into the string. @@ -411,28 +408,34 @@ (save-excursion (save-restriction (save-match-data - (let* ((start pos) - (end (if string (length string) (point-max))) - (limit (next-single-property-change pos 'auto-composed string - end)) - (lines 0) - ch func newpos) - (if (> (- limit start) auto-composition-chunk-size) - (setq limit (+ start auto-composition-chunk-size))) - (while (and (< pos end) - (setq ch (if string (aref string pos) - (char-after pos))) - (or (< pos limit) - (/= ch ?\n))) - (setq func (aref composition-function-table ch)) - (if (functionp func) - (setq newpos (funcall func pos string) - pos (if (and (integerp newpos) (> newpos pos)) - newpos - (1+ pos))) - (setq pos (1+ pos)))) - (if (< pos limit) - (setq pos (1+ pos))) + (let ((start pos) + (limit (next-single-property-change pos 'auto-composed string)) + ch func newpos) + (if limit + (setq limit (1+ limit)) + (setq limit (if string (length string) (point-max)))) + (catch 'tag + (if string + (while (< pos limit) + (setq ch (aref string pos) + pos (1+ pos)) + (if (= ch ?\n) + (throw 'tag nil)) + (setq func (aref composition-function-table ch)) + (if (and (functionp func) + (setq newpos (funcall func (1- pos) string)) + (> newpos pos)) + (setq pos newpos))) + (while (< pos limit) + (setq ch (char-after pos) + pos (1+ pos)) + (if (= ch ?\n) + (throw 'tag nil)) + (setq func (aref composition-function-table ch)) + (if (and (functionp func) + (setq newpos (funcall func (1- pos) string)) + (> newpos pos)) + (setq pos newpos))))) (put-text-property start pos 'auto-composed t string))))))) (setq auto-composition-function 'auto-compose-chars)