40 votes
Accepted

How to update packages installed with use-package

I just do this manually: run list-packages hit Uto mark available upgrades, then review to decide if there are any I don't want to pick up. Then x to upgrade. I do this pretty regularly, and often ...
glucas's user avatar
  • 20.4k
26 votes
Accepted

`use-package` with :config to set variables

The below would work. For the sake of clarity, I am using :ensure org-plus-contrib which deviates a bit from the example in your question. (use-package org :mode (("\\.org$" . org-mode)) :ensure ...
Kaushal Modi's user avatar
  • 25.4k
22 votes
Accepted

Use multiple `:mode` arguments with use-package

The right way to do it would be (use-package markdown-mode :mode ("\\.markdown\\'" "\\.md\\'")) or (use-package markdown-mode :mode (("\\.markdown\\'" . markdown-mode) ("\\.md\\'" ...
Kaushal Modi's user avatar
  • 25.4k
19 votes

org-plus-contrib and org with `require` or `use-package`

The correct way to do this with use-package is as follows: (use-package org :ensure org-plus-contrib ... The first argument makes sure that it is the org.el file being sourced. The :ensure ...
Spencer's user avatar
  • 291
18 votes

How to update packages installed with use-package

You can use auto-package-update to automatically update packages. Copied from my other post (https://emacs.stackexchange.com/a/31903/9972) (use-package auto-package-update :ensure t :config ...
cslux's user avatar
  • 421
18 votes
Accepted

use-package - :init or :config

Is there any rule by which the user can determine whether the package configuration requires :init or :config? There is no general rule which applies to all settings and packages; you just need to ...
Basil's user avatar
  • 12.2k
17 votes
Accepted

Unbinding key using use-package

If you C-h f and enter unbind-key, the help says: unbind-key is an autoloaded Lisp macro in `bind-key.el'. (unbind-key KEY-NAME &optional KEYMAP) Not documented. The second argument ...
Greg Hendershott's user avatar
17 votes
Accepted

When to specify a package name in use-package's :ensure tag?

But for some packages that doesn't work. Such as auctex. The reason (use-package tex :ensure t) doesn't work for auctex is because auctex names a GNU ELPA package (see (emacs) Packages), whereas tex ...
Basil's user avatar
  • 12.2k
15 votes

How to associate more than one file extension with a given mode in `use-package`

The following should work: (use-package js2-mode :mode (("\\.js\\'" . js2-mode) ("\\.jsx\\'" . js2-mode)) ... :ensure t)
scatotonic's user avatar
15 votes

How to avail of `:hook` using use-package?

As others said I think https://github.com/jwiegley/use-package#hooks is pretty clear. :hook replaces add-hook and creates autoloads for you. Your example with :hook would be: (use-package web-mode :...
dakra's user avatar
  • 406
15 votes

Getting started `use-package` question

Do I need (package-initialize) before these lines? If your version of Emacs (M-xemacs-versionRET) is older than 27, and you are using the built-in package manager, then you indeed need to call (...
Basil's user avatar
  • 12.2k
14 votes

Does use-package keep packages automatically updated?

I use auto-package-update to automatically update packages. (use-package auto-package-update :ensure t :config (setq auto-package-update-delete-old-versions t auto-package-update-...
cslux's user avatar
  • 421
14 votes
Accepted

error: Package `use-package-' is unavailable

This particular error happens if Emacs failed looking up the latest version of a package, like if there's no package-archives file containing that information. Before installing packages, make sure ...
wasamasa's user avatar
  • 22k
14 votes
Accepted

How to bind key in use-package

Thank you for telling me about the different types of maps. The issue is as @NickD pointed out in their answer and the example use-package code puts all the bindings into the global map. ie org-mode ...
dmin's user avatar
  • 343
11 votes
Accepted

Activate global minor modes from use-package

I don't know why company-mode is getting diminished, but I think I know what's going on with whitespace-mode. Your block (use-package whitespace :ensure t ;; I also tried without this line :...
Aaron Harris's user avatar
  • 2,674
11 votes
Accepted

Is it possible to load Dired+ automatically with use-package?

dired+ has left MELPA repository, and now you have to download it manually from EmacsWiki. You can still use use-package with a downloaded package, like this: (use-package dired+ :load-path "~/....
Jesse's user avatar
  • 1,994
10 votes
Accepted

How to associate more than one file extension with a given mode in `use-package`

Use :mode "\\.jsx?\\'" Remember: all those backslashes are there because it's a regexp, so you really want to take advantage of it when you can, otherwise you're just suffering through those ...
Stefan's user avatar
  • 26.3k
10 votes
Accepted

Why doesn't (use-package dired) work for me?

Debugger entered--Lisp error: (error "Package ‘dired-’ is unavailable") You get this error when package.el tries to install a non-existent package. use-package will attempt to install the given ...
npostavs's user avatar
  • 9,083
10 votes
Accepted

use-package won't load

You may need a more complete "bootstrap" of use-pacakge. This is what I've picked up from somewhere else on SE. ;;{{{ Set up package and use-package (require 'package) (add-to-list 'package-archives ...
nega's user avatar
  • 3,176
9 votes

Interaction between package, use-package, and quelpa

While quelpa and use-package have no direct relation with each other, there now is a package, quelpa-use-package, which adds a quelpa handler to use-package. This allows one to use use-package with a ...
ack's user avatar
  • 191
9 votes

Use-package for a mode

As the README will tell you, the :mode keyword allows you to define a deferred binding (i.e. on-demand), which will load the package when visiting a buffer which filename matches the expression you ...
ngqrl's user avatar
  • 89
9 votes

error: Package `use-package-' is unavailable

I am adding this answer as suggested by @Drew. I appreciate the answer from @wasamasa which allowed me to get this working in my .emacs file. Here is how I modified my .emacs file. (package-...
learningemacs's user avatar
8 votes
Accepted

Emacs setup for LaTeX after (use-package) verse

The essential part is to load latex instead of tex, see the first line. (also I did some small cleanups) (use-package latex :mode ("\\.tex\\'" . latex-mode) :bind (:map LaTeX-mode-map ...
jue's user avatar
  • 4,501
8 votes
Accepted

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

It is not packages that use-package loads but features (which are things you can require and test for with featurep). From this point of view, use-package is essentially a fancy wrapper for require. ...
Fran Burstall's user avatar
7 votes
Accepted

use-package: Can :after be used instead of with-eval-after-load?

Yes, I believe those are equivalent. If there's additional configuration outside of with-eval-after-load, then switching to use :after should be semantically equivalent to moving them inside the with-...
Aaron Harris's user avatar
  • 2,674
7 votes
Accepted

Install ESS with use-package

I was missing ':ensure t . Now the ess package gets automatically installed at first use. For more information on how to load packages from ELPA with package.el and use-package see: https://github....
user14419's user avatar
  • 195
7 votes
Accepted

Does use-package keep packages automatically updated?

The :ensure option in use-package does not automatically keep packages up to date. It ensures that the package is installed. This might be useful if you pull your Emacs config on to a new machine (or ...
glucas's user avatar
  • 20.4k
7 votes
Accepted

use-package: load all defined packages

Take a look at the customization options available for use-package. I think you can set use-package-always-demand based on how Emacs was started to get the behavior you want. For example at the ...
glucas's user avatar
  • 20.4k
7 votes
Accepted

How to install smart-mode-line powerline theme with use-package

have you tried that for example: (use-package smart-mode-line-powerline-theme :ensure t :after powerline :after smart-mode-line :config (sml/setup) (sml/apply-theme 'powerline) )
slemaguer's user avatar
  • 369
7 votes
Accepted

use-package ensure not working: package downloaded but gives warning and skips config

The symbol you must give use-package is not the name of the package, but the name of a feature provided by the package. org-plus-contrib provides the org feature. You should use (use-package org :...
Omar's user avatar
  • 4,742

Only top scored, non community-wiki answers of a minimum length are eligible