emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: `custom-file' and init-file [was: user-controlled load-path extensio


From: Stephen J. Turnbull
Subject: Re: `custom-file' and init-file [was: user-controlled load-path extension: load-dir]
Date: Thu, 10 Mar 2011 11:52:28 +0900

Evans Winner writes:

 > Out of curiosity, would this complicate the process of Emacs
 > installation?

That depends on whether the recommendation to use a separate
custom-file is strong enough to put in an automatic "migration"
process.  XEmacs did that; many users went to the trouble of
acknowledging its convenience, but other users suffered data loss
while converting .emacs to XEmacs conventions.  That said, such data
loss is rather unlikely for Emacs users (the problem occurs if the
init file signals while loading; this is unlikely in Emacs -- few
users mess with installing a new Emacs while their .emacs is
non-working! -- but is somewhat likely if you load an .emacs designed
for Emacs into XEmacs).

 > Is the idea that the first time a user runs
 > Emacs, it checks to see if there is a .emacs in (getenv
 > "HOME"), and if not, creates it?

In Drew's scheme, that would probably be the way to go.  (This is very
safe compared to "migrating" an existing .emacs.)  In the XEmacs
scheme (which normally loads custom-file after the init file), it's
unnecessary.

 > Would that complicate things for system administrators?

Slightly.  Probably not a big deal though.  The .emacs file is
explicitly for users to customize, so system administrators should not
count on it being present or on it containing particular code.  That's
what the site init and default files are for.

 > The result, and I can't be alone in this, is that I make the
 > call to load the custom file at the beginning of my .emacs,
 > so that if I happen to have defined something twice by
 > mistake (or because I am too lazy to fix it) the result will
 > be whatever I have defined in my .emacs.

This requires a bit of extra one-time effort in the XEmacs scheme
(which implicitly loads custom-file after the init file).  We consider
it worth it because of the convenience and transparency of the process
for almost all users.

Since the snippet used is entirely generic, it could be wrapped up in
a function `load-custom-file-now' or similar.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]