help-gnu-emacs
[Top][All Lists]
Advanced

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

RE: which one to use: custom-set-variables, customize-set-variable, or c


From: Drew Adams
Subject: RE: which one to use: custom-set-variables, customize-set-variable, or customize-set-value?
Date: Sun, 29 Nov 2015 11:19:10 -0800 (PST)

> I recently read a message where, if I read it correctly, it was
> recommended to use `customize-set-variable' and `customize-set-value'
> to change settings in an init file while playing nice with the
> custom system. I looked at their documentation and I have trouble 
> understanding how they differ. I see there is also
> `custom-set-variables' which has a different signature.
> 
> So my question is: should I use `setq', `customize-set-variable',
> `customize-set-value', or `custom-set-variables' to change in my
> init file variables that exist in the custom ecosystem?

Good question!  Here is my understanding, which might not be
100% correct:

1. The `customize-*' functions are also commands.  And they set
only a single variable (option).  `custom-set-variables' is not
a command, and it can set any number of options - it is what
Customize writes to your `custom-file' (or init file).

2. `customize-set-value' does not use the defcustom's :set
function, and it does not set the default value.  It just sets
the current value in the current buffer.  It is like setq,
except that it can be used interactively (it is a command),
and in that case it reads the value according to how such
values are read interactively.  AFAIK, it respects the
defcustom :type (but it does not respect :set).

I agree that the doc is not very clear.  Recently I forgot
that `customize-set-value' does not use the defcustom's :set
function, and I was bitten by the fact that it does not.
It seems odd that it has two, completely independent
differences from `customize-set-variable'.



reply via email to

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