From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: `custom-file' and init-file [was: user-controlled load-path extension: load-dir] Date: Wed, 9 Mar 2011 07:42:27 -0800 Message-ID: References: <87ei6mz24h.fsf@lifelogs.com> <20110306072147.GA11067@event-horizon.homenet> <871v2i525h.fsf@lifelogs.com> <87oc5lx607.fsf@lifelogs.com> <874o7ds37p.fsf@lifelogs.com> <4D7726E8.5090206@swipnet.se><4D772988.4070209@gmail.com> <4D775002.8050100@swipnet.se> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1299685505 1294 80.91.229.12 (9 Mar 2011 15:45:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 9 Mar 2011 15:45:05 +0000 (UTC) To: Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 09 16:45:01 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PxLZC-0006h3-Ju for ged-emacs-devel@m.gmane.org; Wed, 09 Mar 2011 16:45:01 +0100 Original-Received: from localhost ([127.0.0.1]:39759 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PxLZ8-0007jE-7g for ged-emacs-devel@m.gmane.org; Wed, 09 Mar 2011 10:44:46 -0500 Original-Received: from [140.186.70.92] (port=56362 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PxLYI-0007SJ-NW for emacs-devel@gnu.org; Wed, 09 Mar 2011 10:43:59 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PxLYF-0007Eq-LB for emacs-devel@gnu.org; Wed, 09 Mar 2011 10:43:52 -0500 Original-Received: from rcsinet10.oracle.com ([148.87.113.121]:22264) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PxLYF-0007EZ-CH for emacs-devel@gnu.org; Wed, 09 Mar 2011 10:43:51 -0500 Original-Received: from rcsinet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id p29Fhms7003458 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 9 Mar 2011 15:43:49 GMT Original-Received: from acsmt355.oracle.com (acsmt355.oracle.com [141.146.40.155]) by rcsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id p29Fhk8E028120 for ; Wed, 9 Mar 2011 15:43:46 GMT Original-Received: from abhmt006.oracle.com by acsmt353.oracle.com with ESMTP id 1122647091299685348; Wed, 09 Mar 2011 07:42:28 -0800 Original-Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 09 Mar 2011 07:42:27 -0800 X-Mailer: Microsoft Office Outlook 11 In-reply-to: <4D775002.8050100@swipnet.se> Thread-Index: AcveQRgs/gZ0CXpeToawKTcigfrfVgAJbNCQ X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994 X-Source-IP: acsmt355.oracle.com [141.146.40.155] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090203.4D77A034.0061,ss=1,fgs=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 148.87.113.121 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:136968 Archived-At: > >> Another thing I really would like is for customize to > >> save its stuff in its own file and not in my .emacs. With > >> a load-dir this would be trivial. > > > > How about this: > > (setq custom-file "~/.emacs.d/init-custom.el") > > (load custom-file) > > It is having this in emacs core, working without extra > user work that is the point. My impression is that many Emacs (most?) users are unaware of `custom-file'. That's too bad, IMO. I think Emacs should use a separate custom file _by default_ (empty initially), and thus, by default, keep separate (a) the direct user editing and (b) the automatic modifications done by Customize. I would be in favor of having `custom-file' default to ~/.emacs-custom.el or ~/.emacs.d/user-custom.el or something. By itself, that wouldn't clue users in. A separate question would be whether to also have an (almost) empty `.emacs' by default, containing just an explicit load of `custom-file'. I'd say yes. Even if we did not provide a (nearly empty) init file and an (empty) `custom-file' by default, documenting the use of `custom-file' at the same place where we document `.emacs' (node `Init File') would be helpful, IMO. Even just adding a cross reference there plus a brief mention of `custom-file' would be helpful. Today, the `custom-file' doc is buried in the Customization section, with no mention in the init-file section. If users did have a default init file and `custom-file' (the former loading the latter, the latter being empty), then they would more easily keep separate their own Lisp customizations from any customizations made by Customize. Mixing the two is error prone (hence the warning comment we insert today). Users would be free to add their own Lisp customizations before or after the load of `custom-file'. They would also be free to define `custom-file' conditionally in the init file. And they could remove the load of `custom-file' altogether or move it to some other file that gets loaded (i.e. move the load away from the top level). IOW, they could do everything they do today. The only changes would be that by _default_: 1. Users would have an init file (~/.emacs). 2. The init file would just load `custom-file' (explicitly). Otherwise it would be empty. 3. `custom-file' would default to ~/.emacs-custom.el or ~/.emacs.d/user-custom.el or similar (TBD). Except for #3, I've suggested something similar before (thread "always put Customizations in `custom-file', never in `user-init-file', http://lists.gnu.org/archive/html/emacs-devel/2007-12/msg00567.html). At that time, some were in favor, a few were opposed. Richard turned it down in favor of fixing bugs for Emacs 22. XEmacs apparently already has something like this (see the thread). A variant of what's proposed above would be to not have a default init file with an explicit load of `custom-file', but to just load `custom-file' automatically after the init file if it is not loaded before then. This was discussed in the thread as well. That too would be OK by me. (See the thread for details.) The discussion in that thread also dealt with the possibility of automigrating existing Customize customizations from .emacs to `custom-file'. Leaving out migration altogether - or at least making it optional (on-demand) - would perhaps lead us to an easier consensus about using `custom-file' by default. Perhaps this topic is worth revisiting?