From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Calling (package-initialize) sooner during initialization Date: Mon, 20 Apr 2015 15:07:01 -0400 Message-ID: References: <87383xk4ia.fsf@taylan.uni.cx> <87d22zi69k.fsf@taylan.uni.cx> <878udmj2gu.fsf@taylan.uni.cx> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1429556886 26747 80.91.229.3 (20 Apr 2015 19:08:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 20 Apr 2015 19:08:06 +0000 (UTC) Cc: Philipp Stephani , Artur Malabarba , emacs-devel To: taylanbayirli@gmail.com (Taylan Ulrich =?utf-8?Q?=22Bay=C4=B1rl=C4=B1?= =?utf-8?Q?=2FKammer=22?=) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 20 21:07:51 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 1YkH2s-0000Ka-92 for ged-emacs-devel@m.gmane.org; Mon, 20 Apr 2015 21:07:50 +0200 Original-Received: from localhost ([::1]:55031 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YkH2r-0003sG-92 for ged-emacs-devel@m.gmane.org; Mon, 20 Apr 2015 15:07:49 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45044) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YkH2Z-0003sB-8E for emacs-devel@gnu.org; Mon, 20 Apr 2015 15:07:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YkH2V-0002Ow-Q4 for emacs-devel@gnu.org; Mon, 20 Apr 2015 15:07:31 -0400 Original-Received: from mercure.iro.umontreal.ca ([132.204.24.67]:55586) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YkH2V-0002Om-Ki for emacs-devel@gnu.org; Mon, 20 Apr 2015 15:07:27 -0400 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 9F94085FA3; Mon, 20 Apr 2015 15:07:26 -0400 (EDT) Original-Received: from lechon.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id E61E81E5B8D; Mon, 20 Apr 2015 15:07:01 -0400 (EDT) Original-Received: by lechon.iro.umontreal.ca (Postfix, from userid 20848) id C210BB40DC; Mon, 20 Apr 2015 15:07:01 -0400 (EDT) In-Reply-To: <878udmj2gu.fsf@taylan.uni.cx> ("Taylan Ulrich =?utf-8?Q?=5C=22Bay=C4=B1rl=C4=B1=2FKammer=5C=22=22's?= message of "Mon, 20 Apr 2015 16:31:29 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82, MC_TSTLAST 0.00) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 132.204.24.67 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:185725 Archived-At: > I generally feel uncomfortable about a tool automatically editing a file > that I assume to have control over, but maybe that's fine. We all do. Yet that's also what custom.el does. > A concrete problem I can think of is when one has some settings for > package.el in their init file, then Emacs ends up putting > (package-initialize) at the top, when it should be after the package > related settings. Is this not a problem? Oh yes. And there can be all kinds of other interesting cases. > with a trick like this. WTF? It might be simple to implement, but > conceptually it's rather confusing. Well, conceptually it's simple as well, if you look at it from the implementation point of view ;-) > wrong (packages are automatically initialized after loading init.el if > it hasn't been done there) Actually, with the new code that auto-adds "(package-initialize)" to ~/.emacs, we should be able to get rid of this hack that calls package-initialize if the .emacs didn't do so already (tho we'll need to wait a little, for the usual compatibility reasons). > and a sign of the package system being crudely bolted on top of > existing machinery. That's stinky engineering. Welcome to the world of long-lived programs that need to live with backward compatibility. BTW, having a separate pre-package init file would also be stinky engineering imposed by hysterical raisins. Good engineering would probably require re-thinking the whole customize-set-variables issue and maybe also the semantics of defcustom. I'd be happy if someone were to try and do the work of figuring out what a clean design would look like, so we'd at least be able to assess whether we can hope to get there from here without too much pain. > I hope I'm not coming off as religious. This is Emacs we're talking about. > Yes, this is a more involved solution, but it brings some structure into > Emacs initialization with regard to the role of the package system, and > its interaction with Customize. Right, and that's exactly what I don't want: I don't want to impose an arbitrary structure that happens to suit the current needs. Tricky dependencies between setting vars and loading their packages can also exist within customize-set-variables without the existence of package.el. > think it should be fine to leave that be and only load default.el and > site-start.el after package initialization. Or can anyone think of The difference between site-start.el and default.el is that one is loaded before ~/.emacs and the other after. Stefan