diff lisp/bytecomp.el @ 4304:4ac3a83867c6

[xemacs-hg @ 2007-12-04 20:35:30 by aidan] Make compiled #'custom-declare-variable forms compatible with 21.4.
author aidan
date Tue, 04 Dec 2007 20:35:31 +0000
parents 27150c937a22
children e8f448f997ac
line wrap: on
line diff
--- a/lisp/bytecomp.el	Tue Dec 04 20:18:43 2007 +0000
+++ b/lisp/bytecomp.el	Tue Dec 04 20:35:31 2007 +0000
@@ -2405,10 +2405,17 @@
        ;; And save a value to be examined in the custom UI, if that differs
        ;; from the init value.
        (unless (equal to-examine (car-safe (cdr (third form))))
-         (setf (nthcdr 4 form) (nconc
-                                (list :default 
-                                      (list 'quote to-examine))
-                                (nthcdr 4 form)))))
+         (setcdr (third form)
+                 (list (byte-compile-top-level 
+                        ;; This is ugly. custom-declare-variable errors if
+                        ;; it's passed a keyword it doesn't know about, and
+                        ;; so to make this code run on 21.4, we add code to
+                        ;; modify the standard-value property to the
+                        ;; byte-compiled value for DEFAULT.
+                        `(prog2 (put ,(second form) 'standard-value
+                                     '(,to-examine))
+                          ,to-examine)
+                        nil 'file)))))
     form))
 
 ;;;###autoload