Closed simurgh9 closed 3 years ago
eshell-mode-map is defined in esh-mode, please use below use-package.
(use-package eshell
:bind
(:map eshell-mode-map
:package esh-mode
("C-<backspace>" . (lambda () (interactive) (func "arg")))))
or, plsese use use-package to esh-mode to remove :package
argument.
(use-package esh-mode
:bind
(:map eshell-mode-map
("C-<backspace>" . (lambda () (interactive) (func "arg")))))
There also seems to be a bug involved.
What I want to accomplish is to add a keybinding
C-<backspace>
to theeshell-mod-map
that callsfunc
. That can be done like this,Now
C-<backspace>
only callsfunc
when inside an eshell buffer. I thought this should be equivalent to,However, this binds
C-<backspace>
tofunc
everywhere. e. g., if I pressC-<backspace>
in the*scratch*
buffer, that also callsfunc
. This does not happen when the configuration is done as in the formeruse-package
declaration, there the keybinding is kept only inside the eshell buffer.However, I fail to see the difference between the two declarations. I would like to fix the latter so it has the same effect as the former, since the latter is a bit clearer and nicer. How can I do this?