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
2
votes
1answer
120 views

Why does use-package considers “emacs” as a package?

In the use-package documentation https://github.com/jwiegley/use-package#diminishing-and-delighting-minor-modes there is an example that considers emacs as a package(i.e (use-package emacs)) Usually ...
1
vote
1answer
111 views

Remap lsp-mode prefix with use-package

How do I remap the lsp-mode prefix key to "s-k" using the use-package package? I tried the following (use-package lsp-mode :ensure t :init (setq lsp-keymap-prefix (kbd "s-k") ...
1
vote
2answers
38 views

how to extract options I saved with customize and insert it inside use-package lines?

Suppose I did some customization through M-x customize-mode or something similar '(org-agenda-custom-commands '(("n" "Agenda and all TODOs" ((agenda "" nil) ...
1
vote
2answers
88 views

Is there a better way of writing this with use-package?

I feel like there is a better way of writing this with use-package but I just can't get the usual way to work. (use-package eshell :hook (eshell-mode . (lambda () (define-key ...
0
votes
0answers
15 views

Error when activating org-mode unless speedbar loaded first

Whenever I open an org file before the speedbar package is loaded, org-mode produces the following error: Symbol’s function definition is void: speedbar-add-supported-extension The error above is ...
0
votes
1answer
55 views

Byte compilation error with use-package

The beginning of my ~/.emacs.d/init.el file looks like this: ;; MELPA (require 'package) (setq package-enable-at-startup nil) (setq package-check-signature nil) (add-to-list 'package-archives '("...
4
votes
3answers
462 views

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) ("<f6>" . org-capture) ("<M-S-return>" . org-...
1
vote
1answer
53 views

use-package and dependencies

Given a major mode package foo and foo-x that extends foo, with feature x is there a recommended way to configure them with use-package (assuming :defer t and :ensure t for all? nested use-package (...
0
votes
1answer
31 views

Dired ranger not working loading it with use-package

I added the package dired-ranger using use-package, but when I open a folder with dired C-x d , I see the regular single panel instead of the two or three panels from dired-ranger. I'm loading the ...
1
vote
1answer
71 views

Adding a lambda function as hook in use-package

I'm trying to adapt this answer to use-package elegantly. It requires that I hook a lambda function to python-mode. I came up with this solution — which works: (use-package python :hook (python-...
1
vote
0answers
36 views

Manually installed pdf-tools breaks package handling because it is not recognized as a dependency

The situation is: I install pdf-tools manually and load it with the following snippet: (use-package pdf-tools :pin manual :load-path "my/load/path/to/the/git/repo/lisp" :config .......
2
votes
1answer
83 views

converting c-mode hooks to use-package fails in non-obvious ways

Emacs version 26.3 on a mac I have this (simplified) c(c)-mode config: (add-hook 'c-mode-common-hook '(lambda () (c-set-style "bsd"))) which works when I visit a c file. When I ...
0
votes
0answers
53 views

use-package and straight.el: can't load a package that exists locally?

I'm using the awesome use-package and the awesome straight.el to manage packages. I'd like to use xahk-mode. I've checked in the 'repos' directory of straight and I can see a folder named xahk-mode ...
10
votes
1answer
465 views

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 ...
1
vote
1answer
45 views

Does `use-package` reduce startup time? If so, how?

My understanding of Emacs's package management is that Emacs automatically loads all installed packages. use-package itself is a package, which only becomes usable after (package-initialize), at ...
1
vote
1answer
57 views

Unable to install Eclim for Eclipse in emacs

$ sudo apt install eclipse eclipse-jdt Then, tried to install eclim using use-package in Emacs: (use-package eclim :ensure t :config (require 'eclim) (setq eclimd-autostart t) (defun ...
1
vote
1answer
72 views

Problem with use-package and matlab-mode - cannot load

I am trying to use the matlab-mode package with use-package. in my init.el: (use-package matlab-mode :ensure t :config (add-to-list 'auto-mode-alist '("\\.m\\'" . matlab-mode)) (setq ...
0
votes
1answer
57 views

use-package: autoload function outside the main package file

I am trying to install simplenote2 to read my org files on my phone. The official setup method is: (require 'simplenote2) (setq simplenote2-email "email@example.com") (setq simplenote2-password "...
5
votes
1answer
107 views

change use-package indentation

I'd like to change use-package's indentation style to look more distinguishable, (more or less) similar like the following indentation style: (use-package foo :commands (gah) :init (setq f 1) ...
0
votes
0answers
93 views

use-package deferred loading for extensions not in :mode

When moving to use-package, I'd to replace (require 'markdown-mode) (add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode)) with (use-package markdown-mode :mode "\\.md\\'" :config ... ) ...
1
vote
1answer
61 views

fetching elisp library from url

I am using use-package in my .emacs and it is great. However occasionally I want to use a 3-rd party code which is not in [M]ELPA. Of course, I can download it but then I will need to maintain a copy ...
2
votes
1answer
167 views

`use-package` and `define-key`

I'm using multiple-cursors, setting it up with use-package. By default, when multiple-cursors mode is enabled, <return> is bound to multiple-cursors-mode. I'm trying to override that adding this ...
0
votes
0answers
19 views

Prevent el-get updates

use-package package does not deal with packages on EmacsWiki. Therefore in my init file I added el-get too: (use-package el-get :config (el-get-emacswiki-build-local-recipes)) (el-get-bundle dired+...
0
votes
0answers
21 views

Using el-patch on a helper library of package

I am using the dashboard package which allows you to either use your own .png image on your splash page or makes you pick from a set of ascii logos. For some reason, it doesn't allow you to choose ...
2
votes
1answer
126 views

Why do I get free variable warnings with use-package?

I have, for instance, this in my .emacs: (use-package company :bind (("M-RET" . company-complete)) :demand ; load it now (better for eglot) :config (global-...
0
votes
1answer
121 views

Avoid installing package to “.emacs.d/elpa/” directory

I install yasnippet from the repository using the package manager and I add the corresponding directory to the load path before (use-package yasnippet): ;; Add all subdirs in site-lisp to the ...
0
votes
1answer
104 views

Is there a clean way to splice some args to an existing Lisp macro?

I have the following non-working elisp code: (use-package eglot ;; For debug/testing, load local copy of eglot if it exists ,@(if (file-directory-p (concat user-emacs-directory "/...
1
vote
1answer
94 views

configure packages without`provide` with `use-package`

How to configure packages, which have no (provide <PACKAGENAME>) call in their source code? Immediate problem: configure isearch with use-package. (Editing isearch.el is not an option because ...
0
votes
1answer
226 views

Integrating org-download with org-journal; images do not download

I have org-journal entries which I'd like to link to images that are also stored alongside them in the filesystem. Ideally this would happen automatically when an image is dragged-and-dropped on the ...
1
vote
0answers
223 views

use-package org-mode :hook is being ignored

I'm currently running this version of Emacs: GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.7) of 2019-04-11, modified by Debian I'm attempting to use use-package to configure the ...
0
votes
3answers
614 views

use-package can't load package at startup

When I start Emacs I get the error message Error (use-package): Cannot load counsel But when I open init.el in a buffer and run eval-buffer everything works fine. What I'm doing wrong? My Emacs ...
0
votes
0answers
567 views

org-mode function definition is void

I install org-mode using use-package via the orgmode.org elpa archive. In the past month I've received Symbol’s function definition is void messages such as: org-capture-select-template: Symbol’s ...
1
vote
3answers
159 views

.emacs complains about undefined functions/variables event after byte-compile

I use use-package and pulled in the treemacs package with the default settings. Then I byte-compiled my .emacsfile. But I still get a warning saying: the following functions might not be defined at ...
1
vote
0answers
98 views

use-package do not bind in latex-mode-map

this is a part of my init file (use-package tex-site :ensure auctex :mode ("\\.tex\\'" . latex-mode) :bind (:map LaTeX-mode-map ("<f5> <f5>" . TeX-command-save-buffer-and-...
3
votes
1answer
2k views

use-package won't load

I use the same configuration of emacs on multiple machines, and I want to use use-package to keep the packages the same on all machines. I have an init file in each machine's home directory that ...
0
votes
1answer
248 views

use-package arguments without use-package

The guide I'm following for lsp-emacs wants me to set these options: ;; Enable scala-mode and sbt-mode (use-package scala-mode :mode "\\.s\\(cala\\|bt\\)$") (use-package sbt-mode :commands sbt-...
0
votes
0answers
1k views

Proper use of use-package

I am using the following init file to download and load packages from melpa-stable in fresh Emacs installations: (require 'package) (add-to-list 'package-archives '("melpa-stable" . "https://stable....
1
vote
1answer
86 views

How to convert a package to a layer in spacemacs

I am new to the world of Emacs, and like most ex-vimmers, I am starting with Spacemacs. I have been trying to find time to do some leetcode and would like to use the package leetcode-emacs. I have ...
0
votes
2answers
296 views

Melpa packages aren't being added

I have this in my init.el (require 'package) (setq package-enable-at-startup nil) ;;; Remove SC if you are not using sunrise commander and org if you like outdated packages (setq package-archives '((...
1
vote
1answer
83 views

Cannot run cquery

I have been using rtags as my primary C++ mode, but I found that it's performance is not satisfying for large code bases e.g. Linux kernel. It takes more than 5 seconds to find definitions. This it ...
1
vote
0answers
40 views

binding a minor mode's function to already defined key in global-map

(use-package anaconda-mode :defer t :config (progn (unbind-key "M-." anaconda-mode-map) (unbind-key "C-_" global-map)) :bind ((:map anaconda-mode-map ("C-_" . anaconda-...
0
votes
0answers
1k views

Spacemacs error when loading `.spacemacs` which uses package `flycheck`

I added the following at the end of my ~/.spacemacs file: (use-package flycheck :defer t :init (global-flycheck-mode)) When I do this, I get Spacemacs encountered an error while loading your '/...
1
vote
2answers
54 views

Unbind CUA <C-return> key only in dired mode

Goal: unbind <C-return> key ONLY in dired mode in order to rebind it to dired-w32explore. My configuration is using use-package with something like this: (use-package dired :init (unbind-...
4
votes
1answer
91 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")...
1
vote
1answer
616 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-...
1
vote
3answers
443 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 ...
1
vote
1answer
118 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 ((...
2
votes
2answers
880 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 ...
1
vote
1answer
432 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 ...
2
votes
2answers
1k 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" . ...