# HG changeset patch # User Kenichi Handa # Date 1074587237 0 # Node ID 3a4e30359ac0de6a290c57adab8593a7dcf415ff # Parent d91b7816539cb732fcac9821b3c684a4476098b9 (diacritic-composition-function): Fix for the case that POS is at the head. Allow combining with more characters. diff -r d91b7816539c -r 3a4e30359ac0 lisp/language/european.el --- a/lisp/language/european.el Sun Jan 18 23:45:31 2004 +0000 +++ b/lisp/language/european.el Tue Jan 20 08:27:17 2004 +0000 @@ -686,43 +686,41 @@ 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)