From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Stephen J. Turnbull" Newsgroups: gmane.emacs.devel Subject: `custom-file' and init-file Date: Thu, 10 Mar 2011 02:54:02 +0900 Message-ID: <8739mwji2t.fsf@uwakimon.sk.tsukuba.ac.jp> 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 X-Trace: dough.gmane.org 1299693110 16503 80.91.229.12 (9 Mar 2011 17:51:50 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 9 Mar 2011 17:51:50 +0000 (UTC) Cc: emacs-devel@gnu.org To: "Drew Adams" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 09 18:51:45 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 1PxNXu-0002py-VE for ged-emacs-devel@m.gmane.org; Wed, 09 Mar 2011 18:51:42 +0100 Original-Received: from localhost ([127.0.0.1]:36810 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PxNXt-0005wJ-1Q for ged-emacs-devel@m.gmane.org; Wed, 09 Mar 2011 12:51:37 -0500 Original-Received: from [140.186.70.92] (port=39278 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PxNXc-0005qo-1j for emacs-devel@gnu.org; Wed, 09 Mar 2011 12:51:25 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PxNXa-0006zV-6G for emacs-devel@gnu.org; Wed, 09 Mar 2011 12:51:19 -0500 Original-Received: from mgmt2.sk.tsukuba.ac.jp ([130.158.97.224]:56577) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PxNXZ-0006yK-Kb for emacs-devel@gnu.org; Wed, 09 Mar 2011 12:51:18 -0500 Original-Received: from uwakimon.sk.tsukuba.ac.jp (uwakimon.sk.tsukuba.ac.jp [130.158.99.156]) by mgmt2.sk.tsukuba.ac.jp (Postfix) with ESMTP id 1D6DF9706A4; Thu, 10 Mar 2011 02:51:14 +0900 (JST) Original-Received: by uwakimon.sk.tsukuba.ac.jp (Postfix, from userid 1000) id 7B8DA1A2749; Thu, 10 Mar 2011 02:54:02 +0900 (JST) In-Reply-To: X-Mailer: VM 8.1.93a under 21.5 (beta29) "garbanzo" f5a5501814f5 XEmacs Lucid (x86_64-unknown-linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 130.158.97.224 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:136977 Archived-At: Drew Adams writes: > I would be in favor of having `custom-file' default to > ~/.emacs-custom.el or ~/.emacs.d/user-custom.el or something. FWIW, XEmacs uses the following scheme. (1) The startup code automatically loads custom-file, if non-nil and it exists, *after* loading the init file, if that exists. (custom-file will be loaded if init file doesn't exist.) (2) custom-file defaults to (the equivalent of) .emacs.d/custom.el. Note that the custom file does not need to be on the load-path since it has its own location variable, so the name conflict doesn't cause a problem. I've not heard of a real issue about the name in 15 years of use of this scheme. My own experience is that it's only an issue if I'm working on lisp/custom.el, in which case it's often prompted by some problem with ~/.xemacs/custom.el, and then the buffer name conflict is mildly annoying. > 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. Note that having a explicit load would require either a conditional or that custom-file exist. The XEmacs scheme makes this set of issues moot. The only real problem with the XEmacs scheme is that some people have init files that depend on the custom file. In that case the remedy is somewhat ugly but effective. Add (load custom-file) (add-hook 'after-init-hook `(lambda () (setq custom-file ,custom-file))) (setq custom-file nil) early enough.