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:42:41 +0100 Message-ID: <87r3n9o8u6.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> <86h9o6kwqc.fsf@example.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1439325791 19217 80.91.229.3 (11 Aug 2015 20:43:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 11 Aug 2015 20:43:11 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Sebastien Vauban Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Aug 11 22:43:03 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 1ZPGNy-0006hr-Fa for geh-help-gnu-emacs@m.gmane.org; Tue, 11 Aug 2015 22:43:02 +0200 Original-Received: from localhost ([::1]:35826 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPGNx-0000ch-Mr for geh-help-gnu-emacs@m.gmane.org; Tue, 11 Aug 2015 16:43:01 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45435) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPGNm-0000bh-HP for help-gnu-emacs@gnu.org; Tue, 11 Aug 2015 16:42:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZPGNh-0001TB-Gy for help-gnu-emacs@gnu.org; Tue, 11 Aug 2015 16:42:50 -0400 Original-Received: from cheviot12.ncl.ac.uk ([128.240.234.12]:54785) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPGNh-0001T4-9u for help-gnu-emacs@gnu.org; Tue, 11 Aug 2015 16:42:45 -0400 Original-Received: from smtpauth-vm.ncl.ac.uk ([10.8.233.129] helo=smtpauth.ncl.ac.uk) by cheviot12.ncl.ac.uk with esmtp (Exim 4.63) (envelope-from ) id 1ZPGNg-0005Dn-Az; Tue, 11 Aug 2015 21:42:44 +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 1ZPGNf-0006uh-Cs; Tue, 11 Aug 2015 21:42:43 +0100 In-Reply-To: <86h9o6kwqc.fsf@example.com> (Sebastien Vauban's message of "Tue, 11 Aug 2015 11:20:11 +0200") 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.12 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:106476 Archived-At: Sebastien Vauban writes: > phillip.lord@russet.org.uk (Phillip Lord) writes: > > Just wanted to share how I do *some* of the above points in my config > file. Here an example for `diff-hl', which indicates changes in the > fringe: > > > (with-eval-after-load "diff-hl-autoloads" > > (idle-require 'diff-hl)) > > (with-eval-after-load "diff-hl" > > (global-diff-hl-mode) > > (define-key diff-hl-mode-map (kbd "C-x v >") 'diff-hl-next-hunk) > (define-key diff-hl-mode-map (kbd "C-x v <") 'diff-hl-previous-hunk)) This is pretty much what use-package does actually. It's an odd package, in that the main entry point is a macro. Nowadays, it's even needed at runtime iff you compile your .emacs. > > (with-eval-after-load "diff-hl-autoloads-XXX" ; Diff-hl won't be req'ed > > (idle-require 'diff-hl)) > > > Of course, I miss, for example, the real execution time of that block, > once executed/loaded (and you can't advice a macro such as > `with-eval-after-load', right, to add timings?). I don't think so, no. It's easy to write a new macro which adds these timings and expands to `with-eval-after-load' > And I do have all ELPA paths in `load-path' unlike John (IIUC), though > I don't understand yet how it works (differently) with `use-package'. I haven't checked how ELPA load-paths work. Unlike John, though, I don't sync my ELPA directory; actually I tend to delete it periodically. My .emacs auto-installs any packages I need. Phil