From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Elias_M=C3=A5rtenson?= Newsgroups: gmane.emacs.devel Subject: Re: custom-set-variables considered harmful Date: Sun, 26 Nov 2017 20:15:08 +0800 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="94eb2c0abc10c30084055ee1bc4b" X-Trace: blaine.gmane.org 1511698561 2868 195.159.176.226 (26 Nov 2017 12:16:01 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 26 Nov 2017 12:16:01 +0000 (UTC) Cc: emacs-devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 26 13:15:56 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 1eIvqg-0008Nr-Sb for ged-emacs-devel@m.gmane.org; Sun, 26 Nov 2017 13:15:51 +0100 Original-Received: from localhost ([::1]:56302 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eIvqm-0000qM-JM for ged-emacs-devel@m.gmane.org; Sun, 26 Nov 2017 07:15:56 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50838) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eIvq5-0000q5-BI for emacs-devel@gnu.org; Sun, 26 Nov 2017 07:15:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eIvq4-0004uU-4o for emacs-devel@gnu.org; Sun, 26 Nov 2017 07:15:13 -0500 Original-Received: from mail-it0-x235.google.com ([2607:f8b0:4001:c0b::235]:41039) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eIvq3-0004uO-Vq for emacs-devel@gnu.org; Sun, 26 Nov 2017 07:15:12 -0500 Original-Received: by mail-it0-x235.google.com with SMTP id x28so17772945ita.0 for ; Sun, 26 Nov 2017 04:15:11 -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=VQwIrSsJEJrh0B2InlaCdgAkWmqAMq22HLmAP0LW3d8=; b=HHSPs3mGWL5lv1Hwkrops47rhDiHekA7JLD3pbrYGKoFIbjM9RkYlcjSX1Y7hD10pi EZ3MYEOrJzhKMr2Ob0kIGU7ncRq3OXxD/f40ef047gjx9potV1jT3XMSmqpF5lT1gJ/n utfWlDJ7CqUYEvYUwO8PjzURMIHrBTA5ZAvjJL6o6fI/ukSG0050kqCB25ffmZfc/xdN +Or/BtejdxdLKXzSsC9vIXeGuyjxI9t2pIP06hREGGC3YTcimdwLW3RUoT3quMa1cLSz HWDZRQrR7qJf08wok20OImUxVRZXbr/0BKsnm8Bb+/iAZcD2jDs3y6hlPtunohfz9bho Nssw== 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=VQwIrSsJEJrh0B2InlaCdgAkWmqAMq22HLmAP0LW3d8=; b=d2WqzEMrvMrjnBEPWx6P1x6IEBI76ExeWL22CAhdiYEacomy1inPRJm+D2T6s7H+dV AW7lt5v1RZA9taFlEv70qdVeMoreLHeJjvXwIItS6qMUxC5r8CJH2iEYvnMnY9q//t2s gAceKMitIiv5xSE1imYz7t5+dVE0ekoJsjLBiBwG8OPlvCY8JNga+Pd3LY8z29dsr1nH bWD2V1NwN+Lh62G/87+Vy7o84dZf+wKDjR9zFX7d9CLKHsTjxkYbID4El3LtIWwBDZ2e gBEEPojztD2xzg/LEf5rxEVOmMAUHbbeFaJapuGyTZx6x6RBB/V6k+6fegtVgbrTnWA+ R4Bg== X-Gm-Message-State: AJaThX4dhZF+bcS1NKHDJ/7mBNR1VgfjKkmtpjT0RY3Usbw+H2HYd9B8 fUZ9BLFmsItALfUZ7FCoYzoCCM2O8jcyZTUvkxd/Qw== X-Google-Smtp-Source: AGs4zMa306oLpViJtOSt/roqAEzsa6busZod2mZdKMQTF1UEsHQrosbPVq1ATXRIhTlYwEkpkeef7ojClMiJuV29iTY= X-Received: by 10.36.243.13 with SMTP id t13mr21056061ith.19.1511698511100; Sun, 26 Nov 2017 04:15:11 -0800 (PST) Original-Received: by 10.107.62.134 with HTTP; Sun, 26 Nov 2017 04:15:08 -0800 (PST) Original-Received: by 10.107.62.134 with HTTP; Sun, 26 Nov 2017 04:15:08 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4001:c0b::235 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:220463 Archived-At: --94eb2c0abc10c30084055ee1bc4b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On 24 Nov 2017 3:17 pm, "Stefan Monnier" wrote: > Is there a particular reson you're not using =E2=80=98customize-set-varia= ble=E2=80=99 > for all values? Because I want the code to look as much as possible like "manually written Elisp", and `setq` is what is used in 99% of the Elisp customization code. I usually try to recommend people that they always use c-s-v instead of setq. It's easier to explain and more consistent. The fact that a lot of people use setq isn't really a great argument for using it in this case. The reason people use setq isn't because they want to, but because they don't understand how custom works. I see this as a great opportunity to make c-s-v more visible and teach people how to use it. Note that as long as the `setq` is within the magical custom-autogenerated-user-settings form, it will behave correctly even if the variable has a setter function. The difference will only affect those users who take this code and then copy it elsewhere. But setq doesn't have any concrete benefit other than familiarity to people who don't understand custom. I've spent more time than I wish on Freenode #emacs teaching people about custom. If c-s-v was used consistently that effort would be made a lot easier. Regards, Elias --94eb2c0abc10c30084055ee1bc4b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On 24 Nov 2017 3:17 pm, "Stefan Monnier" <monnier@iro.umontreal.ca> wrote:
> I= s there a particular reson you're not using =E2=80=98customize-set-vari= able=E2=80=99
> for all values?

Because I want the code to look as much as possible like "manual= ly
written Elisp", and `setq` is what is used in 99% of the Elisp
customization code.
I usually try to recommend people that they always= use c-s-v instead of setq. It's easier to explain and more consistent.= =C2=A0

The fact that a l= ot of people use setq isn't really a great argument for using it in thi= s case. The reason people use setq isn't because they want to, but beca= use they don't understand how custom works. I see this as a great oppor= tunity to make c-s-v more visible and teach people how to use it.=C2=A0

=
Note that as long as the `setq` is within the magical
custom-autogenerated-user-settings form, it will behave correctly even=
if the variable has a setter function.=C2=A0 The difference will only affec= t
those users who take this code and then copy it elsewhere.

But setq doesn&= #39;t have any concrete benefit other than familiarity to people who don= 9;t understand custom. I've spent more time than I wish on Freenode #em= acs teaching people about custom. If c-s-v was used consistently that effor= t would be made a lot easier.=C2=A0

Regards,=C2=A0
Elias=C2=A0

--94eb2c0abc10c30084055ee1bc4b--