# HG changeset patch # User Kenichi Handa # Date 1082438652 0 # Node ID 80fad817819fbba83955e97caf85246628f5609f # Parent 2d36fc270f24d8440aecf528b92647545b65e22e (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. diff -r 2d36fc270f24 -r 80fad817819f lisp/language/european.el --- a/lisp/language/european.el Tue Apr 20 02:47:14 2004 +0000 +++ b/lisp/language/european.el Tue Apr 20 05:24:12 2004 +0000 @@ -657,13 +657,15 @@ (narrow-to-region beg end) (goto-char (point-min)) (while (re-search-forward diacritic-composition-pattern nil t) - (compose-region (match-beginning 0) (match-end 0))))) + (if (= (char-syntax (char-after (match-beginning 0))) ?w) + (compose-region (match-beginning 0) (match-end 0)))))) (defun diacritic-compose-string (string) "Compose diacritic characters in STRING and return the resulting string." (let ((idx 0)) (while (setq idx (string-match diacritic-composition-pattern string idx)) - (compose-string string idx (match-end 0)) + (if (= (char-syntax (aref string idx)) ?w) + (compose-string string idx (match-end 0))) (setq idx (match-end 0)))) string) @@ -672,10 +674,6 @@ (interactive) (diacritic-compose-region (point-min) (point-max))) -(defun diacritic-post-read-conversion (len) - (diacritic-compose-region (point) (+ (point) len)) - len) - (defun diacritic-composition-function (pos &optional string) "Compose diacritic text around POS. Optional 2nd argument STRING, if non-nil, is a string containing text @@ -688,7 +686,7 @@ (if (>= pos 0) (let ((ch (aref string pos)) start end components ch composition) - (when (and (>= ch 32) (or (< ch 127) (>= ch 160))) + (when (= (char-syntax ch) ?w) (setq start pos end (length string) components (list ch) @@ -706,7 +704,7 @@ (if (>= pos (point-min)) (let ((ch (char-after pos)) start end components composition) - (when (and (>= ch 32) (or (< ch 127) (>= ch 160))) + (when (= (char-syntax ch) ?w) (setq start pos end (point-max) components (list ch)