GNU bug report logs - #9712
defcustom's initial value expression is not byte-compiled

Previous Next

Package: emacs;

Reported by: "Drew Adams" <drew.adams <at> oracle.com>

Date: Sun, 9 Oct 2011 20:44:02 UTC

Severity: wishlist

Found in version 24.0.50

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: <bug-gnu-emacs <at> gnu.org>
Subject: 24.0.50; doc about byte-compiling `defcustom'
Date: Sun, 9 Oct 2011 13:42:47 -0700
Put this in a file foo.el, and byte-compile the file:
 
(defcustom titi (eval-when-compile `(,(kbd "S-<tab>")))
  "jjjjjjjjjjjj"
  :type '(repeat sexp) :group 'edit)
 
(defvar toto (eval-when-compile `(,(kbd "S-<tab>")))
 "kkkkkkkkkk")
 
This is what the byte-compiled file shows:
 
#@14 jjjjjjjjjjjj
(custom-declare-variable 'titi '(eval-when-compile
  `(,(kbd "S-<tab>"))) '(#$ . 509) :type '(repeat sexp) :group 'edit)
#@12 kkkkkkkkkk
(defvar toto '([S-tab]) (#$ . 647))
 
Here's the bug (a doc bug), as I see it: Where in the doc is this
behavior described?  Where does it say that the STANDARD arg to
defcustom is not evaluated by the byte compiler, even when you use
`eval-when-compile'?
 
(elisp) Variable Definitions says this, but it's about all I can find:
 
"Evaluating the `defcustom' form evaluates STANDARD, but does not
necessarily install the standard value."
 
And of course the doc for `eval-when-compile', (elisp) `Eval During
Compile', says "The result of evaluation by the compiler becomes a
constant which appears in the compiled program."
 
I see it documented nowhere that the STANDARD arg to defcustom appears
unevaluated in byte-compiled code.
 
 
 
In GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600)
 of 2011-09-19 on 3249CTO
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (4.5) --no-opt'
 





This bug report was last modified 13 years and 248 days ago.

Previous Next


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