Re: defcustom manipulation

[email protected]
Newsgroups gmane.emacs.help
Message-ID <[email protected]>
Heime <[email protected]> writes:

>> 
>> 1. Because the definition of ‘defcustom’ says:
>> 
>>    ":set VALUE should be a function to set the value of the symbol
>> 	 when using the Customize user interface.  It takes
>>          two arguments, the symbol to set and the value to
>>          give it.  The function should not modify its value
>>          argument destructively."
>
> Is the symbol the one that the defcustom is named?

Yes, it is the option name that ‘defcustom’ defines.

>  My defcustom symbol
> is an alist, does supplying a value mean one for the entire alist.
>

That is up to your function definition.  If you want to set
the value of your named option, then it can do that.  Or, if
you want to modify the value of your named option, then it
can do that.  Or, your function can decide which steps it
should take depending on the value.

> I want to modify or add just a single element of the alist
> (key . value) entry, not the entire thing every time.
>  

The function definition that you provide to ‘:set’
determines what it will do.  If you want it to modify the
value of your named option, ‘galaxiakos-fpln’, then you
should write your function to modify an association list,
just as you would when you are *not* using ‘defcustom’.
Your function is provided the name of the user option and
the new value.  Write a function that has these two
arguments and modifies the user option as you want.  If that
function does not work as you expect, then you can debug it
(for example, using edebug) or post it to this mailing list
for suggestions.

-- 
The lyf so short, the craft so long to lerne.
- Geoffrey Chaucer, The Parliament of Birds.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.