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.
269 questions
0
votes
0
answers
22
views
best practice for keybinding using use-package and evil
What is best practice to define keybindings using use-package and evil?
How is it possible – for example – to bind "M-j" to (evil-)escape?
0
votes
1
answer
45
views
Defining bindings for python(-ts)-mode fails mysteriously
Setting up bindings for Python Mode (and its Tree Sitter variant) with the following use-package form mysteriously fails:
(use-package python
:bind (:map python-mode-map
("C-x *&...
0
votes
2
answers
17
views
Packages - not all files loaded
I want to use the package gptel.el (but this is only an example, the error also occurs with a few other packages) after the installation via Melpa (incl. init.el: require ‘gptel) I try to execute e.g. ...
1
vote
1
answer
109
views
Autocompletion doesn't work and other quirks while setting up AUCTeX with use-package
I've been using Emacs + Spacemacs for writing my LaTeX documents (and some programming) for a long while. As a project for this weekend I'm trying to dig deeper into Emacs fundamentals and write my ...
0
votes
0
answers
8
views
Possible to use-package 'foo defer :config (foo-autoloaded-macro)?
I noticed (use-package polymode :defer t :config (define-hostmode …)) would load polymode on startup instead of deferring, which seems to be because define-hostmode is an autoloaded macro
;;;###...
0
votes
0
answers
32
views
How can I always pretty-print outputs in CIDER REPL and evaluation results?
I'm using CIDER on Emacs for Clojure development.
Whenever I execute the command cider-eval-sexp-at-point, I see the output in the Emacs mini-buffer. I can also see it in the *Messages* buffer (since ...
0
votes
1
answer
82
views
How can I install from GNU ELPA?
I'm trying to install cursor-undo on GNU ELPA, I just get:
Debugger entered--Lisp error: (error "Could not find package cursor-undo. Updating recip...")
error("Could not find package %...
0
votes
1
answer
39
views
Org-sidebar doesn't do what it's supposed to. Should I expect to get it to work?
I'm new to emacs.
I installed the package org-sidebar using (package! org-sidebar) and (use-package org-sidebar) in doom emacs. I then open org-sidebar-tree in my buffer.
According to the ...
0
votes
1
answer
39
views
How to write a condition in a (A . B) dotted pair in use-package key :bind data
For the configuration of vterm I have in my Emacs config a snippet like this:
(use-package vterm
:config
(setq vterm-shell "xonsh")
:bind (:map vterm-mode-map
(&...
0
votes
1
answer
127
views
Elpaca Configuration Not Cooperating
new user to GNU Emacs (installed Emacs 3 days ago). I had fun learning and configuring my Emacs experience using use-package so far. Everything was working smoothly.
I decided to switch to Elpaca as ...
0
votes
1
answer
38
views
how to map/remap `t <` or `t [` in calc?
In calc, t [ jumps to the beginning of the trail. But in a regular buffer, M-< jumps to the beginning. I'd like t < to do what t [ does now.
How can I do that in a use-package :bind declaration? ...
0
votes
2
answers
59
views
use-package :bind loads package when passed symbol but not variable
I'm using the built in use-package macro of GNU Emacs 29.4.
When I do
(use-package magit
:bind ("C-x g" . magit))
magit does not get loaded on emacs startup, as expected. But when I use ...
0
votes
0
answers
20
views
How to translate the fork keyword from straight.el to a melpa recipe?
Given the straight.el snippet below, I'm unable to make sense of the fork keyword in context of the melpa manual.
How should I translate this snippet in order to use-package install it, without ...
0
votes
2
answers
453
views
Can someone ELI5 elpaca?
I'm struggling to understand the place elpaca holds in the emacs ecosystem, and looking for an overview.
Is something elpaca-like a more-or-less necessary compromise in a vanilla-as-possible-yet-still-...
1
vote
0
answers
73
views
On startup `run-hooks: Cannot open load file: No such file or directory, emacs` for `emacs` package itself
Due to an misformed Makefile I deleted my ~/.config dir which contained all my Emacs setting under .config/emacs following XDG-sheme.
Luckily I had a backup of all my dotfiles so no big problem -- I ...
0
votes
1
answer
59
views
How to keybind an org-capture template with use-package?
Suppose I bound org-capture with C-c c and a tmp template with t:
(setq org-capture-templates
`(
("t" "tmp"
entry (file ,(concat captures-path "tmp.org"))...
1
vote
1
answer
21
views
How to bind a tag addition with a key?
I started using notmuch and I often use the trash tag to have emails sent to Maildir\mail-account-i\Trash through a script. When in search mode, I have to do +trash RET on a mail (or a set of mails) ...
1
vote
1
answer
299
views
Installing a package with `straight` fails with the error `"use-package: Unrecognized keyword: :straight"`
I have this
(defvar bootstrap-version)
(setq straight-repository-branch "develop") ; Need this for new org-contrib location
(let ((bootstrap-file
(expand-file-name "straight/...
0
votes
2
answers
137
views
before-save-hook not working with use-package and custom mode
I wrote a little derived mode for the kage shader language, it's derived from go-mode (syntax is the same). I also like to use gofmt, but it's just not loading the hook.
Here's the mode:
(define-...
3
votes
0
answers
20
views
How to switch between distributed and local development versions of a package?
I use the stable version of a package (0.7.0 of gptel) which is distributed on melpa-stable. I installed it via package.el and I configure it via a use-package. I want to be able to switch easily ...
0
votes
0
answers
41
views
Problem with undo-tree-visualizer keybindings
What I want
I use general, use-package and evil. I want to use evil keybindings in undo-tree-visualizer-mode to jump between nodes and branches using "j", "k", "h", "...
1
vote
0
answers
100
views
How to stop emacs from contacting melpa?
I have the following in my config:
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
(add-to-list 'package-archives '("gnu" ...
1
vote
1
answer
509
views
What steps should I take to troubleshoot use-package not loading packages
I'm using emacs 29.1 on Windows.
I have extracted the emacs folder to a corporate OneDrive.
I have a home folder set up with emacs-29.1\share\emacs\site-lisp\site-start.el
with (setenv "HOME"...
0
votes
0
answers
47
views
Delight install issues
I want use delight in my init.el but I encounter a problem.
Emacs can't install it.
The init.el file contain this line : (use-package delight).
But I get this issue : Error (use-package): Failed to ...
0
votes
1
answer
42
views
How can I get the old GNEVE to work?
I wanted to try GNEVE, the video editor for Emacs, but its code is from 2008;)
(use-package gneve :ensure t)
Debugger entered--Lisp error: (error "Loading file /home/b0ef/.emacs.d/straight/build/...
3
votes
3
answers
229
views
Binding a key in another package's yet undefined map in use-package?
I'm using use-package for my configuration in init.el.
How can I bind a key to a map that has not yet been defined?
As a specific example, I'm using the following configuration of
(use-package latex-...
1
vote
1
answer
88
views
Use 'mapcar' to build a hooks list; "wrong-type-argument listp lambda"
How can I write a mapping (e.g. a mapcar expression) to build the list for a use-package :hook clause?
I'm attempting to build the list in this :hook expression:
(use-package eglot
:hook (
(...
1
vote
1
answer
133
views
Splitting use-package declarations in literate config
Trying to clean up my configuration and make it more readable, but also
reduce load time from current time of about 13 seconds down to < 10.
Suppose I have a large use-package macro for a package ...
0
votes
0
answers
1k
views
Using (use-package ...) with Emacs 29+
I am using Emacs 29.1, which ships with use-package, and I want to install and load the MELPA bm package through the init file.
I am using the following test-init.el init file:
(defun my-packages ()
...
1
vote
1
answer
121
views
How to proper install and configure js2-mode via use-package declaration?
I am trying to install this package called js2-mode. This is part of my effort to follow this tutorial.
Package documentation and tutorial are using classic installation via package-install as follows:...
1
vote
1
answer
82
views
Strange issue with dired-subtree
This is my simple config:
(use-package dired-subtree
:ensure t
:bind (:map dired-mode-map
("<tab>" . dired-subtree-toggle)))
The first time the ...
0
votes
1
answer
99
views
use-package with builtin mode, such as display-time-mode
I'm trying to use the use-package method of organizing my Preferences.el file in Aquamacs. When I try to use use-package display-time-mode, I get the following error message.
Debugger entered--Lisp ...
0
votes
1
answer
55
views
Aquamacs hangs when refreshing package contents
I'm trying to use use-package in my Preferences.el file under Aquamacs 3.6. Every time I try to run Aquamacs with the following Preferences.el, Aquamacs hangs, usually indefinitely.
(require 'package)...
1
vote
1
answer
92
views
Override counsel-yank-pop binding with use-package
I would like to use the classic emacs yank-pop instead of counsel mode's counsel-yank-pop which is linked to M-y. I've tried unbinding and rebinding it, but it does not seem to work.
I setup counsel ...
0
votes
1
answer
3k
views
Why is getenv not working to read an environment variable in my macOS machine?
I am using macOS and vanilla Emacs.
In my .zshrc file I have the following:
export OPENAI_API_KEY=my-key
The setting of the environment variable works as expected on the terminal (iTerm2):
➜ echo $...
0
votes
1
answer
387
views
What is the difference between using "(use-package" and "(use-package!" with the exclamation mark by the end?
I have seen a new cool Emacs package called gptel. One of the ways to install it is using the use-package approach:
(use-package! gptel
:config
(setq! gptel-api-key "your key"))
However, ...
0
votes
1
answer
61
views
Using :init in use-package produces an error-like message
My .emacs file contains
(use-package mds
:commands mds mds-version
:init (mds))
That produces, in Messages, (Shell command failed with code 1 and no output).
If :init is replaced with :config that ...
0
votes
0
answers
76
views
Profiling org-capture and improving its performance
My org-capture takes about 6 seconds to open up on a reasonably powerful machine, and it becomes over a minute on a cheap laptop. I decided to profile the function and here's what it gave:
2423 ...
0
votes
0
answers
106
views
chatgpt-shell, could not find package
I'm trying to install chatgpt-shell, so I eval:
(use-package chatgpt-shell
:ensure t
:custom
((chatgpt-shell-openai-key
(lambda ()
(auth-source-pass-get 'secret "openai-key"))...
1
vote
1
answer
549
views
How can I disable a package or a group of packages without the require statement?
My entire Emacs configuration is in one file named "init.el". The folding and unfolding is achieved with the outshine package.
I would like to share my config with some of my colleagues and ...
1
vote
1
answer
118
views
How to skip confirmation with use-package :ensure?
I am trying to install Emacs vterm. Following its documentation, I added this to my init.el:
(use-package vterm
:ensure t)
I have made sure that the dependencies are installed in my system (...
0
votes
1
answer
121
views
How do I unbind the SPC key from a pdf-viewer window and use evil leader key instead?
How can I unbind the SPC keybinding from a pdf-view-mode window and use the evil leader key instead?
This is what I have currently:
(use-package pdf-tools
:ensure t
:config
(pdf-tools-...
1
vote
1
answer
207
views
In Dired, How to disable (or unmap) SPC from executing dired-next-line?
What I want:
While in dired, want to disable/unbind <SPC> from dired-next-line
Reason:
I use j or <C-n> to dired-next-line in dired,
I never use <SPC> as to go next line.
I use &...
0
votes
1
answer
153
views
Error when using helm setup with use-package
My current helm configuration is
(use-package helm
:bind (("M-x" . helm-M-x)
("C-x b" . helm-mini)
("C-x C-f" . helm-find-files)
("C-x C-...
0
votes
1
answer
78
views
Translate use-package syntax
I am not sure how to translate this use-package :commands syntax into a regular elisp init.el file.
(use-package languagetool
:commands (languagetool-check
languagetool-clear-suggestions
...
0
votes
1
answer
24
views
custom use-package keyword only initializing last form
My package deino is a fork of hydra, which allows me to create temporary keymaps; here it is being used along with my package prime:
With following macro:
(defmacro prime* (parent first-call key func &...
1
vote
1
answer
2k
views
Why can't I install package yaml-mode on my Emacs via use-package declaration?
I am trying to install a package called yaml-mode on my Emacs. Basically, a syntax highlighting for .yaml files. My current syntax highlighters do not have support for yaml files, apparently.
Hence, I ...
0
votes
1
answer
296
views
Use-package :bind-keymap with car as a form
As you can see below, trying to make a cons using a backquote and a colon to evaluate a form causes an error. Surely this is a tiny mistake, but Lisp is not my cup of tea.
Let's just jump to the code:
...
0
votes
0
answers
85
views
lsp-pyright defer init until a .py file is open
Hey guys i'm improving my startup, Emacs version 28.2.
I did a benchmark on init and I noticed that the thing that takes most of the time is lsp-pyright. That initializes lsp-mode.
But I don't ...
1
vote
1
answer
1k
views
Turn on minor mode rainbow-mode using use-package
I would like to turn on rainbow-mode in elisp and/or lisp modes when I am editing init.el using use-package. I've tried the following:
(use-package rainbow-mode
:demand t
:hook
((text-mode . ...