Subject: Re: bug#25770: delayed-init custom variables are not special

From: Glenn Morris <[email-masked]>
Date: Fri, 17 Feb 2017 22:22:05 -0500

Glenn Morris wrote:

> It seems that defcustoms that use custom-initialize-delay end up not
> being special.

Maybe something like this?

--- i/lisp/custom.el
+++ w/lisp/custom.el
@@ -764,9 +764,12 @@ custom-reevaluate-setting
 Use the :set function to do so.  This is useful for customizable options
 that are defined before their standard value can really be computed.
 E.g. dumped variables whose default depends on run-time information."
-  (funcall (or (get symbol 'custom-set) 'set-default)
-	   symbol
-	   (eval (car (or (get symbol 'saved-value) (get symbol 'standard-value))))))
+  (let ((val (car (or (get symbol 'saved-value)
+		      (get symbol 'standard-value)))))
+    (if (default-boundp symbol)
+	(funcall (or (get symbol 'custom-set) 'set-default) symbol (eval val))
+      (eval `(defvar ,symbol ,val)))))
+
 
 
 ;;; Custom Themes