emacs-devel
[Top][All Lists]
Advanced

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

Re: custom-set-variables considered harmful


From: Elias Mårtenson
Subject: Re: custom-set-variables considered harmful
Date: Sun, 26 Nov 2017 20:15:08 +0800

On 24 Nov 2017 3:17 pm, "Stefan Monnier" <address@hidden> wrote:
> Is there a particular reson you're not using ‘customize-set-variable’
> for all values?

Because I want the code to look as much as possible like "manually
written Elisp", and `setq` is what is used in 99% of the Elisp
customization code.

I usually try to recommend people that they always use c-s-v instead of setq. It's easier to explain and more consistent. 

The fact that a lot of people use setq isn't really a great argument for using it in this case. The reason people use setq isn't because they want to, but because they don't understand how custom works. I see this as a great opportunity to make c-s-v more visible and teach people how to use it. 

Note that as long as the `setq` is within the magical
custom-autogenerated-user-settings form, it will behave correctly even
if the variable has a setter function.  The difference will only affect
those users who take this code and then copy it elsewhere.

But setq doesn't have any concrete benefit other than familiarity to people who don't understand custom. I've spent more time than I wish on Freenode #emacs teaching people about custom. If c-s-v was used consistently that effort would be made a lot easier. 

Regards, 
Elias 


reply via email to

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