aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenichi Handa2004-01-20 08:27:17 +0000
committerKenichi Handa2004-01-20 08:27:17 +0000
commit5ef807becbfa3d2f9da0b6a88ecf113e2d4bedb2 (patch)
tree366c86a6d0d8883b00b894a8c89f1c08bd222c5f
parentc80bcdbc4747416e3d7129afd0cdcb6e16e49789 (diff)
downloademacs-5ef807becbfa3d2f9da0b6a88ecf113e2d4bedb2.tar.gz
emacs-5ef807becbfa3d2f9da0b6a88ecf113e2d4bedb2.zip
(diacritic-composition-function): Fix for the case that POS is at the
head. Allow combining with more characters.
-rw-r--r--lisp/language/european.el72
1 files changed, 35 insertions, 37 deletions
diff --git a/lisp/language/european.el b/lisp/language/european.el
index e56c5f49df4..2035d479487 100644
--- a/lisp/language/european.el
+++ b/lisp/language/european.el
@@ -686,43 +686,41 @@ The return value is the end position of composed characters,
686or nil if no characters are composed." 686or nil if no characters are composed."
687 (setq pos (1- pos)) 687 (setq pos (1- pos))
688 (if string 688 (if string
689 (let ((ch (aref string pos)) 689 (if (>= pos 0)
690 start end components ch composition) 690 (let ((ch (aref string pos))
691 (when (and (>= pos 0) 691 start end components ch composition)
692 ;; Previous character is latin. 692 (when (and (>= ch 32) (or (< ch 127) (>= ch 160)))
693 (aref (char-category-set ch) ?l) 693 (setq start pos
694 (/= ch 32)) 694 end (length string)
695 (setq start pos 695 components (list ch)
696 end (length string) 696 pos (1+ pos))
697 components (list ch) 697 (while (and
698 pos (1+ pos)) 698 (< pos end)
699 (while (and 699 (setq ch (aref string pos)
700 (< pos end) 700 composition
701 (setq ch (aref string pos) 701 (get-char-code-property ch
702 composition 702 'diacritic-composition)))
703 (get-char-code-property ch 'diacritic-composition))) 703 (setq components (cons ch (cons composition components))
704 (setq components (cons ch (cons composition components)) 704 pos (1+ pos)))
705 pos (1+ pos))) 705 (compose-string string start pos (nreverse components))
706 (compose-string string start pos (nreverse components)) 706 pos)))
707 pos)) 707 (if (>= pos (point-min))
708 (let ((ch (char-after pos)) 708 (let ((ch (char-after pos))
709 start end components composition) 709 start end components composition)
710 (when (and (>= pos (point-min)) 710 (when (and (>= ch 32) (or (< ch 127) (>= ch 160)))
711 (aref (char-category-set ch) ?l) 711 (setq start pos
712 (/= ch 32)) 712 end (point-max)
713 (setq start pos 713 components (list ch)
714 end (point-max) 714 pos (1+ pos))
715 components (list ch) 715 (while (and
716 pos (1+ pos)) 716 (< pos end)
717 (while (and 717 (setq ch (char-after pos)
718 (< pos end) 718 composition
719 (setq ch (char-after pos) 719 (get-char-code-property ch 'diacritic-composition)))
720 composition 720 (setq components (cons ch (cons composition components))
721 (get-char-code-property ch 'diacritic-composition))) 721 pos (1+ pos)))
722 (setq components (cons ch (cons composition components)) 722 (compose-region start pos (nreverse components))
723 pos (1+ pos))) 723 pos)))))
724 (compose-region start pos (nreverse components))
725 pos))))
726 724
727(provide 'european) 725(provide 'european)
728 726