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: Lennart Borgman
Subject: Re: Documentation for custom-file - is not (load custom-file) needed?
Date: Wed, 8 Dec 2004 18:52:23 +0100

----- Original Message ----- 
From: "Juri Linkov" <address@hidden>

> I wrote:
> > It's too late to make any changes in custom-file (changing its type,
> > etc.) since users might already rely on its current state.
>
> But maybe it is safe to change the type of custom-file from defcustom
> to defvar.  I am only concerned about backward compatibility.
> What happens if some users already have customized `custom-file' in
> `custom-set-variables' and it will be removed from this list?
> Perhaps, nothing bad.  Moreover, the situation where `custom-file'
> in `custom-set-variables' points to some file other than the file
> where `custom-set-variables' is located, is invalid.  It will cause
> duplication of `custom-set-variables' list when Emacs saves customized
> variables next time.  So, not adding `custom-file' to the set of
> variables in `custom-set-variables' is the right thing.  `custom-file'
> should be purely an internal variable (which is achieved with the
> previous patch).

Hi Juri,

Reading your previous message where you pointed out that a variable
custom-file-loaded could be set by custom-set-variables (a nice idea that
makes things much cleaner) I got maybe a further idea that could make
backward compatibility easier. It is not totally safe, but maybe
sufficiently safe:

The idea is simply to remove custom-file and add a new defvar
custom-file-in-use that is used instead. This way we do not have to care
about if custom-set-variable finds a custom-file setting. It is simply not
used. (Or, rather I cannot find any reasonable situation where the user uses
custom-file if it is not defined by a setq before. Can you?)

Maybe this is just what you intended? I was not sure. I prefer the name
custom-file-in-use instead of custom-file-loaded.


> However, there is one situation when users have to deal with the
> `custom-file' variable.  When the user moves `custom-set-variables'
> to a new location in another file, it's needed to tell Emacs about
> this location, so the next invocation of `Custom-save' could write
> customization to the new place.  To inform users about that, the next
> 3 lines could be added to the comments of `custom-set-variables':
>
>  (custom-set-variables
>    ;; custom-set-variables was added by Custom.
>    ;; If you edit it by hand, you could mess it up, so be careful.
>    ;; Your init file should contain only one such instance.
>    ;; If there is more than one, they won't work right.
> +  ;; When you move it to another init file, to tell Emacs about
> +  ;; its new location for the current Emacs session, type C-x C-e
> +  ;; at the end of this line: (setq custom-file buffer-file-name)
> +  ;; For further Emacs sessions just put in your init file
> +  ;; (load "custom-file.el").  There is no need to set `custom-file'
> +  ;; explicitly in your init files since Emacs can automatically set
> +  ;; it to the file name where your customizations were loaded from.

I like the ideas though I would change the text used a bit.

Doing it this way we still leave possibilites for someone who later wants to
make a "customization page" (along what I started with perhaps) for
custom-file-in-use. However custom-file-in-use should never be made a
defcustom variable. I just mean a page that looks similar. Such a feature
could be tested after release of the new Emacs.

- Lennart





reply via email to

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