Commits

Anonymous committed f9fa4dc

Make latin-unity ignore non-latin charsets.
<87fyg1w04a.fsf@tleepslib.sk.tsukuba.ac.jp>

  • Participants
  • Parent commits e44bbd7

Comments (0)

Files changed (3)

+2006-06-22  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* latin-unity-vars.el (latin-unity-non-latin-bit-flag): New constant.
+
+	* latin-unity.el (latin-unity-representations-present-region): Use
+	it to kludge around bug reported in
+	<m364iwq4yq.fsf@jerrypc.cs.usu.edu>.
+
 2006-06-28  Norbert Koch  <viteno@xemacs.org>
 
 	* Makefile (VERSION): XEmacs package 1.18 released.

File latin-unity-vars.el

   "Bit vector representing the set of all Latin character sets.")
 
 ;; put the character set indicies and flag bits in reasonable places
-(let ((index 1) (bit 1))
-  (if (> (length latin-unity-character-sets) 25)
-      (error "representation too small to support so many charsets!"))
-  (mapcar (lambda (cs)
-	    (put cs 'latin-unity-flag-bit bit)
-	    (put cs 'latin-unity-index index)
-	    (setq bit (lsh bit 1)
-		  index (1+ index)))
-	  latin-unity-character-sets))
+(defconst latin-unity-non-latin-bit-flag
+  (let ((index 1) (bit 1))
+    (if (> (length latin-unity-character-sets) 25)
+	(error "representation too small to support so many charsets!"))
+    (mapcar (lambda (cs)
+	      (put cs 'latin-unity-flag-bit bit)
+	      (put cs 'latin-unity-index index)
+	      (setq bit (lsh bit 1)
+		    index (1+ index)))
+	    latin-unity-character-sets)
+    bit)
+  "A bit-flag indicating charsets not handled by latin-unity.")
 
 ;;; end of latin-unity-vars.

File latin-unity.el

 	(goto-char (point-min))
 	(while (not (eobp))
 	  (let* ((ch (char-after))
-		 (cs (car (split-char ch))))
+		 (cs (car (split-char ch)))
+		 (flag (get cs 'latin-unity-flag-bit 0)))
 	    (cond
 	     ((eq cs 'ascii)
 	      (setq skipchars (concat "\000-\177" skipchars))
-	      (setq asets (logior (get cs 'latin-unity-flag-bit 0) asets)))
+	      (setq asets (logior flag asets)))
 	     ((eq cs 'latin-jisx0201)
 	      ;; #### get this someday
 	      ;;(setq skipchars (concat skipchars latin-unity-latin-jisx0201))
 	      (setq skipchars (concat skipchars (list ch)))
-	      (setq asets (logior (get cs 'latin-unity-flag-bit 0) asets)))
+	      (setq asets (logior flag asets)))
 	     (t
 	      ;; #### actually we can do the whole charset here
 	      ;; precompute and set a property on the cs symbol
 	      (setq skipchars (concat skipchars (list ch)))
-	      (setq lsets (logior (get cs 'latin-unity-flag-bit 0) lsets)))))
+	      (when (= flag 0) (setq lsets (logior latin-unity-non-latin-bit-flag lsets)))
+	      (setq lsets (logior flag lsets)))))
 	  ;; The characters skipped here can't change asciisets
 	  (skip-chars-forward skipchars))))
     (cons lsets asets)))