From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philippe Vaucher Newsgroups: gmane.emacs.devel Subject: Re: custom-set-variables considered harmful Date: Fri, 1 Dec 2017 10:51:15 +0100 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a11427978120d98055f4451fa" X-Trace: blaine.gmane.org 1512153716 11646 195.159.176.226 (1 Dec 2017 18:41:56 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 1 Dec 2017 18:41:56 +0000 (UTC) Cc: Stefan Monnier , emacs-devel To: =?UTF-8?Q?Elias_M=C3=A5rtenson?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 01 19:41:48 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eKqFv-0002Ui-EA for ged-emacs-devel@m.gmane.org; Fri, 01 Dec 2017 19:41:47 +0100 Original-Received: from localhost ([::1]:59590 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eKqG2-0001uA-Ix for ged-emacs-devel@m.gmane.org; Fri, 01 Dec 2017 13:41:54 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60487) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eKoNV-0000NB-HT for emacs-devel@gnu.org; Fri, 01 Dec 2017 11:41:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eKoNU-0007l1-Jb for emacs-devel@gnu.org; Fri, 01 Dec 2017 11:41:29 -0500 Original-Received: from mail-vk0-x234.google.com ([2607:f8b0:400c:c05::234]:33105) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eKoNU-0007kj-Er for emacs-devel@gnu.org; Fri, 01 Dec 2017 11:41:28 -0500 Original-Received: by mail-vk0-x234.google.com with SMTP id q189so5888565vke.0 for ; Fri, 01 Dec 2017 08:41:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=z1sLNdNKin0/XgtB9Dki3S0caMvQkQAGxX0INW5527A=; b=Ba2LXST9L9YERKs1joaP2AGFy6ezcg4zKgAuLlVcFnLJh6DSBsz8/IBpHJISB2p2Ck 1rS37mEuBPN5ba17vKykx68POD2CvOBItuvx7TDwKO4t07evWUhjfCmi12LRE6wUKMmY ZiHNQEMBljscxEPV8i1/ZMz+7dExUcVAF/b3iRQJvv0z1RB5kedvHfRDpUZ6oWUPGxql 5OCIaMW8IilSdd5VkCyDNzScCIg8VlIjJwqPa04NJImKr47Kv8GL72eCLX2YpDhxZSmc +96kOivFn3W7Pdb6kVrYw/veyPgp46FpWbCLTKfjZtXY9rrpJKl3QWPDTtwFO36wu5SO oL5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=z1sLNdNKin0/XgtB9Dki3S0caMvQkQAGxX0INW5527A=; b=QqY0FzVchO6RkAJK2RbzM1Prpzqo6WHgwDeHPgjcgTtzTYGhvNAdW5JZt7G+uYTDuk RK4SSli23/3zQAwyrTa/1lMw1ySGOfEwYkga5BKsr4PfL86igiGJuAjEH2DQTGCvIgf2 atiLHfEt/Jy1rDOkxJHW08cuJj/FjelP/FaG2ok2wLOWhYw8oEFMyiHAwtWoKP8W1qPe ag7s9ChjvSYX2RO8sw2XJEhhRGoYzdcrxd3MhL6rXNCOAJFL2Kc6NBfgVnKWd8bEkkds A9MTfUG4e66fpRsjdciq/+uhOGE2VHA6RNQzNEf9cRNUsurDE3vxtJoXHMVTDAvxMEIK vM/A== X-Gm-Message-State: AKGB3mIgc+MjosDuk3eTklJG0ZJ8tYwA9cZWmupFhlyrw0ZANnF6Gv2d 3tLY/VcVgpq4WZsdNBPO6Ih77l2KNapUjJBYrHU= X-Google-Smtp-Source: AGs4zMbZCJfO2vgBLQwBt6ONLqJ6eNMDDhzAsuMRzR9IndtJZTv6o9jHuQW9lBx4x4fV5LUWBNHGHb0tMNUdWkxYAo4= X-Received: by 10.31.3.147 with SMTP id f19mr4021756vki.84.1512121906104; Fri, 01 Dec 2017 01:51:46 -0800 (PST) Original-Received: by 10.103.82.195 with HTTP; Fri, 1 Dec 2017 01:51:15 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400c:c05::234 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:220572 Archived-At: --001a11427978120d98055f4451fa Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > Can you maybe enlighten me about what problem c-s-v solves that would hav= e >> me start to use it? >> > > Your explicit =E2=80=98setq=E2=80=99 calls are perfectly fine as long as = the variables you > set do not have a setting function > assigned to them. However, if they do have setter functions, then the > behaviour will not be correct. > It has been suggested that you manually look at the =E2=80=98defcustom=E2= =80=99 > definitions of the variables so that > you know which ones doesn't work with =E2=80=98setq=E2=80=99. > > The only reason people can get away with not doing this is because there > are so few custom variables > that use setter functions. > Ah, well in my case it was just ignorance that setter functions can exist. That and the fact that "it just works" 99% of the time with most variables and if you `setq` the variable prior to loading the package makes it hard to notice there's a problem. I'll try to migrate my config toward use-package `:custom` directive. Philippe --001a11427978120d98055f4451fa Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

=
=
Can you maybe enlighten me about what problem c-s-v solves= that would have me start to use it?
Your explicit =E2=80=98setq=E2=80=99 calls are perfectly= fine as long as the variables you set do not have a setting function
=
assigned to them. However, if they do have setter functions, then the = behaviour will not be correct.
It has been suggested that you man= ually look at the =E2=80=98defcustom=E2=80=99 definitions of the variables = so that
you know which ones doesn't work with =E2=80=98setq= =E2=80=99.

The only reason people can get awa= y with not doing this is because there are so few custom variables
that use setter functions.

Ah, well in my case it was just ignorance that setter funct= ions can exist. That and the fact that "it just works" 99% of the= time with most variables and if you `setq` the variable prior to loading t= he package makes it hard to notice there's a problem.

I'll try to migrate my config toward use-package `:custom` dire= ctive.

Philippe
--001a11427978120d98055f4451fa--