From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: phillip.lord@russet.org.uk (Phillip Lord) Newsgroups: gmane.emacs.help Subject: Re: using use-package Date: Tue, 11 Aug 2015 21:36:49 +0100 Message-ID: <87vbclo93y.fsf@russet.org.uk> References: <20150805055619.13567.17B26335@ahiker.mooo.com> <17131863-cbb8-4a85-8470-490fe9a0c0d4@googlegroups.com> <66dceb24-5fef-4316-8c8b-e9a3e62b0fb8@googlegroups.com> <3594e2c6-bd02-412f-98df-9dd0f145277a@googlegroups.com> <01b4d996-aad3-44ff-a580-7950b25b7dc8@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1439325443 12818 80.91.229.3 (11 Aug 2015 20:37:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 11 Aug 2015 20:37:23 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Stefan Monnier Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Aug 11 22:37:12 2015 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 1ZPGIJ-0003yQ-Hu for geh-help-gnu-emacs@m.gmane.org; Tue, 11 Aug 2015 22:37:11 +0200 Original-Received: from localhost ([::1]:35814 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPGII-0006ry-8D for geh-help-gnu-emacs@m.gmane.org; Tue, 11 Aug 2015 16:37:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44030) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPGI6-0006rs-MX for help-gnu-emacs@gnu.org; Tue, 11 Aug 2015 16:36:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZPGI1-00077Z-Am for help-gnu-emacs@gnu.org; Tue, 11 Aug 2015 16:36:58 -0400 Original-Received: from cheviot22.ncl.ac.uk ([128.240.234.22]:52958) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPGI1-00077P-14 for help-gnu-emacs@gnu.org; Tue, 11 Aug 2015 16:36:53 -0400 Original-Received: from smtpauth-vm.ncl.ac.uk ([10.8.233.129] helo=smtpauth.ncl.ac.uk) by cheviot22.ncl.ac.uk with esmtp (Exim 4.63) (envelope-from ) id 1ZPGHy-0002JO-Fy; Tue, 11 Aug 2015 21:36:51 +0100 Original-Received: from cpc6-benw10-2-0-cust45.gate.cable.virginm.net ([92.238.179.46] helo=localhost) by smtpauth.ncl.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.63) (envelope-from ) id 1ZPGHy-0006pD-H3; Tue, 11 Aug 2015 21:36:50 +0100 In-Reply-To: (Stefan Monnier's message of "Tue, 11 Aug 2015 11:22:54 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 128.240.234.22 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:106474 Archived-At: Stefan Monnier writes: >> I happen to prefer :load-path, since relying on Emacs' automated discovery >> takes longer than loading my entire init.el now. > > If you use ELPA and package-initialize to install your packages, > the load-path and the autoloads are already set and that time is > already "wasted". > > So are you saying that use-package is designed for the case where you > don't use ELPA? It is the impression I got when I looked at > use-package, but it seems like an odd position nowadays. I think a few examples might help. I do use use-package for that reason. For example this is my configuration for pabbrev. (use-my-package pabbrev :diminish (pabbrev-mode . "pab") :defer 5 :commands global-pabbrev-mode ;; pabbrev is useless until first idle anyway, and it's quite slow to load, ;; so might as well defer and init it later :config (progn (global-pabbrev-mode) ;; till we get org mode sorted out! (define-key pabbrev-mode-map [tab] 'pabbrev-expand-maybe) (setq pabbrev-idle-timer-verbose t) ;;(setq pabbrev-debug-display t) ;; the default anyway (setq pabbrev-debug-display nil) (setq pabbrev-read-only-error nil))) `use-my-package' is my own macro which expands to a valid `use-package' call with load-path set (based on the package name). I run my own packages without installing them via ELPA. This is good practice, because I can change the source, and test everything works. It's also poor practice because it means that I, as the author of the package, is not testing the environment that other people are getting. The recently fixed missing autoloads in omn-mode.el were a victim of this. But the rest of the config is valid. But this form of use is the exception. Here is a more normal example, for a well behaved package (with slightly less well behaved configuration). (use-package tex-site :ensure auctex :init ;; after latex because we add stuff to latex-mode-map (eval-after-load "latex" '(load "philtex.el"))) Here, we integrate tightly with ELPA. I synchronize my .emacs to several machines, and I do not want to have to install auctex by hand on all of them. `:ensure' achieves this. Other people use pallet or cask to achieve the same thing, but I like being able to embed the requirement for a package with the init statements ("philtex.el" will get moved into this form -- it's a hangover from my pre ELPA days). >>> IOW, in many cases, it would be better for people to report the problem as a >>> bug rather than to reach for use-package. >> The idea that use-package will never make it into core because "package >> authors should do things a better way" strikes me as a very odd argument. > > To be more precise, I don't think those problems in packages are > particularly frequent, so it's perfectly OK to report them in those rare > remaining cases. I would like to ask a more specific question. use-package is nice, but is more of a PITA to use than it should because because of a bootstrap problem which can only be fixed by putting it in core. What changes would you want to see before to it to make it acceptible in core? Obviously, this is assuming the authors agree, and copyright assignment, and all that jazz. Phil