all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: <tomas@tuxteam.de>
To: help-gnu-emacs@gnu.org
Subject: Re: which one to use: custom-set-variables, customize-set-variable, or customize-set-value?
Date: Sun, 13 Dec 2015 09:17:01 +0100	[thread overview]
Message-ID: <20151213081701.GA25363@tuxteam.de> (raw)
In-Reply-To: <782dca8a-9b67-49f4-bd41-20e80f94ad9e@default>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sat, Dec 12, 2015 at 08:11:07AM -0800, Drew Adams wrote:
> > 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.

Definitely agree here.

> 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.

Here I was trying to make a case for some kind of "generic setter"
which knows what the right thing is. Of course, such a generic setter
wouldn't be half as valuable without a context. I wouldn't do it in
my init file as of now, where it's not "usual".

Regards
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlZtKX0ACgkQBcgs9XrR2kYrfACeIPsVUb6XeqXhA/7OMGkA72ep
tcsAnjOZg9CkzUfgxWpRY8iHg/FzZj0+
=NHyI
-----END PGP SIGNATURE-----



  reply	other threads:[~2015-12-13  8:17 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
2015-12-13  8:17               ` tomas [this message]
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

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

  git send-email \
    --in-reply-to=20151213081701.GA25363@tuxteam.de \
    --to=tomas@tuxteam.de \
    --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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.