From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help 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) Message-ID: <782dca8a-9b67-49f4-bd41-20e80f94ad9e@default> References: <99f3716d-513e-42b5-b43b-fafca9c81f5a@default> <87twnorgig.fsf@metapensiero.it> <63e721db-3901-4017-a254-a679a4d8d04e@default> <87lh90nk3u.fsf@metapensiero.it> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1449936705 15188 80.91.229.3 (12 Dec 2015 16:11:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 12 Dec 2015 16:11:45 +0000 (UTC) To: Lele Gaifax , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Dec 12 17:11:32 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1a7mlg-0004In-GZ for geh-help-gnu-emacs@m.gmane.org; Sat, 12 Dec 2015 17:11:32 +0100 Original-Received: from localhost ([::1]:52282 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a7mlf-00083m-Mf for geh-help-gnu-emacs@m.gmane.org; Sat, 12 Dec 2015 11:11:31 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40914) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a7mlU-00083X-AF for help-gnu-emacs@gnu.org; Sat, 12 Dec 2015 11:11:21 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a7mlP-0007k9-63 for help-gnu-emacs@gnu.org; Sat, 12 Dec 2015 11:11:20 -0500 Original-Received: from userp1040.oracle.com ([156.151.31.81]:27548) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a7mlO-0007iC-Vb for help-gnu-emacs@gnu.org; Sat, 12 Dec 2015 11:11:15 -0500 Original-Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id tBCGB9ZM031245 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 12 Dec 2015 16:11:10 GMT Original-Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id tBCGB9ux009085 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sat, 12 Dec 2015 16:11:09 GMT Original-Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id tBCGB9uN029016; Sat, 12 Dec 2015 16:11:09 GMT In-Reply-To: <87lh90nk3u.fsf@metapensiero.it> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6691.5000 (x86)] X-Source-IP: userv0021.oracle.com [156.151.31.71] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:108382 Archived-At: > 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.) >=20 > 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". >=20 > 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.