SUPERSEDES 17774.42330.211610.704794(a)parhasard.net
NOTE: This patch has been committed.
mule-packages/mule-base/ChangeLog addition:
2006-12-01 Aidan Kehoe <kehoea(a)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.
XEmacs Packages source patch:
Diff command: cvs -q diff -Nu
Files affected: mule-packages/mule-base/fsf-compat-unicode.el
===================================================================
RCS
Index: mule-packages/mule-base/fsf-compat-unicode.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/mule-packages/mule-base/fsf-compat-unicode.el,v
retrieving revision 1.1
diff -u -u -r1.1 fsf-compat-unicode.el
--- mule-packages/mule-base/fsf-compat-unicode.el 2006/11/29 22:28:17 1.1
+++ mule-packages/mule-base/fsf-compat-unicode.el 2006/12/01 21:19:49
@@ -34,15 +34,45 @@
(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.
@@ -98,4 +128,4 @@
; 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
\ No newline at end of file
+;;; end fsf-compat-unicode.el
--
Santa Maradona, priez pour moi!
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches