diff options
| author | Kenichi Handa | 1998-10-26 08:00:11 +0000 |
|---|---|---|
| committer | Kenichi Handa | 1998-10-26 08:00:11 +0000 |
| commit | 27606920fbf588089b094e11c9cff26fa2364ccf (patch) | |
| tree | fdf6eef195bbecacf94fc1a5b5473bad78dc320e | |
| parent | 4cec2d0a49721657987972291bd84775825e4c93 (diff) | |
| download | emacs-27606920fbf588089b094e11c9cff26fa2364ccf.tar.gz emacs-27606920fbf588089b094e11c9cff26fa2364ccf.zip | |
(compose-region): Insert then delete
to preserve markers.
(decompose-region): Use search-forward for efficiency.
| -rw-r--r-- | lisp/international/mule-util.el | 19 |
1 files changed, 10 insertions, 9 deletions
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." | |||
| 370 | (save-excursion | 370 | (save-excursion |
| 371 | (let ((str (buffer-substring start end))) | 371 | (let ((str (buffer-substring start end))) |
| 372 | (goto-char start) | 372 | (goto-char start) |
| 373 | (delete-region start end) | 373 | (insert (compose-string str)) |
| 374 | (insert (compose-string str))))) | 374 | (delete-char (- end start))))) |
| 375 | 375 | ||
| 376 | ;;;###autoload | 376 | ;;;###autoload |
| 377 | (defun decompose-region (start end) | 377 | (defun decompose-region (start end) |
| @@ -384,13 +384,14 @@ positions (integers or markers) specifying the region." | |||
| 384 | (save-restriction | 384 | (save-restriction |
| 385 | (narrow-to-region start end) | 385 | (narrow-to-region start end) |
| 386 | (goto-char (point-min)) | 386 | (goto-char (point-min)) |
| 387 | (while (not (eobp)) | 387 | (let ((cmpchar-head (char-to-string leading-code-composition))) |
| 388 | (let ((ch (following-char))) | 388 | (while (search-forward cmpchar-head nil t) |
| 389 | (if (>= ch min-composite-char) | 389 | (let ((ch (preceding-char))) |
| 390 | (progn | 390 | (if (>= ch min-composite-char) |
| 391 | (delete-char 1) | 391 | (progn |
| 392 | (insert (decompose-composite-char ch))) | 392 | (delete-char -1) |
| 393 | (forward-char 1))))))) | 393 | (insert (decompose-composite-char ch))) |
| 394 | (forward-char 1)))))))) | ||
| 394 | 395 | ||
| 395 | ;;;###autoload | 396 | ;;;###autoload |
| 396 | (defun decompose-string (string) | 397 | (defun decompose-string (string) |