From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Loading a package applies automatically to future sessions? Date: Mon, 29 Jan 2018 14:08:49 -0500 Message-ID: References: <76b1fb81-54c0-c213-a542-dc7b9838c473@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1517252579 30276 195.159.176.226 (29 Jan 2018 19:02:59 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 29 Jan 2018 19:02:59 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: George Plymale II , emacs-devel To: Radon Rosborough Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 29 20:02:55 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1egEhS-0006S0-4o for ged-emacs-devel@m.gmane.org; Mon, 29 Jan 2018 20:02:38 +0100 Original-Received: from localhost ([::1]:59237 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egEjR-0002OD-9W for ged-emacs-devel@m.gmane.org; Mon, 29 Jan 2018 14:04:41 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44363) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egEjJ-0002NW-6O for emacs-devel@gnu.org; Mon, 29 Jan 2018 14:04:34 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1egEjG-0001xE-3y for emacs-devel@gnu.org; Mon, 29 Jan 2018 14:04:33 -0500 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:41553) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egEjF-0001wd-TX for emacs-devel@gnu.org; Mon, 29 Jan 2018 14:04:30 -0500 Original-Received: from lechazo.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id w0TJ4Qkp014121; Mon, 29 Jan 2018 14:04:27 -0500 Original-Received: by lechazo.home (Postfix, from userid 20848) id EC49A605CE; Mon, 29 Jan 2018 14:08:49 -0500 (EST) In-Reply-To: (John Wiegley's message of "Sun, 28 Jan 2018 22:55:52 -0800") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6210=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6210> : inlines <6345> : streams <1777459> : uri <2582161> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.20 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:222298 Archived-At: > Thanks to use-package, I don't need to think very hard to make such a setup > work. And since there's almost no cost to adding in more functionality to my > Emacs, I add tons and tons: all within easy reach should I need it. We were talking about package activation rather than configuration, so use-package is not an apples-to-apples comparison. `package-initialize` is supposed to do things like: > 1. A set of keybinding(s) that should "activate" the package and make its > functionality available. Until I press one of those keys, the package > can stay dormant, and no time should be spent on it. > > 2. An entry in auto-mode-alist, interpreter-mode-list, etc. > > 3. A command I must invoke via M-x to trigger autoload. and pretty much nothing else, i.e. a subset of what use-package is often used for. AFAIK for packages installed with package.el, this part of use-package only makes sense when the packages is not properly packaged (i.e. doesn't do 1/2/3 correctly in their -autoloads.el). Regarding the other two points: > 4. Some other condition, like the loading of one of the aforementioned > packages. > > 5. Waiting until some amount of idle time has passed, since the mode in > question is just a "bell & whistle", and I shouldn't need to wait for > it to start using Emacs. These have to do with configuration, not with activation, so package-initialize should never do any of that nor prevent doing any of that. This part of use-package is just as useful for ELPA-installed packages as for any others. > I do use them, all of them. At present there are just over 385 in my local > configuration. [...] > to trigger activation, I can have Emacs available within 0.4 seconds after > startup, with all the other functionality coming online as I perform the I don't think I can easily bring down the speed of package-initialize much below 0.1s for my 200 packages on my Thinkpad T61. Whether that would still let you startup in 0.4s with your config, I can't tell. There's no doubt that with use-package you have a finer control about what happens when, so you can delay some of the things done during package-initialize, but without looking more deeply into it, it's hard to tell whether that would really be needed. Stefan