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: Calling (package-initialize) sooner during initialization Date: Mon, 30 Mar 2015 20:01:53 +0100 Message-ID: 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 1427742128 21053 80.91.229.3 (30 Mar 2015 19:02:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 30 Mar 2015 19:02:08 +0000 (UTC) To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 30 21:02:00 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 1Ycewh-0003PX-Uk for ged-emacs-devel@m.gmane.org; Mon, 30 Mar 2015 21:02:00 +0200 Original-Received: from localhost ([::1]:35638 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ycewh-0001Eu-Ex for ged-emacs-devel@m.gmane.org; Mon, 30 Mar 2015 15:01:59 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44955) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ycewd-0001C9-4w for emacs-devel@gnu.org; Mon, 30 Mar 2015 15:01:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ycewc-0002fP-6O for emacs-devel@gnu.org; Mon, 30 Mar 2015 15:01:55 -0400 Original-Received: from mail-lb0-x231.google.com ([2a00:1450:4010:c04::231]:33273) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ycewb-0002fE-W2 for emacs-devel@gnu.org; Mon, 30 Mar 2015 15:01:54 -0400 Original-Received: by lbcmq2 with SMTP id mq2so101905519lbc.0 for ; Mon, 30 Mar 2015 12:01:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:date:message-id:subject:from:to :content-type; bh=hcRWCbz6kjWwl1sulS+Lhp8+FdC4e7JK7s/IYEqmAv8=; b=XaUpYyw+2gaodv5AGAHW8GN2YOk6cEhxZjAw1ZTStOoTvfQmzy3QnuH6psAinMphsw vXM6uVGPr5eFa+w9IVvZ8QolwocMNDssdzljh3U8kHZZ+A+d56Wihh6YF9mF47fQMEBz NbvUquevRgO6aGNhbLqObXkUnMLDauq01U3anVq9a5HrhVVdqscw8AjS73iK4huUMvWv Nba7wusSD8PtCIStH+bEYohnRTC8pAKXgiT1MRKUKjM0Vzo16hAu4KusQOFStnEMyBEZ lholKl+qw28rkw3/u/FPH+VS3Jp94N1PPt2J/vGsqBMyyDqRhTvQ43W/kZ6uJf+wtkmF 1rSQ== X-Received: by 10.112.98.201 with SMTP id ek9mr27885024lbb.68.1427742113205; Mon, 30 Mar 2015 12:01:53 -0700 (PDT) Original-Received: by 10.112.207.225 with HTTP; Mon, 30 Mar 2015 12:01:53 -0700 (PDT) X-Google-Sender-Auth: UFaBDQ19fD2j7d6h3vitDMyuI2U X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c04::231 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:184562 Archived-At: On the "Customizable modes..." thread I suggested we run (package-initialize) sooner than the way it's currently done. Right now, it's called after loading the init file. Which means any user who tries to customize an installed package by pasting some code into his init file will be confronted with errors. This happens A LOT. Stefan kindly explains why it can't just be done before loading the init file: > [...] the user may need/want to run some Elisp > code of his own choosing *before* package-initialize is called. > E.g. [...] set package-load-list and package-directory-list But I'm asking that we try a little harder to find a better solution. This package.el-induced "cannot find load file" error is the most predominant issue I see people run into in the wild. Some people file issues for this stuff on github (and waste developer time), others go to the relevant forums, and others (I can only imagine) probably just give up on configuring packages (or give up Emacs!) entirely. So I hope we can try to converge on an actual solution instead of just resigning to something that harms the majority of the users. I propose here a couple of suggestions which still preserve the use-case outline by Stefan, and I'm perfectly open to other ideas. Even if we can't find an ideal solution, try to keep in mind how absurdly unideal the current situation is. Option 1) Check if the file `~/.emacs,d/.package-delay-init' exists. If it does, just do it the way we currently do. If it doesn't exist, do package-initialize first and then load the init-file. This `.package-delay-init' file is not loaded, Emacs would only check if it exists. 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. This would be a one-time-thing (and would take some intelligent coding to prevent annoyiances). Thank you all, Artur