unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: help-gnu-emacs@gnu.org
Subject: RE: Using "Emacs Configure" **and** modifying .emacs
Date: Fri, 11 Aug 2017 09:54:12 -0700 (PDT)	[thread overview]
Message-ID: <d6247b4e-c8df-4f0e-81a9-b3c155499868@default> (raw)
In-Reply-To: <86o9rmruil.fsf@zoho.com>

> > ....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	other threads:[~2017-08-11 16:54 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-10 13:51 Using "Emacs Configure" **and** modifying .emacs Ronald Fischer
2017-08-10 15:59 ` Drew Adams
2017-08-10 16:58   ` Emanuel Berg
2017-08-12 17:24     ` John Ankarström
2017-08-13 20:16       ` Emanuel Berg
2017-08-12 17:32     ` John Ankarström
2017-08-10 16:00 ` Óscar Fuentes
2017-08-10 16:56 ` Emanuel Berg
2017-08-11  7:21   ` Ronald Fischer
2017-08-11 13:51     ` Emanuel Berg
2017-08-11 14:11       ` Tomas Nordin
     [not found]       ` <mailman.12937.1502460691.21957.help-gnu-emacs@gnu.org>
2017-08-11 15:20         ` notbob
2017-08-11 15:31           ` Emanuel Berg
2017-08-11 16:54             ` Drew Adams [this message]
2017-08-11 19:07               ` Emanuel Berg
2017-08-11 19:15                 ` Drew Adams
2017-08-12 15:53                   ` ken
2017-08-12 16:11                     ` Emanuel Berg
2017-08-12 16:24                       ` ken
2017-08-13 20:19                         ` Emanuel Berg
     [not found]           ` <mailman.12941.1502465490.21957.help-gnu-emacs@gnu.org>
2017-08-11 15:57             ` notbob
2017-08-11 16:37               ` Emanuel Berg
     [not found]     ` <mailman.12935.1502459723.21957.help-gnu-emacs@gnu.org>
2017-08-11 14:09       ` HASM
2017-08-11 15:20         ` Emanuel Berg
     [not found]         ` <mailman.12940.1502464872.21957.help-gnu-emacs@gnu.org>
2017-08-11 18:55           ` Alan Mackenzie
2017-08-11 20:08             ` HASM
2017-08-11 20:29             ` Emanuel Berg
2017-08-11 20:46               ` Drew Adams
2017-08-11 22:12                 ` (1) defcustom :set, (2) similar for defvar Drew Adams
2017-08-12  0:15                 ` Using "Emacs Configure" **and** modifying .emacs Emanuel Berg
2017-08-12  7:30                   ` tomas
2017-08-12  7:43                     ` Emanuel Berg
2017-08-12  8:02                       ` tomas
2017-08-12 10:03                         ` Emanuel Berg
2017-08-12 10:38                           ` Tomas Nordin
2017-08-12 11:38                             ` Emanuel Berg
2017-08-15 22:10                             ` Emanuel Berg
2017-08-15 22:18                               ` Drew Adams
2017-08-15 22:27                                 ` Emanuel Berg
2017-08-15 23:38                                   ` Drew Adams
2017-08-16  0:09                                     ` John Mastro
2017-08-16  0:37                                       ` Robert Thorpe
2017-08-16  1:20                                         ` Emanuel Berg
2017-08-16  0:09                                     ` Emanuel Berg
2017-08-15 22:25                               ` John Mastro
2017-08-15 22:41                                 ` Emanuel Berg
2017-08-15 23:09                                 ` Drew Adams
2017-08-16  0:07                                   ` John Mastro
2017-08-16  0:13                                     ` Emanuel Berg
2017-08-12 12:50                         ` Emanuel Berg
2017-08-12 16:04                       ` Drew Adams
2017-08-12 16:20                         ` Emanuel Berg
2017-08-12 16:04                     ` Drew Adams
2017-08-12  0:32                 ` Emanuel Berg
2017-08-14 16:33                 ` Emanuel Berg
2017-08-14 18:15                   ` Emanuel Berg
2017-08-14 21:41                     ` Emanuel Berg
2017-08-14 23:17                     ` John Mastro
2017-08-15  0:24                       ` Emanuel Berg
2017-08-15  2:20                         ` Emanuel Berg
     [not found] ` <mailman.12888.1502380810.21957.help-gnu-emacs@gnu.org>
2017-08-10 17:47   ` Dan Espen
2017-08-10 18:06     ` Drew Adams
2017-08-10 18:10       ` Drew Adams
     [not found]     ` <mailman.12897.1502388423.21957.help-gnu-emacs@gnu.org>
2017-08-10 19:08       ` Dan Espen
2017-08-10 19:14         ` Emanuel Berg
     [not found]         ` <mailman.12899.1502392471.21957.help-gnu-emacs@gnu.org>
2017-08-11 12:03           ` Dan Espen
2017-08-11 13:46             ` Emanuel Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d6247b4e-c8df-4f0e-81a9-b3c155499868@default \
    --to=drew.adams@oracle.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).