APPROVE COMMIT latin-unity
This patch resolves a problem discussed in a thread starting at
http://list-archive.xemacs.org/xemacs-beta/200606/msg00162.html.
I imagine Aidan still has it applied, that's why he hasn't complained
that I haven't applied it yet. I would guess that means he hasn't run
into any problems, so it's probably OK (if charset abuse were a crime,
Aidan would no doubt be in for life ;-).
I think this is OK. FWIW, if this is going to cause any problems, I
would expect it to crop up with Cyrillic and Asian "wide" character
sets.
Index: mule-packages/latin-unity/ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/mule-packages/latin-unity/ChangeLog,v
retrieving revision 1.47
diff -u -U0 -r1.47 ChangeLog
--- mule-packages/latin-unity/ChangeLog 28 Jun 2006 07:58:32 -0000 1.47
+++ mule-packages/latin-unity/ChangeLog 13 Aug 2006 07:42:53 -0000
@@ -0,0 +1,8 @@
+2006-06-22 Stephen J. Turnbull <stephen(a)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(a)jerrypc.cs.usu.edu>.
+
Index: mule-packages/latin-unity/latin-unity-vars.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/mule-packages/latin-unity/latin-unity-vars.el,v
retrieving revision 1.6
diff -u -r1.6 latin-unity-vars.el
--- mule-packages/latin-unity/latin-unity-vars.el 15 Feb 2005 22:22:48 -0000 1.6
+++ mule-packages/latin-unity/latin-unity-vars.el 13 Aug 2006 07:42:59 -0000
@@ -150,14 +150,17 @@
"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.
Index: mule-packages/latin-unity/latin-unity.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/mule-packages/latin-unity/latin-unity.el,v
retrieving revision 1.14
diff -u -r1.14 latin-unity.el
--- mule-packages/latin-unity/latin-unity.el 2 May 2006 21:58:12 -0000 1.14
+++ mule-packages/latin-unity/latin-unity.el 13 Aug 2006 07:42:59 -0000
@@ -469,21 +469,23 @@
(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)))
--
School of Systems and Information Engineering
http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Ask not how you can "do" free software business;
ask what your business can "do for" free software.