>>>> "sb" == SL Baur <steve(a)xemacs.org>
writes:
sb> Glynn Clements <glynn(a)sensei.co.uk> writes:
>> How about binding custom-set-* (e.g. with flet) during the
>> reading of user-init-file, to a function which displays a
>> warning? This could suggest that the user move these entries
>> to the new file.
>>
>> You can't tell which file it is being loaded from.
> Alternatively, you could flet load-file as well.
sb> I'm not sure how well that will work. The Work Of Satan (aka
sb> jka-compr.el) takes liberties in the area of redefining
sb> low-level load functions.
For the user init file, I don't see what to do; I can think of a
number of reasons why people might reload their init files, eg, having
edited them. Furthermore, who knows if they might `(load "options")
or whatever by hand. However, for the automatically generated files,
wouldn't the defined interface have them loaded in startup.el, so that
they would be loaded in the correct order?
Now, startup.el knows what it's loading. Why can't it bind a flag
which the custom-set-* functions check to see whether it's the right
place or not? Otherwise they would warn the user that the intended
effect may not occur due to shadowing by the automatically loaded
initialization code.
The custom user interface itself would also set the flag. As far as I
can see allowing the custom-set-* functions to be used anywhere else
potentially loses, justifying a warning. Users with sufficient hubris
could even defeat the warning if they wanted to.