[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: |
Lele Gaifax |
Subject: |
Re: which one to use: custom-set-variables, customize-set-variable, or customize-set-value? |
Date: |
Fri, 11 Dec 2015 19:23:35 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
Drew Adams <drew.adams@oracle.com> writes:
> Hi Alan,
>
>> Thank you for the explanation. For the moment I'm sticking with
>> `customize-set-variable'
>
> Good choice.
After reading this thread, as well as the referenced
http://permalink.gmane.org/gmane.emacs.bugs/107690, I tried to see if I should
rectify some settings in my own init file. Indeed, I was using `setq' on a
bunch of customizable options...
Given that checking each variable documentation to see the right way to set
its value is error prone, I wrote the following macro and used it in almost
all cases, replacing `setq' and `set-default' in my configuration:
(defmacro csetq (variable value)
"Macro to set the value of a variable, possibly a custom user option."
`(funcall (or (get ',variable 'custom-set)
(and (plist-member (symbol-plist ',variable)
'standard-value) 'set-default)
'set)
',variable ,value))
While it seems working as expected, I like to hear other's opinion: do you see
any problem with this approach?
Thank you,
ciao, lele.
--
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
lele@metapensiero.it | -- Fortunato Depero, 1929.
- Re: which one to use: custom-set-variables, customize-set-variable, or customize-set-value?,
Lele Gaifax <=
- RE: which one to use: custom-set-variables, customize-set-variable, or customize-set-value?, Drew Adams, 2015/12/11
- Re: which one to use: custom-set-variables, customize-set-variable, or customize-set-value?, Lele Gaifax, 2015/12/12
- RE: which one to use: custom-set-variables, customize-set-variable, or customize-set-value?, Drew Adams, 2015/12/12
- Re: which one to use: custom-set-variables, customize-set-variable, or customize-set-value?, tomas, 2015/12/13
- RE: which one to use: custom-set-variables, customize-set-variable, or customize-set-value?, Drew Adams, 2015/12/13
- Re: which one to use: custom-set-variables, customize-set-variable, or customize-set-value?, Lele Gaifax, 2015/12/14
- Re: which one to use: custom-set-variables, customize-set-variable, or customize-set-value?, B.V. Raghav, 2015/12/14