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 ...
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 ...
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\\'" ...
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 ...
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
...
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 ...
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 ...
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 ...
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)
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
:...
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 (...
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-...
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 ...
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 ...
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
:...
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 "~/....
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 ...
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 ...
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
...
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 ...
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 ...
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-...
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
...
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.
...
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-...
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....
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 ...
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 ...
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)
)
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
:...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
use-package × 255package × 40
init-file × 39
key-bindings × 28
org-mode × 15
hooks × 12
autoload × 12
package-repositories × 9
install × 8
dired × 7
debugging × 6
spacemacs × 5
keymap × 5
error × 5
magit × 4
evil × 4
helm × 4
emacsclient × 4
major-mode × 4
projectile × 4
start-up × 4
ess × 4
lsp-mode × 4
require × 4
load × 4