From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Herbert Euler" Newsgroups: gmane.emacs.devel Subject: Re: Customization problem Date: Tue, 31 Oct 2006 20:35:46 +0800 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-Trace: sea.gmane.org 1162298187 16424 80.91.229.2 (31 Oct 2006 12:36:27 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 31 Oct 2006 12:36:27 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 31 13:36:23 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Gesqj-0000pY-02 for ged-emacs-devel@m.gmane.org; Tue, 31 Oct 2006 13:36:13 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gesqi-00047F-Bb for ged-emacs-devel@m.gmane.org; Tue, 31 Oct 2006 07:36:12 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GesqW-00046C-1Z for emacs-devel@gnu.org; Tue, 31 Oct 2006 07:36:00 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GesqR-0003zx-50 for emacs-devel@gnu.org; Tue, 31 Oct 2006 07:35:59 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GesqQ-0003zu-Ve for emacs-devel@gnu.org; Tue, 31 Oct 2006 07:35:55 -0500 Original-Received: from [65.54.246.88] (helo=bay0-omc1-s16.bay0.hotmail.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GesqL-0002Qy-7X; Tue, 31 Oct 2006 07:35:49 -0500 Original-Received: from hotmail.com ([64.4.26.40]) by bay0-omc1-s16.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 31 Oct 2006 04:35:48 -0800 Original-Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Tue, 31 Oct 2006 04:35:48 -0800 Original-Received: from 64.4.26.200 by by112fd.bay112.hotmail.msn.com with HTTP; Tue, 31 Oct 2006 12:35:46 GMT X-Originating-IP: [202.165.107.100] X-Originating-Email: [herberteuler@hotmail.com] X-Sender: herberteuler@hotmail.com In-Reply-To: Original-To: rms@gnu.org X-OriginalArrivalTime: 31 Oct 2006 12:35:48.0165 (UTC) FILETIME=[17B05750:01C6FCE9] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:61474 Archived-At: > For example, add a variable `custom-variables-loaded', which defaults > to nil, and add the expression > > (setq custom-variables-loaded t) > > as the last expression of the function `custom-set-variables'. Then, > `custom-save-variables' can test this variable to determine whether > to report an error. > >That will give the wrong result in the case where .emacs is successfully >loaded but there is no `custom-set-variables' in it. Currently, the user can save preferences and customizations into a file, either ~/.emacs or a specified file. More precisely, into the file whose name is returned by `(custom-file)'. The function `custom-file' works in this way: If the variable `custom-file' is not nil, it returns the name of the file `custom-file' points to. Otherwise, it returns the name of `user-init-file' (~/.emacs), if saving settings is permitted. If we decide to protect the customizations from being cleared accidentally, we must prevent the situation that a file which contains the application of `custom-set-variables' is to be loaded but the application of `custom-set-variables' in the file is not evaluated (because of errors, for example) happening. To achieve this, one of the following conditions must be satisfied: [1] The application of `custom-set-variables' is evaluated before any other forms in a file. [2] If a file contains the application of `custom-set-variables', the file is identified. If the application of `custom-set-variables' in the file is not loaded, let `custom-save-variables' signal errors. Otherwise, `custom-save-variables' just behaves as usual. [3] If a file contains the application of `custom-set-variables', any error in the evaluation of the forms before the application is ignored so that the application of `custom-set-variables' is guaranteed to be evaluated. [4] The mechanism of customizations saving is changed so that the application of `custom-set-variables' is guaranteed to be evaluated. For [1] and [2], searching every file for the application of `custom-set-variables' is a waste. [3] is not acceptable. For [4], the current feature of user defined customization file has to be disabled. We could load a file `user-customizations.el' in `loadup.el' or `startup.el', so the evaluation of the application of `custom-set-variables' is separated from the user defined forms and can be always evaluated successfully. Regards, Guanpeng Xu _________________________________________________________________ Don't just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/