# HG changeset patch # User Kenichi Handa # Date 909388811 0 # Node ID aab4ef022ffd4fb0665c917a2124cc6cb7673e8d # Parent 87736ae8e5ff005c944a0e6f469b325d377a51c7 (compose-region): Insert then delete to preserve markers. (decompose-region): Use search-forward for efficiency. diff -r 87736ae8e5ff -r aab4ef022ffd lisp/international/mule-util.el --- a/lisp/international/mule-util.el Mon Oct 26 08:00:11 1998 +0000 +++ b/lisp/international/mule-util.el Mon Oct 26 08:00:11 1998 +0000 @@ -370,8 +370,8 @@ (save-excursion (let ((str (buffer-substring start end))) (goto-char start) - (delete-region start end) - (insert (compose-string str))))) + (insert (compose-string str)) + (delete-char (- end start))))) ;;;###autoload (defun decompose-region (start end) @@ -384,13 +384,14 @@ (save-restriction (narrow-to-region start end) (goto-char (point-min)) - (while (not (eobp)) - (let ((ch (following-char))) - (if (>= ch min-composite-char) - (progn - (delete-char 1) - (insert (decompose-composite-char ch))) - (forward-char 1))))))) + (let ((cmpchar-head (char-to-string leading-code-composition))) + (while (search-forward cmpchar-head nil t) + (let ((ch (preceding-char))) + (if (>= ch min-composite-char) + (progn + (delete-char -1) + (insert (decompose-composite-char ch))) + (forward-char 1)))))))) ;;;###autoload (defun decompose-string (string)