From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Lennart Borgman" Newsgroups: gmane.emacs.devel Subject: Re: Documentation for custom-file - is not (load custom-file) needed? Date: Fri, 10 Dec 2004 16:51:06 +0100 Message-ID: <00d101c4ded0$37cad4e0$0200a8c0@sedrcw11488> References: <075b01c4d9a4$52799460$0200a8c0@sedrcw11488> <00bb01c4daee$5eb81350$0200a8c0@sedrcw11488> <200412051733.iB5HXIX13206@raven.dms.auburn.edu> <000001c4db1a$8d3770f0$0200a8c0@sedrcw11488> <200412060046.iB60kZj15003@raven.dms.auburn.edu> <003e01c4db31$e45a2550$0200a8c0@sedrcw11488> <200412060402.iB6421q15173@raven.dms.auburn.edu> <200412070539.iB75dV924747@raven.dms.auburn.edu> <200412090220.iB92KHR16407@raven.dms.auburn.edu> <874qiusno3.fsf@jurta.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1102694132 16532 80.91.229.6 (10 Dec 2004 15:55:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 10 Dec 2004 15:55:32 +0000 (UTC) Cc: teirllm@dms.auburn.edu, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 10 16:55:18 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Ccn6z-0007oM-00 for ; Fri, 10 Dec 2004 16:55:18 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CcnGw-0002Zp-EJ for ged-emacs-devel@m.gmane.org; Fri, 10 Dec 2004 11:05:34 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CcnGk-0002ZD-DN for emacs-devel@gnu.org; Fri, 10 Dec 2004 11:05:22 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CcnGj-0002Yz-HZ for emacs-devel@gnu.org; Fri, 10 Dec 2004 11:05:21 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CcnGj-0002YM-05 for emacs-devel@gnu.org; Fri, 10 Dec 2004 11:05:21 -0500 Original-Received: from [81.228.11.108] (helo=av1-2-sn1.fre.skanova.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Ccn4N-0006kT-CG for emacs-devel@gnu.org; Fri, 10 Dec 2004 10:52:35 -0500 Original-Received: by av1-2-sn1.fre.skanova.net (Postfix, from userid 502) id D425237EA1; Fri, 10 Dec 2004 16:52:33 +0100 (CET) Original-Received: from smtp3-2-sn1.fre.skanova.net (smtp3-2-sn1.fre.skanova.net [81.228.11.164]) by av1-2-sn1.fre.skanova.net (Postfix) with ESMTP id C40E437E5D; Fri, 10 Dec 2004 16:52:33 +0100 (CET) Original-Received: from sedrcw11488 (t4o58p211.telia.com [195.252.57.211]) by smtp3-2-sn1.fre.skanova.net (Postfix) with SMTP id 57BB437E43; Fri, 10 Dec 2004 16:52:29 +0100 (CET) Original-To: "Juri Linkov" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1409 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 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: main.gmane.org gmane.emacs.devel:30977 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:30977 ----- Original Message ----- From: "Juri Linkov" > Even though there is no full agreement, I want to make the following > points with more arguments for further discussion: Good, thanks for a constructive summary. > 1. The type of `custom-file' should be changed from defcustom to defvar > since its customization causes self-reference problems. But its > existence should be preserved for backward compatibility for users who > have only (setq custom-file "...") without (load "...") in .emacs and > expect that it is loaded by startup.el. However, after the changes > there will be no more need to set `custom-file' in .emacs. It will be > possible to define the location of the customization file by loading it > with (load "..."). `custom-file' is only loaded by startup.el in CVS Emacs so I think we can drop the variable entirely. > 2. `custom-set-variables' (a function call with saved customized > values in its argument which is stored in one of the user init files) > will record the names of the files where it was loaded from, when it > is called during loading. It will read the value of the variable > `load-file-name' during its loading. Agree, but: As I pointed out earlier I think that if an eval is beeing done then (buffer-file-name) should be used instead. This gives the same file name as load-file-name would have given during load. The reason is that I think this makes it easier to change "custom file". > 3. `Custom-save' will use a list of file names where `custom-set-variables' > was loaded from. When this list has multiple elements, it will ask > the user where to save `custom-set-variables'. Agreed. > 4. Users can move the `custom-set-variables' customization list to > another init file. In this case there is a need to tell Emacs about > its new location. The user has to call either (setq custom-file > (buffer-file-name)), or (push (buffer-file-name) custom-files), or > a special function on a new file buffer. In any case, the comments in > `custom-set-variables' should contain instructions for users what to > do when `custom-set-variables' is moved manually. Or maybe just allow > users to do `M-C-x' on `custom-set-variables'. But this might have > bad effects of overwriting the values of variables that were changed > outside of customize interface. Yes, this can be done in different ways. I would prefer to recommend the eval, since that seems easy to understand and remember. But of course we then have to tell that this would change the settings. > 5. All these changes should be made before the next release to be able > to fix a problem in startup.el. The problem is the following: > > When `custom-file' (which has an absolute file name) is not literally > equal to the name of the loaded customization file, e.g. in the > following configuration: > > (setq custom-file "~/emacs/lisp/custom-21.4.el") > (load "custom-21.4.el") > > then custom-21.4.el is loaded twice. startup.el fails to see that > it is already loaded, since it expects exactly the same absolute > file name in `load-history' which is not the case. Instead of that, > it should check the value of a new variable which is set to > `load-file-name' during loading of the file with `custom-file-loaded'. Another good reason to do it before release is to get rid of the defcustom for custom-file. I guess this kind of problems disappear when load-file-name or (buffer-file-name) is used? I am not sure whether we must drop all thoughts of "easy customization" of the "custom file" location completely now in this new scenario. It could be rather easy if we change some things. What I am thinking of is where to set "custom file" (by calling custom-set-variables as above). Should we do that in .emacs or should it be done in a separate file to make automatic editing more easy? It could be something like this: ** In startup.el check if custom-set-variables was called from .emacs. If not then look for .emacs-custom-location. If found load it. (This file is th en of course supposed to call custom-set-variables. If it does not I think an error should be raised.) The file .emacs-custom-location should then be more or less reserved for automatic editing. I can see no big trouble implementing such an approach, but I do see benefits. That is why I am taking it up now. - Lennart