From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "John Wiegley" Newsgroups: gmane.emacs.devel Subject: Re: Loading a package applies automatically to future sessions? Date: Sun, 28 Jan 2018 22:55:52 -0800 Message-ID: References: <76b1fb81-54c0-c213-a542-dc7b9838c473@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Trace: blaine.gmane.org 1517209050 18522 195.159.176.226 (29 Jan 2018 06:57:30 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 29 Jan 2018 06:57:30 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.91 (darwin) Cc: Radon Rosborough , George Plymale II , emacs-devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 29 07:57:26 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 1eg3NT-0003wJ-C9 for ged-emacs-devel@m.gmane.org; Mon, 29 Jan 2018 07:57:15 +0100 Original-Received: from localhost ([::1]:43986 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eg3PU-0004lA-96 for ged-emacs-devel@m.gmane.org; Mon, 29 Jan 2018 01:59:20 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34727) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eg3Nq-0003ix-DZ for emacs-devel@gnu.org; Mon, 29 Jan 2018 01:57:39 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eg3Np-0005q3-Bp for emacs-devel@gnu.org; Mon, 29 Jan 2018 01:57:38 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:53975) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eg3Nk-0005oc-Q0; Mon, 29 Jan 2018 01:57:32 -0500 Original-Received: from auth2-smtp.messagingengine.com ([66.111.4.228]:53247) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.82) (envelope-from ) id 1eg3Nk-0007Jy-GN; Mon, 29 Jan 2018 01:57:32 -0500 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailauth.nyi.internal (Postfix) with ESMTP id C412020CB8; Mon, 29 Jan 2018 01:57:31 -0500 (EST) Original-Received: from frontend2 ([10.202.2.161]) by compute4.internal (MEProxy); Mon, 29 Jan 2018 01:57:31 -0500 X-ME-Sender: Original-Received: from localhost (76-234-69-149.lightspeed.frokca.sbcglobal.net [76.234.69.149]) by mail.messagingengine.com (Postfix) with ESMTPA id 63CB824691; Mon, 29 Jan 2018 01:57:31 -0500 (EST) In-Reply-To: (Stefan Monnier's message of "Sun, 28 Jan 2018 17:11:07 -0500") Mail-Followup-To: Stefan Monnier , Radon Rosborough , George Plymale II , emacs-devel X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e 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:222291 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable >>>>> "SM" =3D=3D Stefan Monnier writes: SM> - In the case of JW, why does he have so many packages installed to slow SM> down his startup, yet he doesn't want them activated? Are these packages SM> that he does use, but just rarely? Or does he just have lots of packages SM> installed that he doesn't use (e.g. that's my case: I always have all G= NU SM> ELPA packages installed, even though I use very few of them)? If so, why SM> does he have so many packages installed even tho he doesn't use them? I do use them, all of them. At present there are just over 385 in my local configuration. However, they don't all need to be active and available immediately after startup. They fall into several categories, all of which can be deferred: 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. 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. In fact, the packages I require to be immediately available, the instant Em= acs becomes ready, are incredibly few (I'm not even sure there are any!). By deferring absolutely everything, and autoloading only precisely what is nee= ded 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 actions that cause them to lazy load. And before you ask: Yes, I do restart my Emacs. A lot. This is the whole reason I evolved this technique. Sometimes I restart Emacs over a 100 times= a day, simply because it's the only way I can be completely sure that my state has been reset (which includes Emacs state, Nix state, shell state, OS stat= e). 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. =2D-=20 John Wiegley GPG fingerprint =3D 4710 CF98 AF9B 327B B80F http://newartisans.com 60E1 46C4 BD1A 7AC1 4BA2 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAEBCgAdFiEE3lW3afxXihSlvlQwwUTY9PGf5jAFAlpuxXgACgkQwUTY9PGf 5jD1ygv/cO3r91B5eKEG7e7hgzkYgpCxSCmoH5iiuSh1lQRU8BoqDAWa5rtq/iiZ MblrvKoyApCng3PYZO0UrTMAuSh9mMKb+iSUrUgyvJABnZaTZk49Upc6UEqWgWO7 6WSc8YQ4A+K6d3ZffpFItJdF8GW+vl1qvvxbA2QQFRBoVUMcNQ3y7erF5Ur/fZJH Zj8jYuuFEZRx2MczJ/mjtMYu5+KPBwzks0iw2haMGtuAn7NqzuBfUGMbh/GD0n88 iZiJB8Y6+dyOG1xf7P+5Vm5LNrCkbkx97kkbOfSPzS8BmrB0KHljtQKf3fE+fiRa LgLk695GQDnVVQYX6SuNxTa+Rk+YCGiYL4WeVuvmYqXlBqkEdccnOsLjPLmBc3IE up5CRdvFlYxYs5QWeMoq7GlD/BOtoahiRyGNQNk/3vPq6ifP2oJJP5XSMhDVKSD8 fZHw7+kmY5cn+LCSe/SvwcHOPfYINCZspz85LW73x9DfsWoX/WVXMipdC+Kz7PIj e9D48z+K =W0rT -----END PGP SIGNATURE----- --=-=-=--