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: Sun, 29 Nov 2015 11:19:10 -0800 (PST) Message-ID: References: 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 1448824781 12238 80.91.229.3 (29 Nov 2015 19:19:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 29 Nov 2015 19:19:41 +0000 (UTC) To: Alan Schmitt , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Nov 29 20:19:25 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 1a37VN-0008Rn-8y for geh-help-gnu-emacs@m.gmane.org; Sun, 29 Nov 2015 20:19:25 +0100 Original-Received: from localhost ([::1]:37442 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a37VR-0001JD-Dy for geh-help-gnu-emacs@m.gmane.org; Sun, 29 Nov 2015 14:19:29 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40692) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a37VH-0001J4-Kb for help-gnu-emacs@gnu.org; Sun, 29 Nov 2015 14:19:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a37VD-0001wS-LW for help-gnu-emacs@gnu.org; Sun, 29 Nov 2015 14:19:19 -0500 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:41700) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a37VD-0001wO-Ft for help-gnu-emacs@gnu.org; Sun, 29 Nov 2015 14:19:15 -0500 Original-Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id tATJJDup006986 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 29 Nov 2015 19:19:14 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 tATJJDQU000695 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sun, 29 Nov 2015 19:19:13 GMT Original-Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id tATJJCma010900; Sun, 29 Nov 2015 19:19:12 GMT In-Reply-To: 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: 141.146.126.69 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:108250 Archived-At: > I recently read a message where, if I read it correctly, it was > recommended to use `customize-set-variable' and `customize-set-value' > to change settings in an init file while playing nice with the > custom system. I looked at their documentation and I have trouble=20 > understanding how they differ. I see there is also > `custom-set-variables' which has a different signature. >=20 > So my question is: should I use `setq', `customize-set-variable', > `customize-set-value', or `custom-set-variables' to change in my > init file variables that exist in the custom ecosystem? Good question! Here is my understanding, which might not be 100% correct: 1. The `customize-*' functions are also commands. And they set only a single variable (option). `custom-set-variables' is not a command, and it can set any number of options - it is what Customize writes to your `custom-file' (or init file). 2. `customize-set-value' does not use the defcustom's :set function, and it does not set the default value. It just sets the current value in the current buffer. It is like setq, except that it can be used interactively (it is a command), and in that case it reads the value according to how such values are read interactively. AFAIK, it respects the defcustom :type (but it does not respect :set). I agree that the doc is not very clear. Recently I forgot that `customize-set-value' does not use the defcustom's :set function, and I was bitten by the fact that it does not. It seems odd that it has two, completely independent differences from `customize-set-variable'.