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: Friendly discussion about (package-initialize) Date: Sun, 06 Aug 2017 21:39:41 -0400 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1502070053 18502 195.159.176.226 (7 Aug 2017 01:40:53 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 7 Aug 2017 01:40:53 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 07 03:40:50 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 1deX2F-0004Sx-JB for ged-emacs-devel@m.gmane.org; Mon, 07 Aug 2017 03:40:47 +0200 Original-Received: from localhost ([::1]:34942 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1deX2L-0003hJ-PU for ged-emacs-devel@m.gmane.org; Sun, 06 Aug 2017 21:40:53 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38954) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1deX1W-0003fU-9k for emacs-devel@gnu.org; Sun, 06 Aug 2017 21:40:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1deX1R-0008FV-Eg for emacs-devel@gnu.org; Sun, 06 Aug 2017 21:40:02 -0400 Original-Received: from [195.159.176.226] (port=46948 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1deX1R-0008E6-7y for emacs-devel@gnu.org; Sun, 06 Aug 2017 21:39:57 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1deX1E-00019F-Ke for emacs-devel@gnu.org; Mon, 07 Aug 2017 03:39:44 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 57 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:ZexrEaN5rixDNx/N6JVjo7sITTA= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 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:217348 Archived-At: > Sure, I think it's reasonable for Emacs to provide special support for > packages which are built in. But there's such a thing as going too > far. And I personally think that you've gone too far in providing > special support when that support actively makes it *more* difficult > to swap out an alternative implementation. You wrote lots and lots of lines of text just to complain about the addition of a single "(package-initialize)" in the user's ~/.emacs, which should do absolutely nothing in the case where the user doesn't use package.el (i.e. doesn't have anything inside ~/.emacs.d/elpa). So, it's not that big of a deal, really. We could arrange for "(package-initialize)" to only be added if there is at least one package inside ~/.emacs.d/elpa. More to the point, I think that's already the case. So users of other package managers should simply never bump into this text (unless they also user package.el, of course). If they do, they should report it as a bug. > * Make it trivial to disable package.el. Right now, the only foolproof > way to prevent the init-file from being modified by package.el is to > place multiple advices on internal functions, and to do this as Multiple? Doesn't (advice-add 'package--ensure-init-file :override #'ignore) do the trick? I suspect that (setq package-enable-at-startup nil) might also do the trick. This said, the main motivation for calling package--ensure-init-file from package-initialize was to fix existing user's config where they had packages installed yet their .emacs didn't call package-initialize, so they had trouble configuring their packages. One might argue that this situation is now mostly fixed and we could change tactic: only call package--ensure-init-file when the user installs a package. Another thing is that rather then look for "(package-initialize)" in ~/.emacs we could keep track of whether package-initialize was called during initialization. This will avoid the problem when the user placed his call in another file. Stefan PS: BTW, I'd be very interested to work with maintainers of other package managers to see how we could make them better interoperate (e.g. make it possible to install with one tool, but activate&config with another).