sperber(a)informatik.uni-tuebingen.de (Michael Sperber [Mr. Preprocessor]) writes:
So, customize puts its variables into ~/.emacs according to a
heuristic I haven't groked yet fully. (Needless to say, this was a
bad idea ...)
IIRC, this was not so under original Per's design. Stallman insisted
on using ~/.emacs.
What's a politically correct (and preferably simple) to
determine
the set/region of forms in ~/.emacs under the control of customize?
Can I search for (custom-load-themes ...) or (custom-set-variables
...) and take the region from there to the end of the file? Or can
I take all forms starting with (custom-... ...). Or what?
I think you should do it the way Customize does it. This is virtually
guaranteed to be correct, because then if somebody uses a weird .emacs
format, Customize will not work with it either.
The way Custom does it is to read the top-level forms until the form
whose car is the required symbol is found. Look at
`custom-save-delete' for an example of that. Unless I'm missing
something, it's very easy to implement.