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: Luc Teirlinck
Subject: Re: Documentation for custom-file - is not (load custom-file) needed?
Date: Sun, 12 Dec 2004 21:49:22 -0600 (CST)

As I already said, the proposed solutions for custom-file seemed to be
getting too complex.  I believe the best solution is to leave
custom-file (essentially) unchanged with some documentation changes.
Note that the main use of custom-file is to have different custom
files for different versions of Emacs.  If we implement a completely
new way of doing things, then we make things more complicated for the
user, who will have to learn both methods, as well as how to make them
coexist.

I would recommend that most users customize custom-file with a setq in
their .emacs.  Customizing through Custom has several pitfalls, _even_
if only done only for the current session, but can be handy for
certain types of uses of `custom-file' if the user is willing to read
some documentation.  We should clearly warn the user if the user
selects `File' in the Custom buffer, and there are various relatively
easy ways (built into Custom) to do so.  With proper warning and
documentation, there is no need to eliminate the possibility of
customizing through Custom.

I have various concrete ideas in mind, but it would be easier to
implement them than to explain the details without implementation.  I
would have to experiment a little bit to see how things really look in
practice in a real customization buffer.  Basically, the docstring
would be slightly expanded and changed and the appearance of the
Custom buffer would change, if `File' is selected, with a warning
appearing, saying: maybe you would rather customize this through
.emacs.  If you really want to do it through Custom, read the docs.

The only (small) non-documentation change needed would be connected
with the following pointed out by Juri:

   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'.

One solution might be to tell the user who customizes in .emacs and
for some reason needs to load the file in .emacs instead of after
it, to do:

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

and _not_ do what is done in the quote above.

For the user customizing through Custom, Stefan's code could check for
a saved-value property on `custom-file'.  If there is such a property,
`custom-file' has been loaded, even if it appears not to be (for the
reason given in the above quote).  This would be the only (very minor)
code change.

I could submit a concrete implementation within the next week or so,
if people would agree that the above is worth a try.

Sincerely,

Luc.






reply via email to

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