From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Engster Newsgroups: gmane.emacs.bugs 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 Message-ID: <87hb84pt51.fsf@engster.org> References: <87vcx1tciy.fsf@engster.org> <87hb855esi.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1307263405 31423 80.91.229.12 (5 Jun 2011 08:43:25 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 5 Jun 2011 08:43:25 +0000 (UTC) Cc: 8720@debbugs.gnu.org To: Chong Yidong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jun 05 10:43:21 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QT8vY-0002z6-0O for geb-bug-gnu-emacs@m.gmane.org; Sun, 05 Jun 2011 10:43:20 +0200 Original-Received: from localhost ([::1]:39383 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QT8vW-0007iQ-T2 for geb-bug-gnu-emacs@m.gmane.org; Sun, 05 Jun 2011 04:43:18 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:38564) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QT8vI-0007iG-CO for bug-gnu-emacs@gnu.org; Sun, 05 Jun 2011 04:43:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QT8vH-0008D3-Cq for bug-gnu-emacs@gnu.org; Sun, 05 Jun 2011 04:43:04 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59954) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QT8vH-0008Ct-6V for bug-gnu-emacs@gnu.org; Sun, 05 Jun 2011 04:43:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QT8vG-0006br-2w; Sun, 05 Jun 2011 04:43:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: David Engster Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 05 Jun 2011 08:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8720 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 8720-submit@debbugs.gnu.org id=B8720.130726335725375 (code B ref 8720); Sun, 05 Jun 2011 08:43:02 +0000 Original-Received: (at 8720) by debbugs.gnu.org; 5 Jun 2011 08:42:37 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QT8uq-0006bE-Lf for submit@debbugs.gnu.org; Sun, 05 Jun 2011 04:42:36 -0400 Original-Received: from v3-1008.vxen.de ([79.140.41.8]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QT8un-0006az-6g for 8720@debbugs.gnu.org; Sun, 05 Jun 2011 04:42:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=randomsample.de; s=a; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To:Subject:Cc:To:From; bh=Qck6UEDlpcoLhowV7VjILfxzccpf3wWPEH9UL9EL6Oo=; b=WlcnTZZVVPM7jOz+ImzRPNshKll+55xAyy5PnFTaNoMcLa/C1vs0XMSMCHD/buft79VL6Vjz/KzngqVIPxnyGSTjKAhKXftNoG33Kg8+YXPEmWEJsH8O+o8mvxMWPqah; Original-Received: from dslc-082-082-164-013.pools.arcor-ip.net ([82.82.164.13] helo=spaten) by v3-1008.vxen.de with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1QT8ug-0003U3-BJ; Sun, 05 Jun 2011 10:42:26 +0200 In-Reply-To: <87hb855esi.fsf@stupidchicken.com> (Chong Yidong's message of "Sat, 04 Jun 2011 19:59:25 -0400") User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sun, 05 Jun 2011 04:43:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:46969 Archived-At: Chong Yidong writes: > David Engster 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