Commits

Anonymous committed 6504b3d

Have fsf-compat-unicode.el behave better on 21.4.

Comments (0)

Files changed (2)

+2007-07-29  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* fsf-compat-unicode.el:
+	* fsf-compat-unicode.el (and):
+	* fsf-compat-unicode.el (fsf-compat-ccl-program):
+	* fsf-compat-unicode.el (fsf-compat-init-mule-unicode-charsets):
+	Shifting the arguments to mule-to-unicode 7 bits was appropriate,
+	but for redisplay r1 needs to be the highest octet, r2 the lowest,
+	of the 16-bit UCS code. 
+
+	text-conversion-error is not available on 21.4, so it turns out
+	the code fails in a more ugly way thatn I wanted there. 
+
 2007-07-27  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* fsf-compat-unicode.el:

fsf-compat-unicode.el

 
 ;;; Code:
 
-;;; Only for 21.5 and newer. 
+;;; Only for 21.5 and newer. Compiles with 21.4 fine. 
 
 (eval-when-compile (require 'ccl))
 
 ;; Check at runtime that the Unicode support is available, and that its
 ;; coverage is good enough.
-(unless (if-fboundp 'encode-char
-	    (with-fboundp '(encode-char decode-char)
-	      (eq #x31C (encode-char (decode-char 'ucs #x31C) 'ucs))))
-  (error 'text-conversion-error
+(unless (and (fboundp 'encode-char)
+             (eq #x31C (encode-char (decode-char 'ucs #x31C) 'ucs)))
+  (error 'unimplemented
 	 "Unicode support needed is not available in your XEmacs."))
 
 ;; For redisplay of these character sets, provide a CCL program to address
 ;; iso10646-1 X11 fonts.
 (defvar fsf-compat-ccl-program 
   (eval-when-compile
-    (let ((pre-existing [1 10 131127 7 98872 65823 147513 7 82009 127 22]))
+    (let ((pre-existing [1 10 131127 7 98872 65823 147513 8 82009 255 22]))
       (when (and (> emacs-major-version 20) (> emacs-minor-version 4)
                  (featurep 'mule))
         ;; In the event that we're compiling on 21.5, check that the
                           ((r1 = (r1 << 7)) 
                            (r1 = (r1 | r2)) 
                            (mule-to-unicode r0 r1) 
-                           (r1 = (r0 >> 7)) 
-                           (r2 = (r0 & #x7F))))))
+                           (r1 = (r0 >> 8)) 
+                           (r2 = (r0 & #xFF))))))
                 nil 
                 "The pre-compiled CCL program appears broken. "))
       pre-existing))
                       chars 96
                       columns 1
                       direction l2r
-                      final final
+                      final ,final
                       graphic 0
-                      short-name ,(format "Unicode subset %c" final)
+                      short-name ,(format "Unicode subset U+%04X" first-ucs)
                       long-name ,(format "Unicode subset (U+%04X..U+%04X)"
                                          first-ucs last-ucs)
                       ccl-program ,fsf-compat-ccl-program))