emacs-devel
[Top][All Lists]
Advanced

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

Re: Documentation for custom-file - is not (load custom-file) needed?


From: Juri Linkov
Subject: Re: Documentation for custom-file - is not (load custom-file) needed?
Date: Fri, 10 Dec 2004 07:54:52 +0200
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux)

Richard Stallman <address@hidden> writes:
> If the rest of you arrive at some sort of partial agreement, I'd like
> one of you who can explain the most clearly to explain them to me, and
> then I will think about what to do.

Even though there is no full agreement, I want to make the following
points with more arguments for further discussion:

1. The type of `custom-file' should be changed from defcustom to defvar
since its customization causes self-reference problems.  But its
existence should be preserved for backward compatibility for users who
have only (setq custom-file "...") without (load "...") in .emacs and
expect that it is loaded by startup.el.  However, after the changes
there will be no more need to set `custom-file' in .emacs.  It will be
possible to define the location of the customization file by loading it
with (load "...").

2. `custom-set-variables' (a function call with saved customized
values in its argument which is stored in one of the user init files)
will record the names of the files where it was loaded from, when it
is called during loading.  It will read the value of the variable
`load-file-name' during its loading.

3. `Custom-save' will use a list of file names where `custom-set-variables'
was loaded from.  When this list has multiple elements, it will ask
the user where to save `custom-set-variables'.

4. Users can move the `custom-set-variables' customization list to
another init file.  In this case there is a need to tell Emacs about
its new location.  The user has to call either (setq custom-file
(buffer-file-name)), or (push (buffer-file-name) custom-files), or
a special function on a new file buffer.  In any case, the comments in
`custom-set-variables' should contain instructions for users what to
do when `custom-set-variables' is moved manually.  Or maybe just allow
users to do `M-C-x' on `custom-set-variables'. But this might have
bad effects of overwriting the values of variables that were changed
outside of customize interface.

5. All these changes should be made before the next release to be able
to fix a problem in startup.el.  The problem is the following:

When `custom-file' (which has an absolute file name) is not literally
equal to the name of the loaded customization file, e.g. in the
following configuration:

(setq custom-file "~/emacs/lisp/custom-21.4.el")
(load "custom-21.4.el")

then custom-21.4.el is loaded twice.  startup.el fails to see that
it is already loaded, since it expects exactly the same absolute
file name in `load-history' which is not the case.  Instead of that,
it should check the value of a new variable which is set to
`load-file-name' during loading of the file with `custom-file-loaded'.

-- 
Juri Linkov
http://www.jurta.org/emacs/





reply via email to

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