emacs-devel
[Top][All Lists]
Advanced

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

Re: always put Customizations in `custom-file', never in `user-init-file


From: Stephen J. Turnbull
Subject: Re: always put Customizations in `custom-file', never in `user-init-file'
Date: Tue, 11 Dec 2007 06:19:22 +0900

Lennart Borgman (gmail) writes:

 > Drew Adams wrote:
 > > I think it was probably a mistake ever to have put Customize customizations
 > > into a file intended for editing. That can confuse users, and it's just
 > > asking for trouble. Now that we have a good alternative (`custom-file'), I
 > > think that should be used exclusively.
 > ...
 > > WDOT?

Be very careful.  In particular, the natural idea of migrating by
loading the init file and using Custom to save its internal state to a
custom-file caused no end of pain to users when it was implemented in
XEmacs.  If there is any error in the init file, you can lose all
customizations.

 > Great. And I guess custom-file should be run after .emacs, since that 
 > makes it possible to chose another custom-file.

Experience in XEmacs showed that users often want to use information
in the custom-file in their init files.  There were issues (maybe
XEmacs-specific) with initial values for faces, too.  After the init
file was run was too late.  It's easy enough to load the custom-file
late for those users for whom that matters: don't use the default
name.  Something like

(defvar custom-file "custom.el")
(defvar default-custom-file-loaded-p nil)
(progn
  (do-emacs-early-initializations)
  (when (file-readable-p custom-file)
    (load custom-file))
  (load user-init-file)
  (when (and (not default-custom-file-loaded-p)
             (file-readable-p custom-file))
    (load custom-file)))





reply via email to

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