GNU bug report logs - #25770
delayed-init custom variables are not special

Previous Next

Package: emacs;

Reported by: Glenn Morris <rgm <at> gnu.org>

Date: Fri, 17 Feb 2017 06:16:02 UTC

Severity: normal

Found in version 25.1

Fixed in version 26.1

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Glenn Morris <rgm <at> gnu.org>
To: 25770 <at> debbugs.gnu.org
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: bug#25770: delayed-init custom variables are not special
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




This bug report was last modified 8 years and 91 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.