diff options
| author | Kenichi Handa | 2008-08-29 07:59:21 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2008-08-29 07:59:21 +0000 |
| commit | 620f3d8c7d9240f3d273a723e101e012ce450277 (patch) | |
| tree | 161797efbb7687fc15c96d7a0fef2eab15b4a00c /lisp | |
| parent | 473ccad07a107f7c30031d1a5d454e1893b7fed1 (diff) | |
| download | emacs-620f3d8c7d9240f3d273a723e101e012ce450277.tar.gz emacs-620f3d8c7d9240f3d273a723e101e012ce450277.zip | |
Don't setup composition-function-table.
(diacritic-composition-pattern, diacritic-compose-region)
(diacritic-compose-string, diacritic-compose-buffer)
(diacritic-composition-function): Delete them.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/language/european.el | 114 |
1 files changed, 0 insertions, 114 deletions
diff --git a/lisp/language/european.el b/lisp/language/european.el index b32d5f9ee31..135bee27f7c 100644 --- a/lisp/language/european.el +++ b/lisp/language/european.el | |||
| @@ -637,120 +637,6 @@ method and applying Turkish case rules for the characters i, I, $(D)E(B, $(D* | |||
| 637 | :charset-list '(adobe-standard-encoding) | 637 | :charset-list '(adobe-standard-encoding) |
| 638 | :mime-charset 'adobe-standard-encoding) | 638 | :mime-charset 'adobe-standard-encoding) |
| 639 | 639 | ||
| 640 | |||
| 641 | ;; For automatic composing of diacritics and combining marks. | ||
| 642 | (dolist (range '( ;; combining diacritical marks | ||
| 643 | (#x0300 #x0314 (tc . bc)) | ||
| 644 | (#x0315 (tr . bl)) | ||
| 645 | (#x0316 #x0319 (bc . tc)) | ||
| 646 | (#x031A (tr . cl)) | ||
| 647 | (#x031B #x0320 (bc . tc)) | ||
| 648 | (#x0321 (Br . tr)) | ||
| 649 | (#x0322 (Br . tl)) | ||
| 650 | (#x0323 #x0333 (bc . tc)) | ||
| 651 | (#x0334 #x0338 (Bc . Bc)) | ||
| 652 | (#x0339 #x033C (bc . tc)) | ||
| 653 | (#x033D #x033F (tc . bc)) | ||
| 654 | (#x0340 (tl . bc)) | ||
| 655 | (#x0341 (tr . bc)) | ||
| 656 | (#x0342 #x0344 (tc . bc)) | ||
| 657 | (#x0345 (bc . tc)) | ||
| 658 | (#x0346 (tc . bc)) | ||
| 659 | (#x0347 #x0349 (bc . tc)) | ||
| 660 | (#x034A #x034C (tc . bc)) | ||
| 661 | (#x034D #x034E (bc . tc)) | ||
| 662 | ;; combining diacritical marks for symbols | ||
| 663 | (#x20D0 #x20D1 (tc . bc)) | ||
| 664 | (#x20D2 #x20D3 (Bc . Bc)) | ||
| 665 | (#x20D4 #x20D7 (tc . bc)) | ||
| 666 | (#x20D8 #x20DA (Bc . Bc)) | ||
| 667 | (#x20DB #x20DC (tc . bc)) | ||
| 668 | (#x20DD #x20E0 (Bc . Bc)) | ||
| 669 | (#x20E1 (tc . bc)) | ||
| 670 | (#x20E2 #x20E3 (Bc . Bc)))) | ||
| 671 | (let* ((from (car range)) | ||
| 672 | (to (if (= (length range) 3) | ||
| 673 | (nth 1 range) | ||
| 674 | from)) | ||
| 675 | (composition (car (last range)))) | ||
| 676 | (while (<= from to) | ||
| 677 | (put-char-code-property from 'diacritic-composition composition) | ||
| 678 | (aset composition-function-table from 'diacritic-composition-function) | ||
| 679 | (setq from (1+ from))))) | ||
| 680 | |||
| 681 | (defconst diacritic-composition-pattern "\\C^\\c^+") | ||
| 682 | |||
| 683 | (defun diacritic-compose-region (beg end) | ||
| 684 | "Compose diacritic characters in the region. | ||
| 685 | When called from a program, expects two arguments, | ||
| 686 | positions (integers or markers) specifying the region." | ||
| 687 | (interactive "r") | ||
| 688 | (save-restriction | ||
| 689 | (narrow-to-region beg end) | ||
| 690 | (goto-char (point-min)) | ||
| 691 | (while (re-search-forward diacritic-composition-pattern nil t) | ||
| 692 | (if (= (char-syntax (char-after (match-beginning 0))) ?w) | ||
| 693 | (compose-region (match-beginning 0) (match-end 0)))))) | ||
| 694 | |||
| 695 | (defun diacritic-compose-string (string) | ||
| 696 | "Compose diacritic characters in STRING and return the resulting string." | ||
| 697 | (let ((idx 0)) | ||
| 698 | (while (setq idx (string-match diacritic-composition-pattern string idx)) | ||
| 699 | (if (= (char-syntax (aref string idx)) ?w) | ||
| 700 | (compose-string string idx (match-end 0))) | ||
| 701 | (setq idx (match-end 0)))) | ||
| 702 | string) | ||
| 703 | |||
| 704 | (defun diacritic-compose-buffer () | ||
| 705 | "Compose diacritic characters in the current buffer." | ||
| 706 | (interactive) | ||
| 707 | (diacritic-compose-region (point-min) (point-max))) | ||
| 708 | |||
| 709 | (defun diacritic-composition-function (pos to font-object string) | ||
| 710 | "Compose diacritic text around POS. | ||
| 711 | Optional 2nd argument STRING, if non-nil, is a string containing text | ||
| 712 | to compose. | ||
| 713 | |||
| 714 | The return value is the end position of composed characters, | ||
| 715 | or nil if no characters are composed." | ||
| 716 | (setq pos (1- pos)) | ||
| 717 | (if string | ||
| 718 | (if (>= pos 0) | ||
| 719 | (let ((ch (aref string pos)) | ||
| 720 | start end components ch composition) | ||
| 721 | (when (= (char-syntax ch) ?w) | ||
| 722 | (setq start pos | ||
| 723 | end (length string) | ||
| 724 | components (list ch) | ||
| 725 | pos (1+ pos)) | ||
| 726 | (while (and | ||
| 727 | (< pos end) | ||
| 728 | (setq ch (aref string pos) | ||
| 729 | composition | ||
| 730 | (get-char-code-property ch | ||
| 731 | 'diacritic-composition))) | ||
| 732 | (setq components (cons ch (cons composition components)) | ||
| 733 | pos (1+ pos))) | ||
| 734 | (compose-string string start pos (nreverse components)) | ||
| 735 | pos))) | ||
| 736 | (if (>= pos (point-min)) | ||
| 737 | (let ((ch (char-after pos)) | ||
| 738 | start end components composition) | ||
| 739 | (when (= (char-syntax ch) ?w) | ||
| 740 | (setq start pos | ||
| 741 | end (point-max) | ||
| 742 | components (list ch) | ||
| 743 | pos (1+ pos)) | ||
| 744 | (while (and | ||
| 745 | (< pos end) | ||
| 746 | (setq ch (char-after pos) | ||
| 747 | composition | ||
| 748 | (get-char-code-property ch 'diacritic-composition))) | ||
| 749 | (setq components (cons ch (cons composition components)) | ||
| 750 | pos (1+ pos))) | ||
| 751 | (compose-region start pos (nreverse components)) | ||
| 752 | pos))))) | ||
| 753 | |||
| 754 | (provide 'european) | 640 | (provide 'european) |
| 755 | 641 | ||
| 756 | ;; arch-tag: 9e018b12-fb02-4120-907b-9adeaf84b5c2 | 642 | ;; arch-tag: 9e018b12-fb02-4120-907b-9adeaf84b5c2 |