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: Wed, 8 Dec 2004 18:52:23 +0100 Message-ID: <002001c4dd4e$b4578a40$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> <03be01c4dcbf$139bfa30$0200a8c0@sedrcw11488> <87is7dienm.fsf@jurta.org> <87u0qwc43f.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 1102528462 4943 80.91.229.6 (8 Dec 2004 17:54:22 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 8 Dec 2004 17:54:22 +0000 (UTC) Cc: Luc Teirlinck , Emacs Devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 08 18:53:58 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 1Cc60j-00008x-00 for ; Wed, 08 Dec 2004 18:53:57 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Cc6Aa-00043C-QO for ged-emacs-devel@m.gmane.org; Wed, 08 Dec 2004 13:04:08 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1Cc6A2-0003mx-HD for emacs-devel@gnu.org; Wed, 08 Dec 2004 13:03:34 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1Cc6A0-0003lS-2k for emacs-devel@gnu.org; Wed, 08 Dec 2004 13:03:33 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Cc69z-0003kx-Ix for emacs-devel@gnu.org; Wed, 08 Dec 2004 13:03:31 -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 1Cc5zc-0006gc-Dv for emacs-devel@gnu.org; Wed, 08 Dec 2004 12:52:49 -0500 Original-Received: by av1-2-sn1.fre.skanova.net (Postfix, from userid 502) id 7199B37EAD; Wed, 8 Dec 2004 18:52:47 +0100 (CET) Original-Received: from smtp3-1-sn1.fre.skanova.net (smtp3-1-sn1.fre.skanova.net [81.228.11.163]) by av1-2-sn1.fre.skanova.net (Postfix) with ESMTP id 63E5F37E47; Wed, 8 Dec 2004 18:52:47 +0100 (CET) Original-Received: from sedrcw11488 (t5o58p154.telia.com [195.67.196.154]) by smtp3-1-sn1.fre.skanova.net (Postfix) with SMTP id F273837E46; Wed, 8 Dec 2004 18:52:45 +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:30871 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:30871 ----- Original Message ----- From: "Juri Linkov" > I wrote: > > It's too late to make any changes in custom-file (changing its type, > > etc.) since users might already rely on its current state. > > But maybe it is safe to change the type of custom-file from defcustom > to defvar. I am only concerned about backward compatibility. > What happens if some users already have customized `custom-file' in > `custom-set-variables' and it will be removed from this list? > Perhaps, nothing bad. Moreover, the situation where `custom-file' > in `custom-set-variables' points to some file other than the file > where `custom-set-variables' is located, is invalid. It will cause > duplication of `custom-set-variables' list when Emacs saves customized > variables next time. So, not adding `custom-file' to the set of > variables in `custom-set-variables' is the right thing. `custom-file' > should be purely an internal variable (which is achieved with the > previous patch). Hi Juri, Reading your previous message where you pointed out that a variable custom-file-loaded could be set by custom-set-variables (a nice idea that makes things much cleaner) I got maybe a further idea that could make backward compatibility easier. It is not totally safe, but maybe sufficiently safe: The idea is simply to remove custom-file and add a new defvar custom-file-in-use that is used instead. This way we do not have to care about if custom-set-variable finds a custom-file setting. It is simply not used. (Or, rather I cannot find any reasonable situation where the user uses custom-file if it is not defined by a setq before. Can you?) Maybe this is just what you intended? I was not sure. I prefer the name custom-file-in-use instead of custom-file-loaded. > However, there is one situation when users have to deal with the > `custom-file' variable. When the user moves `custom-set-variables' > to a new location in another file, it's needed to tell Emacs about > this location, so the next invocation of `Custom-save' could write > customization to the new place. To inform users about that, the next > 3 lines could be added to the comments of `custom-set-variables': > > (custom-set-variables > ;; custom-set-variables was added by Custom. > ;; If you edit it by hand, you could mess it up, so be careful. > ;; Your init file should contain only one such instance. > ;; If there is more than one, they won't work right. > + ;; When you move it to another init file, to tell Emacs about > + ;; its new location for the current Emacs session, type C-x C-e > + ;; at the end of this line: (setq custom-file buffer-file-name) > + ;; For further Emacs sessions just put in your init file > + ;; (load "custom-file.el"). There is no need to set `custom-file' > + ;; explicitly in your init files since Emacs can automatically set > + ;; it to the file name where your customizations were loaded from. I like the ideas though I would change the text used a bit. Doing it this way we still leave possibilites for someone who later wants to make a "customization page" (along what I started with perhaps) for custom-file-in-use. However custom-file-in-use should never be made a defcustom variable. I just mean a page that looks similar. Such a feature could be tested after release of the new Emacs. - Lennart