GNU bug report logs -
#9712
defcustom's initial value expression is not byte-compiled
Previous Next
Full log
View this message in rfc822 format
> A consequence of the current behavior is that you really
> cannot use macro calls in VALUE, unless you are sure that
> the macro definition will be available also
> at load time (i.e., byte-compilation time is not enough). I
> ran into this using macro `kbd' in VALUE.
To clarify: using macro `icicle-kbd', which is similar to `kbd'. The problem
presumably would not occur for `kbd' itself because it is in `subr.el', which is
always loaded.
E.g., put this in file throw-1.el:
(defcustom foo (eval-when-compile (toto 4))
"jjjj" :type 'integer :group 'edit)
Put this in file throw-2.el, and evaluate it to define `toto':
(defmacro toto (n) `,n)
Byte-compile throw-1.el.
emacs -Q
M-x load-file throw-1.elc
Error: Symbol's function definition is void: toto.
Bummer. I would think that byte-compiling would expand and evaluate macros, so
that the file defining the macros would not be needed at load/runtime if the
byte-compiled file is available. I would expect that to be the case even
without the `eval-when-compile' (which is a specific directive to the
byte-compiler to eval and replace with the value).
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.