unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: David Engster <deng@randomsample.de>
To: Chong Yidong <cyd@stupidchicken.com>
Cc: 8720@debbugs.gnu.org
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	[thread overview]
Message-ID: <87hb84pt51.fsf@engster.org> (raw)
In-Reply-To: <87hb855esi.fsf@stupidchicken.com> (Chong Yidong's message of "Sat, 04 Jun 2011 19:59:25 -0400")

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	other threads:[~2011-06-05  8:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-23 19:58 bug#8720: 24.0.50; load-theme in .emacs makes it easy to inadvertently delete custom-set variables David Engster
2011-06-04 23:59 ` Chong Yidong
2011-06-05  8:41   ` David Engster [this message]
2011-06-28  4:34     ` Chong Yidong
2011-06-06 17:13   ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87hb84pt51.fsf@engster.org \
    --to=deng@randomsample.de \
    --cc=8720@debbugs.gnu.org \
    --cc=cyd@stupidchicken.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).