Commits

Anonymous committed 845e35f

Fix the package smoketest; define-ccl-program is a macro, and needs to be
expanded if we're compling on 21.4.

Comments (0)

Files changed (2)

+2006-12-01  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* fsf-compat-unicode.el:
+	* fsf-compat-unicode.el (fsf-compat-ccl-encode-to-ucs-2): Removed.
+	* fsf-compat-unicode.el (eval-when-compile):
+	Pre-expand the macro if we're compiling on 21.4; fixes a packages
+	smoketest failure. 
+
 2006-11-29  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* Makefile (ELCS):

fsf-compat-unicode.el

                      (encode-char (decode-char 'ucs #x31C) 'ucs))))
   (error "Unicode support needed for this file not available!"))
 
-(define-ccl-program fsf-compat-ccl-encode-to-ucs-2
-  `(1
-    ((r1 = (r1 << 8))
-     (r1 = (r1 | r2))
-     (mule-to-unicode r0 r1)
-     (r1 = (r0 >> 8))
-     (r2 = (r0 & 255))))
-  "CCL program to transform Mule characters to UCS-2.")
+
+(if (eval-when-compile
+      (and (> emacs-major-version 20)  
+	   (> emacs-minor-version 4)
+	   (featurep 'mule)))
+
+    ;; If we're being compiled by 21.5, use the actual define-ccl-program
+    ;; macro, but evaluated at runtime. 
+    ;;
+    ;; Having this as 
+    ;;
+    ;;   (eval-when-compile (and (featurep 'mule) (macroexpand
+    ;;   '(define-ccl-program ...))
+    ;;
+    ;; in order to have the macro evaluated at compile time, results
+    ;; in the statement being empty in the compiled file, which as I
+    ;; understand it is a bug.
+
+    (eval
+     '(define-ccl-program fsf-compat-ccl-encode-to-ucs-2 
+       `(1 
+	 ((r1 = (r1 << 8)) 
+	  (r1 = (r1 | r2)) 
+	  (mule-to-unicode r0 r1) 
+	  (r1 = (r0 >> 8)) 
+	  (r2 = (r0 & 255)))) 
+       "CCL program to transform Mule characters to UCS-2."))
+
+  ;; Pre-expand the macro for 21.4. 21.4 will error on loading this file, but 
+  ;; it may compile it. define-ccl-program should not be a macro, but that's 
+  ;; by the way. 
+  (let ((prog [1 10 131127 8 98872 65823 147513 8 82009 255 22])) 
+    (defconst fsf-compat-ccl-encode-to-ucs-2 prog 
+      "CCL program to transform Mule characters to UCS-2.") 
+    (put (quote fsf-compat-ccl-encode-to-ucs-2) 
+	 (quote ccl-program-idx) 
+	 (register-ccl-program (quote fsf-compat-ccl-encode-to-ucs-2) prog))  
+    nil))
 
 (defun fsf-compat-init-mule-unicode-charsets ()
   "Make some Mule character sets that the FSF uses available in XEmacs.
 ; 		 charset-symbol ku ten 
 ; 		 (encode-char (make-char charset-symbol ku ten) 'ucs))))))
 ;   (insert "  ) nil \"We're incompatible with the FSF!\")"))
-;;; end fsf-compat-unicode.el
+;;; end fsf-compat-unicode.el