From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?Jorgen_Sch=C3=A4fer?= Newsgroups: gmane.emacs.devel Subject: Re: Calling (package-initialize) sooner during initialization Date: Sun, 12 Apr 2015 23:02:58 +0200 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1428872584 9218 80.91.229.3 (12 Apr 2015 21:03:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 12 Apr 2015 21:03:04 +0000 (UTC) Cc: Vasilij Schneidermann , emacs-devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Apr 12 23:03:04 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 1YhP1z-0000cI-OK for ged-emacs-devel@m.gmane.org; Sun, 12 Apr 2015 23:03:03 +0200 Original-Received: from localhost ([::1]:46282 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YhP1z-0007s7-2L for ged-emacs-devel@m.gmane.org; Sun, 12 Apr 2015 17:03:03 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37978) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YhP1w-0007s1-Mn for emacs-devel@gnu.org; Sun, 12 Apr 2015 17:03:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YhP1v-0002l0-OY for emacs-devel@gnu.org; Sun, 12 Apr 2015 17:03:00 -0400 Original-Received: from mail-wi0-x22c.google.com ([2a00:1450:400c:c05::22c]:37388) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YhP1v-0002kq-Hl for emacs-devel@gnu.org; Sun, 12 Apr 2015 17:02:59 -0400 Original-Received: by widdi4 with SMTP id di4so31997349wid.0 for ; Sun, 12 Apr 2015 14:02:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=vR5dJOhNLSukeuMQOQe3/5kZSriu/7eheabkPbGk/gY=; b=I5R8BR1XrOZP18/UxaVypQ3D4asH0PPc93FP7Cysp0gYQUnm3FE+yCm/m3T7xXvnpj dSCJr0OjShogFU3YzhtDPoRm5kNGM7YvjdIR+0YkQG8sEqs7Mk6vuyVrDUxv/RyFkNeU rLuwBzvWLjIUVnNRh0JFkXjV0PFbML8aqzm201JGYnufzceRcnMStatDjxGQq1vweY/F tcFvRAXxUq6XS2fUhDH0+J6Crf2+yyEI6KPKkkBqmLIoxFRhWvsqY8u/38ESa8a70+fD OXEyh/UXDV4Gg9KQmn9fNRObT835vIEP54SVw1YJVKgU4Kn94GDTcNcyTVGEDa9qAAeK YBRw== X-Received: by 10.194.59.46 with SMTP id w14mr21958768wjq.106.1428872578915; Sun, 12 Apr 2015 14:02:58 -0700 (PDT) Original-Received: by 10.27.52.194 with HTTP; Sun, 12 Apr 2015 14:02:58 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::22c 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:185361 Archived-At: On Sun, Apr 12, 2015 at 10:44 PM, Stefan Monnier wrote: >>> - package-load-list: Needs to be configured before. >> If the user does not want to enable certain packages, they can move >> them out of ~/.emacs.d/elpa/. > > Nope: package-directory-list can include system directories (with > system-wide installed packages), so the user may not have the option to > move them out of the directory. My proposal does not talk about initializing anything in package-directory-list. >>> - package-archives: Needs to be configured before for >>> non-interactive package installation. >>> - package-pinned-packages: Needs to be configured before for >>> non-interactive package installation. >>> - package-check-signature and package-unsigned-archives: Can be >>> customized afterwards. >>> - package-directory-list: Needs to be configured before. >> These are all only relevant for package installation, not for package > > True, except for package-directory-list which is very much used by > package-initialize. I was not talking about package-initialize. To make myself a bit more clear, my proposal would mean adding these lines of code to startup.el just before the user init file is loaded: (dolist (dir (directory-files "~/.emacs.d/elpa" t "\\`[^.]")) (when (file-directory-p dir) (add-to-list 'load-path dir) (dolist (autoload (directory-files dir t "-autoloads.el\\'")) (load autoload nil t)))) This would solve the problem of users being confused because their init file can not access packages they installed, allow all the heavy package initialization to happen after the init file is processed, and finally allow users to revert to the old behavior if they so choose by setting package-user-dir to a different directory than ~/.emacs.d/elpa/. Regards, Jorgen