aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenichi Handa2003-11-25 08:07:41 +0000
committerKenichi Handa2003-11-25 08:07:41 +0000
commitc8e89221aad9afc254cbec666d0357262afda2a8 (patch)
treecf092895a5b52f5853d487b1ee05cb65fb2600ee
parent9d0ca2a33f60ef4713339313315d512bdf94568c (diff)
downloademacs-c8e89221aad9afc254cbec666d0357262afda2a8.tar.gz
emacs-c8e89221aad9afc254cbec666d0357262afda2a8.zip
(auto-compose-chars): Fix previous change.
-rw-r--r--lisp/composite.el43
1 files changed, 22 insertions, 21 deletions
diff --git a/lisp/composite.el b/lisp/composite.el
index c4edc14cce2..4f8f1cb4ce2 100644
--- a/lisp/composite.el
+++ b/lisp/composite.el
@@ -405,16 +405,27 @@ In that case, compose characters in the string.
405 405
406This function is the default value of `auto-composition-function' (which see)." 406This function is the default value of `auto-composition-function' (which see)."
407 (save-buffer-state nil 407 (save-buffer-state nil
408 (save-match-data 408 (save-excursion
409 (let ((start pos) 409 (save-match-data
410 (limit (if string (length string) (point-max))) 410 (let ((start pos)
411 ch func newpos) 411 (limit (if string (length string) (point-max)))
412 (setq limit (or (text-property-any pos limit 'auto-composed t string) 412 ch func newpos)
413 limit)) 413 (setq limit (or (text-property-any pos limit 'auto-composed t string)
414 (catch 'tag 414 limit))
415 (if string 415 (catch 'tag
416 (if string
417 (while (< pos limit)
418 (setq ch (aref string pos))
419 (if (= ch ?\n)
420 (throw 'tag nil))
421 (setq func (aref composition-function-table ch))
422 (if (and (functionp func)
423 (setq newpos (funcall func pos string))
424 (> newpos pos))
425 (setq pos newpos)
426 (setq pos (1+ pos))))
416 (while (< pos limit) 427 (while (< pos limit)
417 (setq ch (aref string pos)) 428 (setq ch (char-after pos))
418 (if (= ch ?\n) 429 (if (= ch ?\n)
419 (throw 'tag nil)) 430 (throw 'tag nil))
420 (setq func (aref composition-function-table ch)) 431 (setq func (aref composition-function-table ch))
@@ -422,18 +433,8 @@ This function is the default value of `auto-composition-function' (which see)."
422 (setq newpos (funcall func pos string)) 433 (setq newpos (funcall func pos string))
423 (> newpos pos)) 434 (> newpos pos))
424 (setq pos newpos) 435 (setq pos newpos)
425 (setq pos (1+ pos)))) 436 (setq pos (1+ pos))))))
426 (while (< pos limit) 437 (put-text-property start pos 'auto-composed t string))))))
427 (setq ch (char-after pos))
428 (if (= ch ?\n)
429 (throw 'tag nil))
430 (setq func (aref composition-function-table ch))
431 (if (and (functionp func)
432 (setq newpos (funcall func pos string))
433 (> newpos pos))
434 (setq pos newpos)
435 (setq pos (1+ pos))))))
436 (put-text-property start pos 'auto-composed t string)))))
437 438
438(setq auto-composition-function 'auto-compose-chars) 439(setq auto-composition-function 'auto-compose-chars)
439 440