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.
265
questions
0
votes
0
answers
37
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
16
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
38
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
28
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
34
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
53
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
18
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
205
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-...
0
votes
0
answers
41
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
36
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
18
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) ...
0
votes
1
answer
201
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
84
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
35
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
70
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
340
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
287
views
Set default face (font) with use-package ':custom-face'
What do I need to tell 'use-package' so that it will set the default font for all frames on Emacs startup?
With 'use-package' now installed as part of Emacs, I want to specify faces with its :custom-...
0
votes
0
answers
57
views
Emacs 29 - Error (use-package): rg/:catch: install not supported in nil
Here my init.el
(use-package rg
:ensure t
:ensure-system-package rg)
In Emacs 27 it's work just fine.
But I removed Emacs 27.1 and installed Emacs 29.1
And now when start Emacs 29.1 I get error:
⛔...
0
votes
0
answers
45
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
34
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
202
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
72
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
111
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
81
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
62
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
79
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
45
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
79
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
2k
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
245
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
57
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
65
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
92
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
465
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
99
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
110
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
160
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
124
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
74
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
21
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
1k
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
250
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
82
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
991
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 . ...
1
vote
1
answer
197
views
:config of use-package is not working for multiple cursors
I have noticed a weird behaviour with use-package for multiple-cursors when trying to customize insertion of numbers.
I am able to insert numbers on multiple cursors using C-c n using this code
;; ...
0
votes
1
answer
32
views
How to fix the installation of package clj-refactor?
I am using Emacs on a macOS Monterey 12.5 (M1 hardware). This is my config file.
I am trying to install a package called clj-refactor for Clojure development.
Following the instructions on the ...
0
votes
1
answer
59
views
use fork in use-package
Because of this issue I need to change the location of the sources of the auctex-latexmk package to use a fork. Unfortunately I can't find any way to specify the address of a fork in use-package. Do ...
0
votes
1
answer
43
views
Symbol's value as variable is void: company-transformers
I am trying to prevent company-mode from autocompleting numbers. I added the following to my init file.
(push (apply-partially #'cl-remove-if
(lambda (c) (string-match-p "\\`[0-9]...