From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Option to not automatically customize-save-variable `package-selected-packages' Date: Fri, 19 Feb 2016 11:31:14 +0200 Message-ID: <83mvqxrqql.fsf@gnu.org> References: <56C43D17.7010009@alice.it> <831t8aufoe.fsf@gnu.org> <8737sp51vx.fsf@gmail.com> <83fuwpubpn.fsf@gnu.org> <87egc9ahav.fsf@fastmail.fm> <834md5u426.fsf@gnu.org> <87vb5l664f.fsf@fastmail.fm> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1455874307 6446 80.91.229.3 (19 Feb 2016 09:31:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 19 Feb 2016 09:31:47 +0000 (UTC) Cc: johnw@gnu.org, emacs-devel@gnu.org, bruce.connor.am@gmail.com, angelo.graziosi@alice.it To: Joost Kremers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 19 10:31:40 2016 Return-path: Envelope-to: ged-emacs-devel@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 1aWhPW-00076q-Ru for ged-emacs-devel@m.gmane.org; Fri, 19 Feb 2016 10:31:38 +0100 Original-Received: from localhost ([::1]:50352 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWhPW-0000eN-27 for ged-emacs-devel@m.gmane.org; Fri, 19 Feb 2016 04:31:38 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51316) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWhPJ-0000eH-49 for emacs-devel@gnu.org; Fri, 19 Feb 2016 04:31:26 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aWhPI-0007T5-6T for emacs-devel@gnu.org; Fri, 19 Feb 2016 04:31:25 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:42908) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWhPD-0007Sd-Kl; Fri, 19 Feb 2016 04:31:19 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2830 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aWhPC-0000Au-Qb; Fri, 19 Feb 2016 04:31:19 -0500 In-reply-to: <87vb5l664f.fsf@fastmail.fm> (message from Joost Kremers on Thu, 18 Feb 2016 22:49:52 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:200192 Archived-At: > From: Joost Kremers > Cc: bruce.connor.am@gmail.com, johnw@gnu.org, angelo.graziosi@alice.it, emacs-devel@gnu.org > Date: Thu, 18 Feb 2016 22:49:52 +0100 > > >> I think the main difference is that as a user, I can decide *not* to use > >> Customize to set a particular defcustom. I can use a setq in my init > >> file instead. > > > > Can't you do the same with the list of installed packages? > > Can I? It was my understanding that package.el will write the list of > user-installed packages to custom-set-variables and there's no way for > the user to prevent this from happening. A quick look at the code of > package.el (on emacs-25 and on master) seems to suggest this is indeed > the case: `package--save-selected-packages' is added to > `after-init-hook' and the function itself appears to save the package > list unconditionally. Is package--save-selected-packages called every time package.el is invoked, even if the user doesn't change the list of the selected packages? If so, this is the problem we must solve -- package.el shouldn't write anything to user files if nothing's changed in the selected packages. Otherwise, the user could install a package, edit their .emacs to convert the custom-set-variables forms into setq, and then write more complex Lisp if the init file needs to be shared across different systems with different collections of packages on each system, like they have to do with any other customization that is system-dependent. Will this solve the issue?