From: Kenichi Handa Date: Tue, 20 Jan 2004 08:27:17 +0000 (+0000) Subject: (diacritic-composition-function): Fix for the case that POS is at the X-Git-Tag: emacs-pretest-23.0.90~8295^2~1628 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5ef807becbfa3d2f9da0b6a88ecf113e2d4bedb2;p=emacs.git (diacritic-composition-function): Fix for the case that POS is at the head. Allow combining with more characters. --- 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, or nil if no characters are composed." (setq pos (1- pos)) (if string - (let ((ch (aref string pos)) - start end components ch composition) - (when (and (>= pos 0) - ;; Previous character is latin. - (aref (char-category-set ch) ?l) - (/= ch 32)) - (setq start pos - end (length string) - components (list ch) - pos (1+ pos)) - (while (and - (< pos end) - (setq ch (aref string pos) - composition - (get-char-code-property ch 'diacritic-composition))) - (setq components (cons ch (cons composition components)) - pos (1+ pos))) - (compose-string string start pos (nreverse components)) - pos)) - (let ((ch (char-after pos)) - start end components composition) - (when (and (>= pos (point-min)) - (aref (char-category-set ch) ?l) - (/= ch 32)) - (setq start pos - end (point-max) - components (list ch) - pos (1+ pos)) - (while (and - (< pos end) - (setq ch (char-after pos) - composition - (get-char-code-property ch 'diacritic-composition))) - (setq components (cons ch (cons composition components)) - pos (1+ pos))) - (compose-region start pos (nreverse components)) - pos)))) + (if (>= pos 0) + (let ((ch (aref string pos)) + start end components ch composition) + (when (and (>= ch 32) (or (< ch 127) (>= ch 160))) + (setq start pos + end (length string) + components (list ch) + pos (1+ pos)) + (while (and + (< pos end) + (setq ch (aref string pos) + composition + (get-char-code-property ch + 'diacritic-composition))) + (setq components (cons ch (cons composition components)) + pos (1+ pos))) + (compose-string string start pos (nreverse components)) + pos))) + (if (>= pos (point-min)) + (let ((ch (char-after pos)) + start end components composition) + (when (and (>= ch 32) (or (< ch 127) (>= ch 160))) + (setq start pos + end (point-max) + components (list ch) + pos (1+ pos)) + (while (and + (< pos end) + (setq ch (char-after pos) + composition + (get-char-code-property ch 'diacritic-composition))) + (setq components (cons ch (cons composition components)) + pos (1+ pos))) + (compose-region start pos (nreverse components)) + pos))))) (provide 'european)