aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenichi Handa2003-09-30 11:09:29 +0000
committerKenichi Handa2003-09-30 11:09:29 +0000
commit36358790c032dd01e452a04a224d7b7acffa1ba2 (patch)
treea7365f6fd4e1856e76a1f0f368b132cac036936b
parente53d2f0069d07b6823b0698cf441fe6f3843b7bc (diff)
downloademacs-36358790c032dd01e452a04a224d7b7acffa1ba2.tar.gz
emacs-36358790c032dd01e452a04a224d7b7acffa1ba2.zip
(auto-composition-chunk-size): Variable deleted.
(auto-compose-chars): Always stop after processing a newline.
-rw-r--r--lisp/composite.el53
1 files changed, 28 insertions, 25 deletions
diff --git a/lisp/composite.el b/lisp/composite.el
index ad1a37f69cb..a076d996677 100644
--- a/lisp/composite.el
+++ b/lisp/composite.el
@@ -398,9 +398,6 @@ See also the command `toggle-auto-composition'.")
398 ;;(def-edebug-spec save-buffer-state let) 398 ;;(def-edebug-spec save-buffer-state let)
399 ) 399 )
400 400
401(defvar auto-composition-chunk-size 500
402 "*Automatic composition uses chunks of this many characters, or smaller.")
403
404(defun auto-compose-chars (pos string) 401(defun auto-compose-chars (pos string)
405 "Compose characters after the buffer position POS. 402 "Compose characters after the buffer position POS.
406If STRING is non-nil, it is a string, and POS is an index into the string. 403If STRING is non-nil, it is a string, and POS is an index into the string.
@@ -411,28 +408,34 @@ This function is the default value of `auto-composition-function' (which see)."
411 (save-excursion 408 (save-excursion
412 (save-restriction 409 (save-restriction
413 (save-match-data 410 (save-match-data
414 (let* ((start pos) 411 (let ((start pos)
415 (end (if string (length string) (point-max))) 412 (limit (next-single-property-change pos 'auto-composed string))
416 (limit (next-single-property-change pos 'auto-composed string 413 ch func newpos)
417 end)) 414 (if limit
418 (lines 0) 415 (setq limit (1+ limit))
419 ch func newpos) 416 (setq limit (if string (length string) (point-max))))
420 (if (> (- limit start) auto-composition-chunk-size) 417 (catch 'tag
421 (setq limit (+ start auto-composition-chunk-size))) 418 (if string
422 (while (and (< pos end) 419 (while (< pos limit)
423 (setq ch (if string (aref string pos) 420 (setq ch (aref string pos)
424 (char-after pos))) 421 pos (1+ pos))
425 (or (< pos limit) 422 (if (= ch ?\n)
426 (/= ch ?\n))) 423 (throw 'tag nil))
427 (setq func (aref composition-function-table ch)) 424 (setq func (aref composition-function-table ch))
428 (if (functionp func) 425 (if (and (functionp func)
429 (setq newpos (funcall func pos string) 426 (setq newpos (funcall func (1- pos) string))
430 pos (if (and (integerp newpos) (> newpos pos)) 427 (> newpos pos))
431 newpos 428 (setq pos newpos)))
432 (1+ pos))) 429 (while (< pos limit)
433 (setq pos (1+ pos)))) 430 (setq ch (char-after pos)
434 (if (< pos limit) 431 pos (1+ pos))
435 (setq pos (1+ pos))) 432 (if (= ch ?\n)
433 (throw 'tag nil))
434 (setq func (aref composition-function-table ch))
435 (if (and (functionp func)
436 (setq newpos (funcall func (1- pos) string))
437 (> newpos pos))
438 (setq pos newpos)))))
436 (put-text-property start pos 'auto-composed t string))))))) 439 (put-text-property start pos 'auto-composed t string)))))))
437 440
438(setq auto-composition-function 'auto-compose-chars) 441(setq auto-composition-function 'auto-compose-chars)