unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: <emacs-devel@gnu.org>
Subject: `custom-file' and init-file [was: user-controlled load-path extension: load-dir]
Date: Wed, 9 Mar 2011 07:42:27 -0800	[thread overview]
Message-ID: <B26E07B3AC214D40B571060D6DA85778@us.oracle.com> (raw)
In-Reply-To: <4D775002.8050100@swipnet.se>

> >> 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?




  reply	other threads:[~2011-03-09 15:42 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                                             ` Drew Adams [this message]
2011-03-09 17:54                                               ` `custom-file' and init-file Stephen J. Turnbull
2011-03-09 21:19                                               ` `custom-file' and init-file [was: user-controlled load-path extension: load-dir] 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=B26E07B3AC214D40B571060D6DA85778@us.oracle.com \
    --to=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).