From: Kenichi Handa Date: Mon, 26 Oct 1998 08:00:11 +0000 (+0000) Subject: (compose-region): Insert then delete X-Git-Tag: emacs-20.4~1400 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=27606920fbf588089b094e11c9cff26fa2364ccf;p=emacs.git (compose-region): Insert then delete to preserve markers. (decompose-region): Use search-forward for efficiency. --- diff --git a/lisp/international/mule-util.el b/lisp/international/mule-util.el index 39eb9e3a9b1..7e237a6ea56 100644 --- a/lisp/international/mule-util.el +++ b/lisp/international/mule-util.el @@ -370,8 +370,8 @@ positions (integers or markers) specifying the region." (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 @@ positions (integers or markers) specifying the region." (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)