From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Artur Malabarba Newsgroups: gmane.emacs.devel Subject: Re: Calling (package-initialize) sooner during initialization Date: Mon, 27 Apr 2015 16:15:30 +0100 Message-ID: References: <87383xk4ia.fsf@taylan.uni.cx> <87d22zi69k.fsf@taylan.uni.cx> <87a8xtoq3a.fsf@gmail.com> <87fv7lzl0q.fsf@gmail.com> Reply-To: bruce.connor.am@gmail.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1430147780 18313 80.91.229.3 (27 Apr 2015 15:16:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 27 Apr 2015 15:16:20 +0000 (UTC) Cc: Stefan Monnier , emacs-devel To: Thierry Volpiatto Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 27 17:16:14 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 1YmklQ-0008Cl-61 for ged-emacs-devel@m.gmane.org; Mon, 27 Apr 2015 17:16:04 +0200 Original-Received: from localhost ([::1]:55712 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YmklP-0000zl-54 for ged-emacs-devel@m.gmane.org; Mon, 27 Apr 2015 11:16:03 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36365) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ymkku-0000yx-DY for emacs-devel@gnu.org; Mon, 27 Apr 2015 11:15:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ymkkt-0001I1-6Y for emacs-devel@gnu.org; Mon, 27 Apr 2015 11:15:32 -0400 Original-Received: from mail-la0-x22e.google.com ([2a00:1450:4010:c03::22e]:34540) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ymkks-0001Hs-Vp for emacs-devel@gnu.org; Mon, 27 Apr 2015 11:15:31 -0400 Original-Received: by laat2 with SMTP id t2so82388128laa.1 for ; Mon, 27 Apr 2015 08:15:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=N16A2OVCv7jTjNmELMZV2Y9QOEZIyHf580RvP+Rss0M=; b=wwF+TANq4MlL5QzXd1UuAV0/JBY2itcCD1fSC6l9zENMdAMV+7eqcR9hpVqz7M1ME6 +9oNfytquZfv6pLdpZ6eDVsIltEehuaVQD36Pftdhe9/dqa8cxkAIFgycWao+wZS0h2M gspbH1bxSnV7OdBBlVpPwXvPwyN+LxAW0THETuTKbkEyDwIgwYQA4F9zP1+4mP92zd16 i/qEQqwjuKlYcaCn2X4VoJtr2rHZwMZVZ85SInMgJnCP5wFZSVnGMP29HEtOcUbHX+Ry Lf6lJc59EcoYacqDrjCkEtLbyvtEAZHszQOjXjb1FXIJeyPj1NzMpLclRm14IzH0R9p+ UZcQ== X-Received: by 10.152.87.204 with SMTP id ba12mr10750236lab.35.1430147730225; Mon, 27 Apr 2015 08:15:30 -0700 (PDT) Original-Received: by 10.25.150.1 with HTTP; Mon, 27 Apr 2015 08:15:30 -0700 (PDT) In-Reply-To: <87fv7lzl0q.fsf@gmail.com> X-Google-Sender-Auth: YafIcyDR6fja8Ag3pw-ww0OY7Y0 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::22e 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:185938 Archived-At: > Why ? > If the default is using always the custom-file, this file could be > loaded by default before the init file. > And IMO it should be the default, writing custom setting at end of init > file is the first thing one want to prevent when writing its emacs init > file. I see. So you're talking about loading custom-file automatically, before loading the init file. You can't just do that, because that will cause failure for some init files that currently work fine. Some users out there may have some code in his init file that needs to be run before the custom variables are loaded. 2015-04-27 15:46 GMT+01:00 Thierry Volpiatto : > > Stefan Monnier writes: > >>> Why don't you write to the custom-file (and make the use of custom-file >>> the default instead of writing custom settings in .emacs by default) ? >> >> When should the custom-file be loaded? Before .emacs is too early. > > Why? > > What is the difference with: > > - (load custom-file) + (load user-init-file) > - loading init file with (load custom-file) on top of it. None. Stefan's point was that we can't force the user to load his custom file at the top of his init file (nor can we load it before the init file), because there are situations where the user needs to run some code before the custom variables are loaded. Besides, other options have been suggested around here, none of which break the system for users with special custom-file needs, so I'd suggest you look into them. One is about adding the directories under emacs.d/elpa to the load-path before loading the init file (without calling full-on package-initialize). The other is about dividing startup between pre-initialize and post-initialize, it is more heavyweight but it has the advantage of also fixing some other issues with custom.el.