bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#8720: 24.0.50; load-theme in .emacs makes it easy to inadvertently d


From: David Engster
Subject: bug#8720: 24.0.50; load-theme in .emacs makes it easy to inadvertently delete custom-set variables
Date: Sun, 05 Jun 2011 10:41:30 +0200
User-agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (gnu/linux)

Chong Yidong writes:
> David Engster <deng@randomsample.de> writes:
>
>> the existing customization for user-mail-address was deleted; in fact,
>> every existing entry there will be deleted.  I know this can be fixed
>> by putting the `load-theme' at the end of the .emacs file, but this
>> isn't mentioned in the doc-string and I'd still consider this at least
>> as unexpected behavior.
>
> This is certainly a problem, but I don't know a good fix.
>
> It's not limited to themes; another way to trigger it is to add a line
> (find-file "foo") in your init file, where "foo" contains an unsafe
> local variable; then tell Emacs to mark the variable as safe for future
> visits.  The customizations in your init file are similarly wiped out.

I assumed this was a general problem with customize, but I wasn't sure.

> One possibility is to do something like the following patch.  If Emacs
> needs to save a variable in a function that could be called during
> startup, it calls a new function customize-save-list-variable-safely
> instead of customize-save-variables.  That function records the stuff to
> be saved into a list, which is acted on after initialization.

Well, I figure almost any function can possibly be called during
startup. :-) But leaving that aside, I'm afraid even with your patch the
actual feature will still not work, meaning you'll be asked if you want
to "treat this theme as safe" every time you start Emacs, because the
customize section simply hasn't been read yet.

I guess to reliably use customize during startup, it would have to
automatically read the custom sections as soon as it is loaded.  Is that
somehow possible?

-David





reply via email to

[Prev in Thread] Current Thread [Next in Thread]