From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.devel Subject: Re: Calling (package-initialize) sooner during initialization Date: Sat, 18 Apr 2015 06:46:48 -0400 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <87fv7xpvc7.fsf@lifelogs.com> References: Reply-To: emacs-devel@gnu.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1429354056 8670 80.91.229.3 (18 Apr 2015 10:47:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 18 Apr 2015 10:47:36 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Apr 18 12:47:25 2015 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 1YjQHU-0007iU-KD for ged-emacs-devel@m.gmane.org; Sat, 18 Apr 2015 12:47:24 +0200 Original-Received: from localhost ([::1]:45194 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YjQHT-0005q7-IK for ged-emacs-devel@m.gmane.org; Sat, 18 Apr 2015 06:47:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35627) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YjQHC-0005pJ-Pw for emacs-devel@gnu.org; Sat, 18 Apr 2015 06:47:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YjQH7-0000t4-Pq for emacs-devel@gnu.org; Sat, 18 Apr 2015 06:47:06 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:56855) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YjQH7-0000sz-Jg for emacs-devel@gnu.org; Sat, 18 Apr 2015 06:47:01 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1YjQH5-0007RY-Or for emacs-devel@gnu.org; Sat, 18 Apr 2015 12:46:59 +0200 Original-Received: from c-98-229-61-72.hsd1.ma.comcast.net ([98.229.61.72]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 18 Apr 2015 12:46:59 +0200 Original-Received: from tzz by c-98-229-61-72.hsd1.ma.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 18 Apr 2015 12:46:59 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Original-Lines: 57 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-98-229-61-72.hsd1.ma.comcast.net X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6; d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" Mail-Copies-To: never User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux) Cancel-Lock: sha1:5UWpFwwJ9tkKxLTdnrAG6UshMh4= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:185563 Archived-At: On Mon, 30 Mar 2015 16:44:04 -0400 Stefan Monnier wrote: >> Option 2) Instead of us manually telling users to add >> `(package-initialize)' to their init-files, we have Emacs do that >> automatically. Similar to how `custom.el' adds a call to >> `custom-set-variables' the first time you save a variable; package.el >> could add a call to `package-initialize' the first time you install a >> package. SM> I think that's the way to go, indeed. Ugh. Sadly it seems to be the only reasonable way without changing what `package-initialize' does fundamentally. But I would approach this with command-line switches for Emacs, see below. On Sun, 12 Apr 2015 12:07:24 +0200 Vasilij Schneidermann wrote: >> We discussed this already. There's the issue of configuring package.el >> before loading it and/or before calling package-initialize. VS> OK, I've checked again and sighted eight customization candidates in VS> package.el: VS> - package-enable-at-startup: Would be equivalent to the proposed VS> environment variable. VS> - package-load-list: Needs to be configured before. VS> - package-archives: Needs to be configured before for VS> non-interactive package installation. VS> - package-pinned-packages: Needs to be configured before for VS> non-interactive package installation. VS> - package-user-dir: Needs to be configured before. VS> - package-directory-list: Needs to be configured before. VS> - package-check-signature and package-unsigned-archives: Can be VS> customized afterwards I think `package-check-signature' should also be configured before for batch operation. There aren't that many variables and they are all package-related. So maybe support "emacs --package-xyz=foo" for all the above, for the exceptional cases where the default setup of `package-initialize' is wrong. Unlike --eval, the --package switches would know to notify the internals. And unlike environment variables, the operation mode would be explicitly encoded in the invocation. Regardless of how it's implemented, I would make it easier for beginners at the expense of making customizations a little harder for advanced users and making batch operations complicated (because they usually already are). So, for instance, environment variables for begginers are not great because beginners are not going to write a wrapper shell script. I think, unfortunately, in the end it's easiest to keep the current "just put this in your init file" situation. We could do worse :) Ted