[Top][All Lists]

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

Re: use-package.el -> Emacs core

From: John Wiegley
Subject: Re: use-package.el -> Emacs core
Date: Mon, 09 Nov 2015 16:31:24 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin)

>>>>> Dmitry Gutov <address@hidden> writes:

> Will it add a different way to install packages? Is that wise?

> Were it only up to me, I'd just incorporate the features that work well with
> package.el.

No, it does not install packages. There is a keyword, :ensure, which causes it
to use package.el to install a configured package if it is not already

`use-package' is a macro to abstract a common pattern among .emacs files, such

    (add-hook 'foo-init-hook 'some-function)
    (add-to-list 'auto-mode-alist '("\\.foo$" . foo-mode))
    (eval-after-load "foo-mode"
         (define-key foo-mode-map (kbd "C-c k") 'foo-hello)))

It abstracts the common cases I encountered in my use of 100+ Emacs packages,
and macroexpands to code that tries to minimize Emacs load time as much as
possible. It also adds features that would be cumbersome to do manually, such
as optionally installing an idle-timer so a package is always loaded if Emacs
has been idle for X seconds.

    (use-package foo-mode
      :mode "\\.foo$"
      :bind (:map foo-mode-map
             ("C-c k" . foo-hello))
      :init (add-hook 'foo-init-hook 'some-function))

There is a README with examples at:


I also discuss it with Sacha Chua in a video:



reply via email to

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