[Top][All Lists]

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

RE: Using "Emacs Configure" **and** modifying .emacs

From: Drew Adams
Subject: RE: Using "Emacs Configure" **and** modifying .emacs
Date: Fri, 11 Aug 2017 09:54:12 -0700 (PDT)

> > ....and that is the problem. What are the
> > "some-value"? I tried 2-3 variables until
> > someone in this newsgroups gave me the proper
> > value, which at the time I was not even aware.
> Yes, and that is a fine way of doing it!
>     1) think
>     2) use the help system or manual
>     3) experiment
>     4) ask a friend (or NG)

Thre seems to be some misunderstanding in this thread,
regarding the opposition "use setq" vs "use Customize".

`setq' is fine for setting a user-option value, but *ONLY IF*:

1. The value you set it to is one that "works" (is expected by,
   and acceptable to, the code that uses it, so that it causes
   that code to do the right thing).

2. The `defcustom' defining the option does not specify a
   `:set' function or similar behavior (e.g. `:initialize').

   A `:set' function is a trigger invoked by Customize
   functions to set the option value.  It should (must) be
   used to set the option value, for proper behavior (see #1).

It is true that most user options are not defined with a `:set'
function, so you can usually get away with just blindly using
`setq', as long as you respect #1.

But if you want to set a user option using Lisp, then it is far
better to use `customize-set-variable', `customize-set-value',
or `custom-set-variables', than it is to use `setq'.  These are
the functions that Customize itself uses.

`defcustom' is not `defvar'.  It typically imposes a `:type';
it can impose a `:set' function; and so on.  If you want to
use Lisp with user options, you will help yourself by getting
to know `defcustom'.  (Which really means getting to know some
Customize functions.)

It is fine to use Lisp.  It is generally not advisable to use
it without knowing what the functions you use do (or don't do).
That's one way to learn, of course, - by experimenting, but it
can also help to read the fine manual.  Folks went to the trouble
of writing this stuff up to help you. ;-)

reply via email to

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