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

249 questions
38
votes
6 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
  • 485
  • 1
  • 4
  • 5
24
votes
2 answers

Difference between init and config in use-package

I have a configuration like this: (use-package html-mode :mode "\\.html\\'" :config (progn (add-hook 'html-mode-hook 'turn-off-auto-fill))) Now when I go and visit an HTML file, I observe that auto-fill is not turned off. But if I use…
Sibi
  • 3,603
  • 2
  • 22
  • 35
16
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
  • 437
  • 4
  • 8
16
votes
2 answers

Using package.el to install and update but use-package for loading and configuring

After recently learning about use-package I decided to port my configuration to it but found myself reluctant to give up the convenience of using package.el to install packages and keep them updated. I've found it a little tricky to combine…
Omar
  • 4,732
  • 1
  • 17
  • 32
14
votes
1 answer

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

I've wrote this, and it works: (use-package web-mode :ensure t :mode (("\\.php$" . web-mode) ("\\.html$" . web-mode)) :preface (defun dg/web-mode-hook()) :config (add-hook 'web-mode-hook 'dg/web-mode-hook)) It enables…
Daniele
  • 637
  • 1
  • 5
  • 14
14
votes
3 answers

Unbinding key using use-package

I'm trying unbind org-cycle-agenda-files which is set by default to C-' and C-,. My weapon of choice to do so is use-package package. On github.com/use-package/bind-key.el page I have found following lines: ;; To unbind a key within a keymap…
Empty_Mind
  • 1,341
  • 12
  • 27
13
votes
2 answers

error: Package `use-package-' is unavailable

I am starting to build up a .emacs file to be used as a development environment within Docker containers. I get this error when starting emacs-nox in a Docker container. Warning (initialization): An error occurred while loading…
learningemacs
  • 343
  • 1
  • 3
  • 11
13
votes
2 answers

`use-package` with :config to set variables

I'm trying to use use-package to set up my org-mode initialization. I have the following in my ~/.emacs file: (use-package org-mode :mode "\\.org$" :ensure org :config (progn (setq org-log-done 'time) (setq…
Ken Williams
  • 390
  • 2
  • 12
11
votes
3 answers

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

How can I ensure I'm downloading and using org-plus-contrib from the org-mode repository using require or use-package? Package.el downloads the package, compiles everything and then says it can't load org-plus-contrib. This thread on the mailing…
wdkrnls
  • 3,657
  • 2
  • 27
  • 46
11
votes
1 answer

Getting started `use-package` question

I was reading the use-package documentation, which says, "Here is the simplest use-package declaration:" ;; This is only needed once, near the top of the file (eval-when-compile ;; Following line is not needed if use-package.el is in ~/.emacs.d …
SparedWhisle
  • 569
  • 3
  • 13
11
votes
1 answer

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

use-package lets you automatically install packages by using the :ensure tag. You can do that as follows (use-package :ensure t) But for some packages that doesn't work, such as auctex. In those cases you can specify the package to…
LinFelix
  • 259
  • 2
  • 9
11
votes
1 answer

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

If my :config section is entirely wrapped in with-eval-after-load, is that equivalent to simply specifying an :after directive? That is, can I replace this: (use-package company-tern :config (with-eval-after-load 'company (add-to-list…
Jorge Israel Peña
  • 1,265
  • 9
  • 17
10
votes
3 answers

How to bind key in use-package

I added a section binding to my config, but one key doesn't work. :bind (("C-c a" . org-agenda) ("" . org-capture) ("" . org-insert-subheading)) These two keys (C-c a, f6) work as I expected. If I check the M-S-return…
dmin
  • 343
  • 2
  • 10
10
votes
1 answer

Use multiple `:mode` arguments with use-package

I'm trying out use-package - the docs say the argument to the :mode keyword "can be a cons cell, a list, or just a string." However, I'm not sure how to make a cons cell or list work. Here's an example: (use-package markdown-mode :mode (list…
Ken Williams
  • 390
  • 2
  • 12
10
votes
4 answers

How to bind your keys to keymaps that aren't loaded yet?

I use use-package to manage installed packages and bind-key to assign actions to custom keys that I like. I override most of the default Emacs keybinding (e.g. C-n becomes M-k, C-p becomes M-i), but I'm OK with other modes overriding my keybinding…
Mirzhan Irkegulov
  • 1,088
  • 1
  • 9
  • 16
1
2 3
16 17