Questions tagged [use-package]

is a macro package to isolate Emacs configuration lines in the init file. By isolating related lines, the configuration performs better and is easier to maintain.

use-package is the name of a package and the name of a macro that it provides. This macro is used in the to configure packages using deferred and delayed loading to speed the start up of Emacs. use-package also consolidates configuration steps before and after loading a package. It is also used to consolidate to minimize overlaps and conflicts.

Useful Links

258 questions
41
votes
7 answers

How to update packages installed with use-package

I'm using use-package to install and configure packages (most of these packages are in melpa). Is there a clean automated way of keeping all these packages up-to-date ? If not, what is the best work flow in this case ? Note: A very similar question…
Jaagrit Sapana
  • 515
  • 1
  • 4
  • 5
17
votes
2 answers

use-package - :init or :config

Is there any rule by which the user can determine whether the package configuration requires :init or :config?
rchar01
  • 447
  • 4
  • 8
10
votes
1 answer

How to use use-package with built-in packages?

For the sake of tidiness, I'd like to group setq(s) under single, related banner. Let's say I want to set the value of compilation-scroll-output in "compilation" unit like this: (use-package compilation :init (progn (setq…
jacekmigacz
  • 202
  • 3
  • 9
7
votes
1 answer

when to use defer in use-package?

Quoting from use-package If you aren't using :commands, :bind, :bind*, :bind-keymap, :bind-keymap*, :mode, or :interpreter (all of which imply :defer; see the docstring for use-package for a brief description of each), you can still defer loading…
azzamsa
  • 634
  • 7
  • 16
7
votes
2 answers

Does use-package keep packages automatically updated?

I'm using use-package in my init.el for all my package installations and configuration. I thought specifying :ensure t in use-package would make sure I always have the latest versions installed. But when I did M-x package-list-packages the…
Mikael Springer
  • 513
  • 3
  • 13
6
votes
2 answers

use-package :requires explanation

I found that there's a :requires (source) section, but I'm not quite sure what it does and there doesn't seem to be any documentation on it. Can someone explain what it does?
Jorge Israel Peña
  • 1,265
  • 9
  • 17
6
votes
2 answers

What is the standard way to install an elisp package?

I'm interested in trying out the features of the htmlize.el package that I read about here. The article does not explain how I can import it into emacs. What is the best way to do this?
Brian Fitzpatrick
  • 2,325
  • 1
  • 20
  • 42
5
votes
1 answer

How to use `use-package` when the package and associated feature are named differently?

What use-package declaration should one use when the name of the package (as present in MELPA or GNU ELPA) and the name of the main feature provided by that package are different? For instance wanderlust provides the feature wl rather than…
aplaice
  • 2,176
  • 18
  • 24
5
votes
0 answers

use-package's :after directive

I saw that use-package has an :after section that can be used, which: Defer loading of a package until after any of the named features are loaded. The wording uses "any" instead of "all", so would that mean that if I set something like :after one…
Jorge Israel Peña
  • 1,265
  • 9
  • 17
4
votes
1 answer

Why does use-package considers "emacs" as a package?

In the use-package documentation https://github.com/jwiegley/use-package#diminishing-and-delighting-minor-modes there is an example that considers emacs as a package(i.e (use-package emacs)) Usually the installed packages reside in the subdirectory…
Talespin_Kit
  • 445
  • 2
  • 11
4
votes
2 answers

Dynamic package name with use-package

How can I call use-package with a variable as the package name? Something like: (setq my-pkg "magit") (use-package my-pkg :ensure t) It would be, for example, used in a mapc call. I tried functions like intern or make-symbol but I did not…
SmartyLisp
  • 117
  • 1
  • 6
4
votes
1 answer

Activate global minor modes from use-package

I used global-company-mode from my .emacs like this: (add-hook 'after-init-hook 'global-company-mode) Now I’m trying to move to use-package, like this: (use-package company :config (global-company-mode)) Now if I check with C-h m, company-mode…
GergelyPolonkai
  • 758
  • 6
  • 12
3
votes
1 answer

Why do I get free variable warnings with use-package?

I have, for instance, this in my .emacs: (use-package company :bind (("M-RET" . company-complete)) :demand ; load it now (better for eglot) :config (global-company-mode) (setq company-backends '(company-capf…
GaryO
  • 496
  • 2
  • 17
3
votes
1 answer

Ensuring binary packages with use-package

I just started organizing my packages with use-package because I need the simple transition between few computers. I use few binary programs asynchronously, and been therefor searching for solution that lets me maintain them along Emacs packages. It…
siery
  • 241
  • 2
  • 13
3
votes
2 answers

Rewrite a package config using use-package

I installed a package called persp-mode using package-install, and the package docs recommend the following configs in the user-init-file (the last two lines are mine, but they work as expected). (with-eval-after-load "persp-mode-autoloads" (setq…
MLister
  • 215
  • 2
  • 8
1
2 3