1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-18 10:16:51 +00:00

(compose-region): Insert then delete

to preserve markers.
(decompose-region): Use search-forward for efficiency.
This commit is contained in:
Kenichi Handa 1998-10-26 08:00:11 +00:00
parent 4cec2d0a49
commit 27606920fb

View File

@ -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)