From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: use-package Date: Wed, 04 May 2016 08:09:51 -0400 Message-ID: References: <874magv15u.fsf@mat.ucm.es> <87d1p38ll6.fsf@mat.ucm.es> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1462363865 31631 80.91.229.3 (4 May 2016 12:11:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 4 May 2016 12:11:05 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Kaushal Modi Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed May 04 14:10:56 2016 Return-path: Envelope-to: geh-help-gnu-emacs@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 1axvdo-00006I-0L for geh-help-gnu-emacs@m.gmane.org; Wed, 04 May 2016 14:10:56 +0200 Original-Received: from localhost ([::1]:47628 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axvdk-00061n-5I for geh-help-gnu-emacs@m.gmane.org; Wed, 04 May 2016 08:10:52 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50304) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axvdI-0005bk-A9 for help-gnu-emacs@gnu.org; Wed, 04 May 2016 08:10:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1axvcy-0005jO-WB for help-gnu-emacs@gnu.org; Wed, 04 May 2016 08:10:18 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:23880) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axvcy-0005dM-SW for help-gnu-emacs@gnu.org; Wed, 04 May 2016 08:10:04 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0A+FgA731xV/0uLxEVcgxBUgy6FVb0WhXUEAgKBPDwRAQEBAQEBAYEKQQWDXQEBAwFWIwULCzQSFBgNJIg3CM8jAQEBAQYCAR+LOoUFB4QtBZchgk0FhSQ+jjyDGoIUgUUjgWaCLiKCeAEBAQ X-IPAS-Result: A0A+FgA731xV/0uLxEVcgxBUgy6FVb0WhXUEAgKBPDwRAQEBAQEBAYEKQQWDXQEBAwFWIwULCzQSFBgNJIg3CM8jAQEBAQYCAR+LOoUFB4QtBZchgk0FhSQ+jjyDGoIUgUUjgWaCLiKCeAEBAQ X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="223059544" Original-Received: from 69-196-139-75.dsl.teksavvy.com (HELO pastel.home) ([69.196.139.75]) by ironport2-out.teksavvy.com with ESMTP; 04 May 2016 08:09:51 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id C722F642D6; Wed, 4 May 2016 08:09:51 -0400 (EDT) In-Reply-To: (Kaushal Modi's message of "Wed, 04 May 2016 03:33:45 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:109870 Archived-At: > For instance, we cannot do (add-to-list 'package-archives '("org" . " > http://orgmode.org/elpa/") t) before doing (require 'package). Well, this > is a valid case where we need to do require first as package-archives does > not autoload package. I'm not saying there aren't valid cases. I'm saying that when it's needed, we should treat it as a bug. IOW I consider this specific case as a shortcoming of package.el. Kind of like advice: if you need to use it, it's usually an indication that the package lacks some customization hooks. > I am not qualified enough to judge if yasnippet could have been coded > better so that I didn't need to lazy load it. But delaying loading this yasnippet.el could probably easily be split into two files so only a "smallish" file is loaded when you activate yasnippet, and the second larger one is loaded only once you do trigger a snippet-expansion. > package made a significant difference to my emacs startup, especially > because I save and load desktop with about 50-60 files open. I do not need > yasnippet to load the snippets for all the major modes in those 50-60 files > immediately at startup. desktop.el is indeed a source of significant slowdown "by nature". It's be worthwhile to try and improve desktop.el so that it can do the loading more lazily. E.g. we could add some kind of "virtual buffer" functionality, such that list-buffers displays the buffer and C-x b lets you select it, even though the buffer doesn't really exist yet, and only once you really select it is the buffer created. > (Also, it's easy to simply prevent loading of a package you suspect to be > misbehaving by adding :disabled keyword for that package's use-package > form. With that you prevent loading that package and also evaluating your > config for that package like keybindings, advices, overrides, wrapper > defuns, etc). Yes, use-package helps you structure your config, indeed, and that's good. > I don't understand why that is important. Because as it stands, use-package encourages users to work around packages's shortcomings rather than to report those. It encourages the perception that it's the user's responsability to setup autoloads and to avoid all kinds of pitfalls. Stefan