changeset 89919:80fad817819f

(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.
author Kenichi Handa <handa@m17n.org>
date Tue, 20 Apr 2004 05:24:12 +0000
parents 2d36fc270f24
children d0458e42e592
files lisp/language/european.el
diffstat 1 files changed, 6 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- 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)