help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: using use-package


From: Phillip Lord
Subject: Re: using use-package
Date: Tue, 11 Aug 2015 21:42:41 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Sebastien Vauban <address@hidden> writes:

> address@hidden (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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]