Skip to main content

Questions tagged [use-package]

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
4 votes
1 answer
162 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")...
RCV's user avatar
  • 105
2 votes
1 answer
2k views

`use-package` errors with "failed to define function" message when loading a local copy of a package

I'm trying to modify the package ediprolog, which was installed and working before, with use-package, from ELPA. I copied the file from the elpa folder to a folder called ediprolog.el and used: (use-...
someonewithpc's user avatar
1 vote
3 answers
2k views

How can I remove the logo image in the dashboard package?

I'd like to remove the image of the Emacs cow from the startup screen, but I want to keep my recent files, bookmarks, and agenda. Currently, I'm using the dashboard package with use-package. My ...
SillyPointer's user avatar
1 vote
1 answer
347 views

use-package: How to defer loading a command when depending on other deferred packages?

I would like to autoload the command f-join from f.el using use-package. Note that the package f.el depends on the packages dash.el and s.el. Here is a minimal example: (setq debug-on-error t) (let ((...
Håkon Hægland's user avatar
2 votes
2 answers
2k views

How to properly define hydras inside use-package?

For example, I use undo-tree and have the following in my config file: (use-package undo-tree :ensure t :diminish (undo-tree-mode . "") :config (global-undo-tree-mode 1)) Now I want to use ...
Florian's user avatar
  • 241
1 vote
1 answer
864 views

Properly install ESS using use-package

I installed ESS using the following chuck of code: (use-package ess :init (require 'ess-site) :mode (("\\.[rR]\\'" . R-mode) ("\\.Rnw\\'" . Rnw-mode)) ) Everything works fine, however ...
Andrej's user avatar
  • 145
2 votes
2 answers
2k views

use-package :bind not working as expected

I frequently work with R and ess, and want to bind a shortcut to a function that clears the R console: (use-package ess-site :ensure ess :bind (:map inferior-ess-mode-map ("C-c c" . ...
Florian's user avatar
  • 241
2 votes
2 answers
128 views

Reordering declarations with use-package: Why does this work?

I'm reorganising my init.el a bit and I've realised that it contains the following set of use-package declarations: (simplified slightly) (use-package hasky-extensions :config (general-define-key ...
bradrn's user avatar
  • 153
2 votes
1 answer
5k views

Error (use-package): Cannot load magit

I am not sure if that is a problem on my site or more people are experiencing this. I thought at first that I broke something in my config file, but after loading by backup .emacs.d, the error is the ...
siery's user avatar
  • 241
0 votes
1 answer
163 views

Does `provide` conflict with `use-package`?

I just install use-package yesterday and still learning it. I notice use-package is not working in my environment: Here is my init file: (require 'package) (dolist (url '(("melpa" . "https://melpa....
ccQpein's user avatar
  • 123
4 votes
1 answer
3k views

How to set mode hook with lambda using use-package

I'm attempting to set the following hook using use-package, but it's not getting applied. Normal elisp: (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1))) Using use-package: (use-package org-...
retrodev's user avatar
  • 315
2 votes
1 answer
1k views

use-package won't load helm for projectile

I'm trying to use use-package to load projectile. Projectile uses helm for completion, which I'm also loading with use-package. Since projectile and helm have :bind sections I believe they're both ...
MikeTheTall's user avatar
0 votes
0 answers
203 views

package-install - not match

Window 10 (64 bit), Emacs 26.1 When in *scratch* buffer I run: M-x package-install multiple-cursors I get error No match But when I go to package manager I success found and install package ...
a_subscriber's user avatar
  • 4,224
4 votes
1 answer
1k 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 ...
Guilherme Salome's user avatar
1 vote
2 answers
986 views

Load package in dir-locals

Sorry, I'm new to emacs and I'm sure this is a very basic question. For my personal projects I prefer spaces for indentation, whereas work requires smart-tabs (tabs for indentation, spaces for ...
Steve Lorimer's user avatar
3 votes
1 answer
165 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 ...
siery's user avatar
  • 241
5 votes
1 answer
124 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 ...
aplaice's user avatar
  • 2,216
0 votes
0 answers
388 views

"No such file or directory, bind-key" after installing use-package [duplicate]

I'm using Emacs on Windows 10. I want to override key bindings, so after reading How to override major mode bindings, I installed use-package with the built-in package manager (via M-x package-install ...
user19551's user avatar
  • 101
1 vote
1 answer
2k views

use-package and package-initialize problem with emacs27

I'm having quite a bit of trouble getting use-package to automatically install packages in emacs27 I deleted a package using package-delete and restarted emacs. On emacs26, use-package would ...
Chakravarthy Raghunandan's user avatar
8 votes
1 answer
6k 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 ...
azzamsa's user avatar
  • 644
11 votes
1 answer
1k 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 ...
LinFelix's user avatar
  • 259
9 votes
1 answer
2k 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 ...
Fabman's user avatar
  • 588
14 votes
1 answer
9k 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-...
Daniele's user avatar
  • 677
3 votes
1 answer
4k views

Error (use-package): Failed to install magit: Package `magit-' 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. Error (use-package): Failed to ...
learningemacs's user avatar
14 votes
2 answers
14k 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 ...
learningemacs's user avatar
17 votes
2 answers
4k views

use-package - :init or :config

Is there any rule by which the user can determine whether the package configuration requires :init or :config?
rchar01's user avatar
  • 447
2 votes
1 answer
536 views

Load all function with use-package

How to load all function in package with use-package ? I modified crux package, and make my own simple-crux.el Inside simple-crux.el, say I have function foo, bar and baz. when I use (use-package ...
azzamsa's user avatar
  • 644
0 votes
1 answer
213 views

ztree - use-package key bindings

I tried to set key bindings to ztree (dir and diff), but they are not working after the emacs startup (there is no errors). f8 and C-f8 works but not the navigation keys. Pleas help. When I eval my ...
rchar01's user avatar
  • 447
4 votes
1 answer
319 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 ...
phipsgabler's user avatar
1 vote
1 answer
2k views

Unable to bind SPC as a prefix in general (evil mode)

My setup worked perfectly fine, however I recently reinstalled Emacs and therefore updated all packages as well when starting for the first time. Since then I cant get rid of the warning/error: ...
ghhost's user avatar
  • 13
3 votes
1 answer
211 views

How should I test that autoloads work properly with package.el?

I've added some autoloads to PACKAGE with the ;;;###autoload cookie and I've run M-x update-directory-autoloads which generated PACKAGE-autoloads.el. I have the following form in my init: (package-...
Sean Allred's user avatar
  • 7,051
2 votes
1 answer
590 views

How do I hide markup in Markdown mode with use-package?

I'd like to hide the markup in my Markdown buffers. I can do that manually using markdown-toggle-markup-hiding. However I'd like to configure this once and for all in my init.el so that I don't have ...
Debajit's user avatar
  • 298
2 votes
1 answer
2k views

How do I use use-package with diminish in my init.el?

It looks like use-package recently made a change and diminish is its own package. How do I install diminish which is its own package now? Here is what the top of my init.el looks like: ;; Save ...
Debajit's user avatar
  • 298
3 votes
2 answers
1k views

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). (...
MLister's user avatar
  • 215
1 vote
0 answers
687 views

How to use use-package's :bind to bind key-chords

(use-package whatever :bind (("C-a b" . aabb))) can be used to replace (global-set-key (kbd "C-a b" 'aabb)) Can use-package's :bind be used to replace (key-chord-define-global "ab" 'aabb) ?
jacg's user avatar
  • 345
0 votes
1 answer
2k views

How do I bind keys using general.el alongside evil?

My goal is to bind SPC SPC to counsel-M-x. I've tried using this snippet from this post (use-package general :ensure t :config (general-evil-setup t) (general-define-key :states '(normal visual ...
greyowl's user avatar
  • 121
3 votes
2 answers
667 views

How can I set my Flycheck Perl include path?

I am using Flycheck using use-package like so: (use-package flycheck :ensure t :init (global-flycheck-mode)) I followed https://randstructure.wordpress.com/2015/06/21/using-emacs-flycheck-with-...
nc.'s user avatar
  • 171
3 votes
1 answer
3k views

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

I'm trying to move from el-get to use-package. I am having trouble with smart-mode-line-powerline-theme. Emacs complains at startup time with (error "Unable to find theme file for ‘smart-mode-line-...
jacg's user avatar
  • 345
0 votes
2 answers
79 views

How can a use-package stanza be configured a setting depending on another package's existence?

I have this magit configuration which automatically sets the magit commit message buffer to evil INSERT mode, but it assumes that evil is installed and active which may not be the case. How can I ...
vfclists's user avatar
  • 1,471
7 votes
0 answers
6k 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. ...
doctorate's user avatar
  • 1,869
8 votes
1 answer
5k 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 "...
doctorate's user avatar
  • 1,869
4 votes
2 answers
333 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 ...
SFbay007's user avatar
  • 584
6 votes
3 answers
2k views

use-package: load all defined packages

I use use-package to defer package loading. This is useful in emacs standalone mode. I additional run emacs in daemon mode (emacs --daemon), then this behavior is not desired. Is there a way to load ...
jue's user avatar
  • 4,686
1 vote
2 answers
1k views

use-package does not execute `:config`

When loading auto-complete via auto-complete-config with use-package, then :config is not executed and local keymap is not set. (See example below) Why that and how to solve this? Example: save ...
jue's user avatar
  • 4,686
1 vote
1 answer
1k views

use-package and auto-complete, howto?

How to use auto-complete with use-package and have auto-complete loaded later? Following config is working, but how to get rid of the defer 2? (use-package auto-complete-config :defer 2 :...
jue's user avatar
  • 4,686
0 votes
1 answer
276 views

Why is my use-package not installing packages properly? (Using org-mode init file and babel)

I'm new to emacs and I'm trying to setup my init file using a .org file with org-babel-load-file. I've read that it's a good idea to use package use-package to configure packages and to make sure they ...
Matheus Hemerly Risso's user avatar
1 vote
2 answers
469 views

why is add-hook in use-package not erroring for function that does not exist

I have added a (add-hook 'js2-mode-hook 'my-js2-mode-setup) the following hook to a use-package init section: (use-package js2-mode :ensure t :interpreter (("node" . js2-mode)) :mode "\\.\\(js\\...
dagda1's user avatar
  • 615
0 votes
1 answer
171 views

Json-Mode / Puppet-Mode unset common functions when installed with use-package

I'm facing a weird issue in my init.el. Installing packages such as json-mode or puppet-mode (from MELPA Stable) with use-package unsets common functions like forward-word or backward-kill-word. The ...
JacksGT's user avatar
  • 393
4 votes
2 answers
252 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 ...
SmartyLisp's user avatar
0 votes
1 answer
704 views

I cannot type left open bracket into buffer

I have a very weird problem, I cannot type left open bracket character ([) into any buffer. Bracket itself is recognized when I: type anywhere outside emacs type in minibuffer use it as part of ...
tlegutko's user avatar
  • 356