From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.devel Subject: Re: Calling (package-initialize) sooner during initialization Date: Tue, 31 Mar 2015 16:03:30 +0200 Message-ID: <87d23pxo0d.fsf@gmail.com> References: <87619h8s5m.fsf@gmail.com> <87d23pb8ye.fsf@gmail.com> <87a8ytb7nl.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1427810661 22345 80.91.229.3 (31 Mar 2015 14:04:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 31 Mar 2015 14:04:21 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 31 16:04:16 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 1Ycwly-0004rb-QQ for ged-emacs-devel@m.gmane.org; Tue, 31 Mar 2015 16:04:06 +0200 Original-Received: from localhost ([::1]:38827 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ycwly-0003ef-4Y for ged-emacs-devel@m.gmane.org; Tue, 31 Mar 2015 10:04:06 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46572) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ycwlg-0003eT-9s for emacs-devel@gnu.org; Tue, 31 Mar 2015 10:03:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ycwlb-0003aU-7Z for emacs-devel@gnu.org; Tue, 31 Mar 2015 10:03:48 -0400 Original-Received: from mail-wi0-x235.google.com ([2a00:1450:400c:c05::235]:38573) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ycwlb-0003aJ-14 for emacs-devel@gnu.org; Tue, 31 Mar 2015 10:03:43 -0400 Original-Received: by wibgn9 with SMTP id gn9so27480212wib.1 for ; Tue, 31 Mar 2015 07:03:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:from:to:cc:subject:in-reply-to:date:message-id :mime-version:content-type; bh=9RjH6C++esFFCQele2GjUiaKqLgTc4OvxkZCd9j70ag=; b=qPhDYyAv2v+EqWnOo2TyKFa3CLfs869hGZg5YKnvMsZzecGWrm/JRNJwTcQPNEyhpx rCXzGCMOpOibL6WvUKwQJe7Xk30+oLVSPVrjwLKcl87SIGShd7BOjsOv5SZW1vcwpPPg gxTVVRt/mc7+xXATGO6Zqt6rQ6c8w8I4cWe+3iehiuRItJZLvdOa3wKJzwqy16mm8OUg GRQHjDyJWK7qq2XBYKTs53qEQjeQLNyaCnRb8om1WT266e40Ms/Tknw5gPeFsMFMIH/K L23yNtyBZKxXNyxOC5iSSp5Y96WUaEF0A3qD5Eg9KQLjTeP0U/bxq5AxrNRiePZ9hXxO dVOw== X-Received: by 10.194.48.12 with SMTP id h12mr76305426wjn.74.1427810622284; Tue, 31 Mar 2015 07:03:42 -0700 (PDT) Original-Received: from dell-14z ([37.163.222.83]) by mx.google.com with ESMTPSA id hj10sm20500342wjc.48.2015.03.31.07.03.40 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 31 Mar 2015 07:03:41 -0700 (PDT) In-reply-to: <87a8ytb7nl.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::235 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:184626 Archived-At: Thierry Volpiatto writes: > Thierry Volpiatto writes: > >> Stefan Monnier writes: >> >>>>> 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 >>> >>>> Why not adding a set function to these vars calling >>>> `package-initialize', so if one set these functions AFTER a >>>> `package-initialize' call `package-initialize' will be called again. >>>> Of course these vars have to be set with customize, not setq. >>> >>> The default of package-load-list is to enable everything, so the main >>> use for package-load-list is to *prevent* initialization of >>> some packages. >>> IOW, the "setter" would have to *undo* some initializations, which is >>> can't be done reliably. >> >> IIUC `package-load-list' once set with 'all (the default) can't be >> changed to something else (not all packages) after running >> `package-initialize' (i.e it can't unload the already loaded packages) >> unless restarting emacs. >> There is something wrong here IMHO. > > Maybe `package-load-list' should have a nil default value instead of all > and once package-initialize run, it could set it to 'all if it don't > find a customized value. > This with not help the real time setting of this var (no way to unload), > but may solve the problem at startup. Seems it is working fine with this: 1) default value of package-load-list => nil 2) customize yourself package-load-list e.g => ' (all) 3) Add at beginning of package-initialize someting like: (unless package-load-list (setq package-load-list '(all))) When starting emacs the value of package-load-list before calling package-initialize is '(all). -- Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997