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.

Filter by
Sorted by
Tagged with
20
votes
4answers
9k views

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 ...
15
votes
2answers
4k views

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. ...
14
votes
2answers
4k views

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 ...
13
votes
2answers
1k views

use-package - :init or :config

Is there any rule by which the user can determine whether the package configuration requires :init or :config?
9
votes
4answers
2k views

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 ...
9
votes
2answers
2k views

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 ...
9
votes
3answers
3k views

How can I defer loading elpy using use-package?

I've been updating all my use-package calls now that :idle is no longer a decent way to defer stuff. At the moment one of the biggest hits on my load time is elpy which loads a whole bunch of ...
8
votes
2answers
4k views

`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-...
8
votes
3answers
3k views

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 ...
7
votes
3answers
323 views

How do I edebug a function defined in a use-package block?

Here is a minimum working example to demonstrate the problem, you will need to have the use-package package installed: (use-package ido :config (progn (defun dummy/function () (...
7
votes
1answer
167 views

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 <package> :ensure t) But for some packages that doesn't work, such as ...
7
votes
1answer
1k views

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 ...
7
votes
1answer
608 views

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

I'm trying to add dired+ to my init.el with use-package but I can't seem to find the name of dired+ on any of the package repositories ( marmalade, melpa or elpa ). I'd been able to add dired+ after ...
7
votes
1answer
1k views

Emacs setup for LaTeX after (use-package) verse

How to make this configuration file work with use-package with regard to AucTeX, RefTeX and LaTeX. I usually write latex rahter than pure tex documents. Current Working Emacs Configuration (load "...
6
votes
2answers
414 views

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

When using use-package, is there a way to associate more than one file extension with a particular mode in one place instead of multiple locations? Case in point is that I would like to associate ...
6
votes
2answers
818 views

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?
6
votes
2answers
2k views

Managing packages using use-package

I have read that using use-package, one can manage installation of the packages from the init.el file. Is there any specific command for that ? Background: I'm planning to port my existing init.el to ...
6
votes
1answer
1k views

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 ...
6
votes
2answers
740 views

Bind f-key in use-package

How can I bind an f-key using jwiegley's use-package package? Any of these combinations produces an error: :bind ("f11" . multi-term) :bind (<f11> . multi-term) :bind ([f11] . multi-term) (...
6
votes
1answer
737 views

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

(use-package dired) complains: Debugger entered--Lisp error: (error "Package ‘dired-’ is unavailable") But I see others' emacs configurations do use (use-package dired), for example: https://github....
6
votes
1answer
381 views

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?
6
votes
1answer
485 views

How do I set use-package-always-pin?

Emacs noob here, I want to use melpa-stable whenever possible for my packages. use-package has an option for this, use-package-always-pin. By default package.el prefers melpa over melpa-stable due ...
5
votes
2answers
912 views

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 ...
5
votes
1answer
58 views

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 ...
5
votes
1answer
1k views

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-...
5
votes
1answer
864 views

Conflict between emmet-mode and yasnippet, same trigger key

I want to have both emmet-mode and yasnippet trigger with the same key C-return: in a html-mode buffer, C-return should first try yas-expand and then emmet-expand-line if no suitable snippet was found....
5
votes
1answer
1k views

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 (...
5
votes
0answers
2k views

Best practice for Emacs Helm setup after (use-package) verse [closed]

Just recently discovered use-package (a macro written by John Wiegley) that comes in handy if you want to avoid .emacs bankruptcy declaration and keep things tidy in your configuration dot file. ...
5
votes
0answers
85 views

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 ...
4
votes
1answer
795 views

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-...
4
votes
2answers
3k views

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 ...
4
votes
2answers
218 views

Dired+ hangs emacs in -no window mode

I have this in my init.el file: (use-package dired :init (progn ;; Details toggling is bound to "(" in `dired-mode' by default (setq diredp-hide-details-initially-flag nil)) :config ...
4
votes
1answer
7k views

Symbol's function definition is void: use-package

I am unable to get the darcula theme working. I have a tried moving (package-initialize) and (require 'package) but I am unable to get it working. Here is my init.el file. ;; Added by Package.el. ...
4
votes
1answer
55 views

initialization of bibtex package

When i ran the following code in just started emacs (with-temp-buffer (insert "@article{aaaa, author = {AAA}, title = {BBBB} }") (bibtex-mode) (bibtex-autokey-get-field "title")...
4
votes
1answer
278 views

Ensuring a minimum version with use-package

In my .emacs, I would like to ensure that the s package, version 1.10.0 or newer, is installed. If I use (use-package s :ensure t) it will not upgrade the installation on systems with older versions ...
4
votes
1answer
678 views

Setting projectile-keymap-prefix with use-package

I use persp-mode and projectile both of which are installed using the use-package package and both want to prefix their keymaps with C-c p. The projectile readme says that you can define a custom ...
4
votes
2answers
126 views

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 ...
4
votes
0answers
353 views

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 ...
3
votes
2answers
2k views

Use-package for a mode

it's not clear for me how should I set use-package to load a package when a mode is activated. I have read different things about :mode, :init :config and I am now confused. Could someone explains it ...
3
votes
1answer
1k views

use-package :defer t and add-hook

If I have something like: (use-package X :defer t (add-hook 'some-mode 'package-x-function)) Will that work as expected given that I set :defer t and the package doesn't have any "built-in" ...
3
votes
1answer
99 views

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

I have the following code in my init.el file: (use-package org-plus-contrib :ensure t :config (progn (require 'ox-extra) (ox-extras-activate '(ignore-headlines)))) The :ensure t ...
3
votes
1answer
53 views

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 ...
3
votes
1answer
127 views

“Dissasociate” auto-mode for specific files (in ESS)

I'd like to keep ess as automatic major mode for R files and everything else, except for Julia, for which I want to use julia-mode alone. However, I cannot find out how to "unbind" the file ...
3
votes
1answer
597 views

How do I access a package's info manual?

I installed magit, and it appears to have come with documentation I can access in info-mode: > cd ~/emacs.d/elpa > ls -1 magit-2.8.0/{dir,*.info*} magit-2.8.0/dir magit-2.8.0/magit.info magit-2....
3
votes
1answer
60 views

are there conflicts between use-package and a package's autoloads?

Do I have to worry about a package's built-in autoloads somehow conflicting with those implicitly defined by use-package? For example if I do :commands some-cmd but the package already had an autoload ...
3
votes
1answer
456 views

use-package :defer t and autoloads

My understanding is if that I use any of :commands, :bind, :bind*, :bind-keymap, :bind-keymap*, :mode, or :interpreter, then it will create a corresponding autoload and defer loading of the package ...
3
votes
1answer
100 views

Install packages automatically [duplicate]

I'm new to Emacs, and I'm storing my Emacs configuration in a GitHub repo. Whenever I move to a new computer, I want Emacs to install all packages I specify if they do not present on this computer. ...
3
votes
1answer
236 views

Use normal delete-region with backspace in markdown-mode

I would like to use the "normal" behaviour for <backspace> in markdown-mode. That is, instead of calling markdown-exdent-or-delete, I would like to call cua-delete-region. So I tried this ...
3
votes
0answers
512 views

error autoloading failed to define function when loading custom file

I recently decided rewrite my emacs configuration. I want to load my custom org configuration only in the case when I am opening a *.org file. Considering a minimalistic configuration of init.el (use-...
2
votes
1answer
2k views

void-function when loading ido-mode in Emacs24

I'm using Emacs 24.4.1 from Debian unstable and have added the lines from question "How do I switch buffers quickly?". However this results in an error message and I found no way to resolve it. I can ...