7

Thank you for telling me about the different types of maps. The issue is as @NickD pointed out in their answer https://emacs.stackexchange.com/a/59269/9874 and the example use-package code puts all the bindings into the global map. ie org-mode puts the binding to "" in org-mode-map so you need to use that map. Because my configuration is based on ...


4

It is not packages that use-package loads but features (which are things you can require and test for with featurep). From this point of view, use-package is essentially a fancy wrapper for require. While use-package can often seem like magic, you can demystify by placing point after a use-package stanza and doing M-x pp-macroexpand-last-sexp. In the case ...


3

By chance, after commenting on this, hours later I ran into exactly the same issue. The cause was that spacemacs had for a while pinned its version of dash at 2.17.0, and -compose was introduced in 2.18.0 (moved over from the now obsolete package dash-functional). The latest lsp-mode.el uses that function. I fixed it by updating my spacemacs checkout to ...


3

According to the manual (section 4.13), the car of the :hook form can be a list. So (use-package git-auto-commit-mode :hook ((fundamental-mode js-mode) . git-auto-commit-mode) :custom (gac-ask-for-summary-p t)) should do the job.


3

The mode sets up its own keymap which overrides the global map. The :bind mechanism creates a binding in the global map, but in an Org mode file, the key is looked up in the mode map before the global map, so you get the definition in the mode map. The usual way to override this is by using the mode hook. Add to your init file the following code: (eval-after-...


2

use-package is a macro around require. Macros are expanded before code execution. The purpose of a macro is to create syntactic sugar to make code easier to read, understand, and maintain. Your different alternatives have minimal effect to the execution time. In the end, it is a personal choice which one you prefer. I use mostly the :after key for terseness, ...


2

Using use-package's :bind by setting the binding to nil worked for me in similar cases, but I use it with :straight org-plus-contrib and I do not know if this approach applies the same with built-in org: (use-package org :straight org-plus-contrib :bind (:map org-mode-map ("C-," . nil) ("C-'" . nil)))


1

use-package's :init block is run before the package has been loaded. Try putting the code inside a :config block instead, like: (use-package session :config (session-initialize) (defun ... I also removed the progn, as use-package allows multiple statements in the :config block. EDIT: as requested in a comment, the desktop-save-mode use-package block: (...


1

Think of a package as a bunch of e-lisp and maybe other files. Many of these (such as the package package itself) come as part of your emacs (these are said to be built-in) and so need no further installation. Others, such as pdf-tools or helm are located in repositories on the interwebs such as melpa and so must be downloaded onto your computer before ...


1

I think something has gone wrong if you can't modify the use-package form -- AFAIK that macro is intended for use by end-users only. That said, the documentation you've quoted: all of the following are equivalent: (use-package ace-jump-mode :hook prog-mode) (use-package ace-jump-mode :hook (prog-mode . ace-jump-mode)) (use-package ace-jump-mode :...


1

Look at the help for execute-extended-command (via C-h f execute-extended-command): It is bound to , , M-x. (execute-extended-command PREFIXARG &optional COMMAND-NAME TYPED) This function is for interactive use only; in Lisp code use ‘command-execute’ instead. Read a command name, then read the arguments and call the command. To pass a prefix argument ...


1

You need to do this: (use-package template :after org :defer t :load-path (lambda () (concat user-emacs-directory "latex")) :config (more-config-stuff...)) (concat user-emacs-directory "latex") does not get evaluated in use-package, so you can use a function that returns what you need instead. I am assuming ox-latex is already ...


1

You can find out what is going on yourself by putting the cursor after the use-package stanza and doing M-x pp-macroexpand-last-sexp. You will discover that the :hook line expands to (add-hook 'TeX-after-compilation-finished-functions-hook #'TeX-revert-document-buffer) which is not what you wanted. Long story short: :hook only does what you want if the car ...


1

I would write it that way. (use-package esh-mode :bind (:map eshell-mode-map ("C-<backspace>" . my-eshell-mode-func)) :config (defun my-eshell-mode-func () (interactive) (func "arg"))) For two reasons: eshell-mode-map is provided by feature esh-mode (not eshell) see end of this file ...


1

You want to set that variable to a string. This ought to work: (use-package lsp-mode :init (setq lsp-keymap-prefix "s-k")) You had :ensure t in there as well, but it doesn't have anything to do with configuring the package; instead it causes use-package to try to install lsp-mode if it isn't available. You might want to include it, or you ...


1

The keybindings created with :bind expect a function name (not sure how lambdas are expanded) so you can define a named function in the :init clause of use-package which should work as expected... (use-package eshell :after esh-mode :init (defun my-clear-shell () (interactive) (message "I am some other function")) :bind (:map ...


1

Your code is missing a (require 'use-package); without that, Emacs gets confused about use-package and treats it as a function instead of a macro.


1

dired-ranger doesn't provide a multi-column view. If you want that you should try ranger.el. Instead dired-ranger provides some helpful functions for copy and pasting as you can see from the description. ;; --- Ranger --- Loads ranger (use-package ranger :ensure t )


Only top voted, non community-wiki answers of a minimum length are eligible