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: Fri, 10 Dec 2004 21:38:00 -0600 (CST)

Stefan Monnier wrote (talking about custom-file):

   If someone set it via defcustom he's already screwed

Quite to the contrary.  The user sets `custom-file' through Custom to
tell Custom to write to that file.  Custom copies the old
`custom-set-variables' form into that file.  (Not quite, but it does
something equivalent that works even if the old custom file got
renamed or deleted in the meantime.)  It will also continue to write
in that file for the remainder of the session or until custom-file
gets changed again.  If the user wants to save the value of
`custom-file' for future sessions, he has to load that file in his
.emacs so that Custom can find it, as used to be clearly pointed out in
the docstring.  Note that `custom-file' can be set on a "for this
session only" basis.

I myself too am starting to find it hard to keep up with every detail
of what gets written back and forth in this thread.  But I wonder if
things are not needlessly getting too complicated and especially, too
backward incompatible.

People and packages have used the variable `custom-file' for various
more sophisticated purposes.  I hope that you are not in the process
of breaking such uses and such third party packages.  I myself do not
use them (and hence can provide no nitty-gritty details), but other
people use them.

There are only two problems.

First, the user who customizes through Custom has to realize that he
has to load the file in his .emacs, if he wants to save his
customization.  That was clearly pointed out in the docstring, but
that is changed now.  We can easily change it again so that it gets
even pointed out even more clearly than before.  At the limit, we
could (for people who have philosophical objections against reading
docstrings) provide a warning if the user saves the file for future
sessions (kind of like when the user uses a disabled command).

The second, more difficult problem is that to use custom-file for the
sort of thing it is most useful for, you have to write an Elisp form
which is trivial for Elisp programmers, but may be intimidating for
non-Elisp programmers.  The current solution is that a non-Elisp
programmer can copy the example I wrote for the Emacs manual with
different version numbers.

Basically one way to deal with the problem is to simply add a couple
of lines to the docstring of custom-file, as I proposed earlier.
I myself see no reason to do anything more complex than that.


Sincerely,

Luc.





reply via email to

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