Some people might think it is simpler to use setq
. Some people might think it is more lispy. In reality, it is naive in the general case.
It is true that for some user options it does not matter. But for others, it does matter, and setq
is the wrong approach for those options. So as a general rule, setq
is the wrong approach.
If you use custom-set-variables
or customize-set-variable
instead of setq
, or if you use the Customize user interface (e.g. M-x customize-option
), then you are sure that any intended initialization or updating code that is needed for the option value will be automatically triggered and run as needed. If you use setq
, this will not be done.
Now, it is also the case that most user options, especially many of them written for 3rd-party libraries, do not make use of the defcustom
keywords :set
and :initialize
, and using setq
does not matter for them. But lots of vanilla Emacs options do use such keywords, and for those that do, setq
is not the right thing.
So if you want to use Lisp code and not the Customize UI to set your options, then you are better off using custom-set-variables
or customize-set-variable
instead of setq
. It never hurts and it sometimes helps (a lot).
But what I recommend is to do both of these things:
Use the Customize UI instead of writing Lisp code for this.
Define variable custom-file
, so that Customize writes customizations to that file and not to your init file (~/.emacs
). IOW, keep your hand-written initialization code separate from the automatic code written by Customize.