From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: custom-set-variables considered harmful Date: Wed, 08 Nov 2017 10:17:14 -0500 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1510154219 30538 195.159.176.226 (8 Nov 2017 15:16:59 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 8 Nov 2017 15:16:59 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Vivek Dasmohapatra Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 08 16:16:49 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 1eCS5v-0007MY-Tm for ged-emacs-devel@m.gmane.org; Wed, 08 Nov 2017 16:16:48 +0100 Original-Received: from localhost ([::1]:60408 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eCS5y-0005Ld-0e for ged-emacs-devel@m.gmane.org; Wed, 08 Nov 2017 10:16:50 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59333) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eCS5J-0005Ik-HW for emacs-devel@gnu.org; Wed, 08 Nov 2017 10:16:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eCS5G-0003DK-Ch for emacs-devel@gnu.org; Wed, 08 Nov 2017 10:16:09 -0500 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:43458) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eCS5G-0003BI-6u for emacs-devel@gnu.org; Wed, 08 Nov 2017 10:16:06 -0500 Original-Received: from lechazo.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id vA8FFvXw011841; Wed, 8 Nov 2017 10:15:57 -0500 Original-Received: by lechazo.home (Postfix, from userid 20848) id 284B460310; Wed, 8 Nov 2017 10:17:14 -0500 (EST) In-Reply-To: (Vivek Dasmohapatra's message of "Wed, 8 Nov 2017 14:23:00 +0000 (GMT)") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6154=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6154> : inlines <6165> : streams <1769705> : uri <2530378> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.22 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:219977 Archived-At: I think you misunderstood my suggestion. E.g. look at how VAR3 is handled in my example: '(VAR3 VAL3) is turned into (customize-set-variable VAR3 VAL3) rather than into (setq VAR3 VAL3) The idea was that VAR3 is a variable with a :setter. > In the former case (or similar cases) the user might copy the setq and then > be surprised that it does not work as expected. This is already a problem since '(VAR VAL3) doesn't do what the user intended when copied outside of the custom-set-variables block. The new doesn't aim to guarantee that copy&paste always works. It just aims to get a bit closer. E.g. note that using customize-set-variable doesn't solve the problem completely either (there are differences in terms of *when* the settings is applied), but it will often work. > In the latter, they would copy the setq, alter the value (possibly to > an "illegal" value) and then be surprised it didnt work. While the change I propose doesn't solve this problem, it doesn't make it worse either, AFAICT. Stefan