unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Lele Gaifax <lele@metapensiero.it>, help-gnu-emacs@gnu.org
Subject: RE: which one to use: custom-set-variables, customize-set-variable, or customize-set-value?
Date: Sat, 12 Dec 2015 08:11:07 -0800 (PST)	[thread overview]
Message-ID: <782dca8a-9b67-49f4-bd41-20e80f94ad9e@default> (raw)
In-Reply-To: <87lh90nk3u.fsf@metapensiero.it>

> d> And no, you do not ever need to "check each variable documentation to
> d> see the right way to set its value".  (And you should anyway not rely
> d> on a variable's documentation for that.)
> 
> How's it that possible? How can then I know when to use `setq',
> `setq-default' or `customize-set-variable'?

> t> I think Lele has a point here. Imagine some "simple" variable which
> t> becomes later (i.e. in a later Emacs version) a user option. The
> t> once "right" code in the Emacs init file becomes kind-of "wrong".
> 
> Yes, exactly. Or a buffer-local setting, when it would be even more
> "wrong".

Perhaps I misunderstood.  I thought you meant check the doc for a
description of what the :set function does, initialization, etc.

Anyway, what I meant is to not check _only the documentation_.
Check also the definition of the variable.

While the documentation should correctly report whether it is
an option, and whether it might have a buffer-local value, it
is still good, IMO, to check the defvar/defcustom.

As I said, you can certainly do as you suggest.  My suggestion is
to clearly show in your init file how you are setting the value.
Including for different Emacs versions - so you are aware of such
changes when you read your code later.  But it's just a suggestion.





  parent reply	other threads:[~2015-12-12 16:11 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-29 18:47 which one to use: custom-set-variables, customize-set-variable, or customize-set-value? Alan Schmitt
2015-11-29 19:19 ` Drew Adams
2015-11-30  8:52   ` Alan Schmitt
2015-11-30 15:20     ` Drew Adams
2015-11-30 15:44       ` Alan Schmitt
2015-12-11 18:23       ` Lele Gaifax
2015-12-11 18:53         ` Drew Adams
2015-12-12  8:31           ` Lele Gaifax
2015-12-12 12:09             ` tomas
2015-12-12 13:31               ` Lele Gaifax
2015-12-12 16:11             ` Drew Adams [this message]
2015-12-13  8:17               ` tomas
2015-12-13 17:32                 ` Drew Adams
2015-12-14  2:44                   ` B.V. Raghav
2015-12-14  8:28                   ` Lele Gaifax

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=782dca8a-9b67-49f4-bd41-20e80f94ad9e@default \
    --to=drew.adams@oracle.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=lele@metapensiero.it \
    /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).