diff options
| author | Kenichi Handa | 2004-04-20 05:24:12 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2004-04-20 05:24:12 +0000 |
| commit | 1fd730f7b6a2d822f7bfb0f05d422ea86e6158a8 (patch) | |
| tree | 6d5ab8da0da2cbbd86d0b852e5c2edcb323d6383 | |
| parent | f11c35b6eb9bc0fd6b4f07fbd0c598cbbbd9aa43 (diff) | |
| download | emacs-1fd730f7b6a2d822f7bfb0f05d422ea86e6158a8.tar.gz emacs-1fd730f7b6a2d822f7bfb0f05d422ea86e6158a8.zip | |
(diacritic-compose-region): Compose
diacritical marks only with a character whose syntax is word
constituent.
(diacritic-compose-string): Likewise.
(diacritic-composition-function): Likewise.
(diacritic-post-read-conversion): Delete it.
| -rw-r--r-- | lisp/language/european.el | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lisp/language/european.el b/lisp/language/european.el index 3da1850a718..4c12f1bf591 100644 --- a/lisp/language/european.el +++ b/lisp/language/european.el | |||
| @@ -657,13 +657,15 @@ positions (integers or markers) specifying the region." | |||
| 657 | (narrow-to-region beg end) | 657 | (narrow-to-region beg end) |
| 658 | (goto-char (point-min)) | 658 | (goto-char (point-min)) |
| 659 | (while (re-search-forward diacritic-composition-pattern nil t) | 659 | (while (re-search-forward diacritic-composition-pattern nil t) |
| 660 | (compose-region (match-beginning 0) (match-end 0))))) | 660 | (if (= (char-syntax (char-after (match-beginning 0))) ?w) |
| 661 | (compose-region (match-beginning 0) (match-end 0)))))) | ||
| 661 | 662 | ||
| 662 | (defun diacritic-compose-string (string) | 663 | (defun diacritic-compose-string (string) |
| 663 | "Compose diacritic characters in STRING and return the resulting string." | 664 | "Compose diacritic characters in STRING and return the resulting string." |
| 664 | (let ((idx 0)) | 665 | (let ((idx 0)) |
| 665 | (while (setq idx (string-match diacritic-composition-pattern string idx)) | 666 | (while (setq idx (string-match diacritic-composition-pattern string idx)) |
| 666 | (compose-string string idx (match-end 0)) | 667 | (if (= (char-syntax (aref string idx)) ?w) |
| 668 | (compose-string string idx (match-end 0))) | ||
| 667 | (setq idx (match-end 0)))) | 669 | (setq idx (match-end 0)))) |
| 668 | string) | 670 | string) |
| 669 | 671 | ||
| @@ -672,10 +674,6 @@ positions (integers or markers) specifying the region." | |||
| 672 | (interactive) | 674 | (interactive) |
| 673 | (diacritic-compose-region (point-min) (point-max))) | 675 | (diacritic-compose-region (point-min) (point-max))) |
| 674 | 676 | ||
| 675 | (defun diacritic-post-read-conversion (len) | ||
| 676 | (diacritic-compose-region (point) (+ (point) len)) | ||
| 677 | len) | ||
| 678 | |||
| 679 | (defun diacritic-composition-function (pos &optional string) | 677 | (defun diacritic-composition-function (pos &optional string) |
| 680 | "Compose diacritic text around POS. | 678 | "Compose diacritic text around POS. |
| 681 | Optional 2nd argument STRING, if non-nil, is a string containing text | 679 | Optional 2nd argument STRING, if non-nil, is a string containing text |
| @@ -688,7 +686,7 @@ or nil if no characters are composed." | |||
| 688 | (if (>= pos 0) | 686 | (if (>= pos 0) |
| 689 | (let ((ch (aref string pos)) | 687 | (let ((ch (aref string pos)) |
| 690 | start end components ch composition) | 688 | start end components ch composition) |
| 691 | (when (and (>= ch 32) (or (< ch 127) (>= ch 160))) | 689 | (when (= (char-syntax ch) ?w) |
| 692 | (setq start pos | 690 | (setq start pos |
| 693 | end (length string) | 691 | end (length string) |
| 694 | components (list ch) | 692 | components (list ch) |
| @@ -706,7 +704,7 @@ or nil if no characters are composed." | |||
| 706 | (if (>= pos (point-min)) | 704 | (if (>= pos (point-min)) |
| 707 | (let ((ch (char-after pos)) | 705 | (let ((ch (char-after pos)) |
| 708 | start end components composition) | 706 | start end components composition) |
| 709 | (when (and (>= ch 32) (or (< ch 127) (>= ch 160))) | 707 | (when (= (char-syntax ch) ?w) |
| 710 | (setq start pos | 708 | (setq start pos |
| 711 | end (point-max) | 709 | end (point-max) |
| 712 | components (list ch) | 710 | components (list ch) |