unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Stephen J. Turnbull" <stephen@xemacs.org>
To: "Drew Adams" <drew.adams@oracle.com>
Cc: emacs-devel@gnu.org
Subject: `custom-file' and init-file
Date: Thu, 10 Mar 2011 02:54:02 +0900	[thread overview]
Message-ID: <8739mwji2t.fsf@uwakimon.sk.tsukuba.ac.jp> (raw)
In-Reply-To: <B26E07B3AC214D40B571060D6DA85778@us.oracle.com>

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.



  reply	other threads:[~2011-03-09 17:54 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-01 20:32 user-controlled load-path extension: load-dir Ted Zlatanov
2011-03-03 21:07 ` Dimitri Fontaine
2011-03-04  9:55   ` Julien Danjou
2011-03-04 17:18     ` Tom Tromey
2011-03-04 18:04       ` Ted Zlatanov
2011-03-04 18:37       ` Dimitri Fontaine
2011-03-04 19:35         ` Tom Tromey
2011-03-04 19:45           ` Dimitri Fontaine
2011-03-04 19:54             ` Ted Zlatanov
2011-03-04 20:21               ` Dimitri Fontaine
2011-03-04 20:25               ` Chad Brown
2011-03-04 20:46                 ` Ted Zlatanov
2011-03-05 19:24                   ` Chad Brown
2011-03-04 20:26               ` Chad Brown
2011-03-04 20:08             ` Tom Tromey
2011-03-04 20:24               ` Dimitri Fontaine
2011-03-04 21:17                 ` Tom Tromey
2011-03-04 21:33                   ` Dimitri Fontaine
2011-03-04 21:37                     ` Tom Tromey
2011-03-05  3:18                     ` Ted Zlatanov
2011-03-05 19:11                       ` Chad Brown
2011-03-06  7:21                       ` Mike Mattie
2011-03-07 16:24                         ` Ted Zlatanov
2011-03-07 17:18                           ` Chad Brown
2011-03-07 17:59                             ` Ted Zlatanov
2011-03-08 17:36                             ` Dimitri Fontaine
2011-03-08 18:30                               ` Chad Brown
2011-03-07 17:52                           ` Stefan Monnier
2011-03-07 20:39                             ` PJ Weisberg
2011-03-08  2:46                               ` Stefan Monnier
2011-03-08 10:26                                 ` Ted Zlatanov
2011-03-08 17:14                                   ` Chong Yidong
2011-03-08 18:47                                     ` Ted Zlatanov
2011-03-08 19:23                                       ` Julien Danjou
2011-03-09  2:54                                         ` Stefan Monnier
2011-03-09 19:57                                           ` Chong Yidong
2011-03-08 20:59                                   ` Stefan Monnier
2011-03-08 21:38                                     ` Ted Zlatanov
2011-03-09  7:06                                       ` Jan D.
2011-03-09  7:17                                         ` Christoph Scholtes
2011-03-09 10:01                                           ` Jan Djärv
2011-03-09 15:42                                             ` `custom-file' and init-file [was: user-controlled load-path extension: load-dir] Drew Adams
2011-03-09 17:54                                               ` Stephen J. Turnbull [this message]
2011-03-09 21:19                                               ` Evans Winner
2011-03-09 21:39                                                 ` `custom-file' and init-file [was: user-controlled load-pathextension: load-dir] Drew Adams
2011-03-10  2:52                                                 ` `custom-file' and init-file [was: user-controlled load-path extension: load-dir] Stephen J. Turnbull
2011-03-09 17:29                                             ` user-controlled load-path extension: load-dir Stephen J. Turnbull
2011-03-09 18:18                                               ` Ted Zlatanov
2011-03-09 19:33                                                 ` Stephen J. Turnbull
2011-03-09 19:57                                                   ` Ted Zlatanov
2011-03-10  3:20                                                     ` Stephen J. Turnbull
2011-03-10  5:01                                                       ` Ted Zlatanov
2011-03-10  7:08                                                         ` Stephen J. Turnbull
2011-03-10 13:15                                                           ` Ted Zlatanov
2011-03-11  2:10                                                             ` Stephen J. Turnbull
2011-03-09 21:57                                         ` Mike Mattie
2011-03-10  7:08                                           ` Jan Djärv
2011-03-09  6:03                                   ` Mike Mattie
2011-03-09  7:20                                     ` Jan D.
2011-03-09 23:44                                       ` Mike Mattie
2011-03-08  0:47                           ` Mike Mattie
2011-03-08 10:37                             ` Ted Zlatanov
2011-03-09  6:26                               ` Mike Mattie
2011-03-09 11:26                                 ` Ted Zlatanov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8739mwji2t.fsf@uwakimon.sk.tsukuba.ac.jp \
    --to=stephen@xemacs.org \
    --cc=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).