[ removed -review from Cc list ]
"Stephen J. Turnbull" <turnbull(a)sk.tsukuba.ac.jp> writes:
>>>>> "Gunnar" == Gunnar Evermann
<ge204(a)eng.cam.ac.uk> writes:
Gunnar> - a variable (say, inhibit_autoloads) is declared in
Gunnar> emacs.c directly in C with 'int inhibit_autoloads;' no
Gunnar> DEFVAR macros involved!
Huh? emacs.c, line 3393. The DEFVAR isn't an issue because of the
initialization; it's a problem because it imports the variable to pdump
land. This allows the pdumper to overwrite the user's command line
settings.
What I meant is that this macro is not called directly anymore when an
xemacs that will read a pdump file is started. I wrote this when I
still thought DEFVAR was actually initialising the C variable, but as
you point out it isn't.
Gunnar> note it doesn't get initialised to anything.
It's a global. I thought globals were guaranteed to be initialized to
zero---that's what `Internals | Rules When Writing New C Code | Adding
Global Lisp Variables' says. Is that incorrect?
Maybe it's stylistically bad, but technically it should work, right?
No, I'm sure it is correct. I just don't do that kind of thing in my
own programs and had thus forgotten. Sorry.
Gunnar> In particular all this breaks for values which get set
to
Gunnar> 1 by default in vars_of_emacs(), like
Gunnar> inhibit_site_[lisp|modules] (at least depending on
Gunnar> configure time constants).
This is incorrect implementation of configure constants if the
variable is settable from the command line, I believe. I should have
caught and fixed that. (Et tu, Olivier! ;-)
It's clear I did the wrong thing in conditionalizing the saves. For
variables that are settable by command line option, the saves/restores
should be unconditional, and the conditional initialization should be
moved to the declaration.
Wouldn't it be easier to move the command line parsing for the relvant
variable after the loading of the dump file? This would be more like
the initialisation in a traditional dumped xemacs.
Gunnar