[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problems with defcustom setter functions during byte-compile
From: |
David Engster |
Subject: |
Re: Problems with defcustom setter functions during byte-compile |
Date: |
Sat, 06 Oct 2012 22:25:20 +0200 |
User-agent: |
Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.1.50 (gnu/linux) |
Stefan Monnier writes:
>> (defcustom srecode-map-load-path
>> [... stuff snipped ...]
>> :set 'srecode-map-load-path-set)
>> The :set function `srecode-map-load-path-set' is called as soon as this
>> file is loaded.
>
> Actually, when the defcustom is executed, the it's the initializer
> that's called, and it just so happens that the default initializer in
> turn calls the setter.
> So you should be able to work around this problem by adding ":initialize
> #'custom-initialize-default".
Nifty. I didn't know that feature. And while it works as advertised, the
SRecode unit tests now fail. I guess that `srecode-map-load-path-set'
(which calls `srecode-map-update-map') really must be called when
srecode/map is loaded, it just shouldn't happen during byte-compilation...
Anyway, I guess that's more a fault on our side. At least for know I
"solved" this issue by simply setting `srecode-map-load-path' to nil
during byte-compilation.
-David