Fix #4176: wrong-type-arg keymapp opening eshell

This commit is contained in:
Henrik Lissner 2020-10-29 05:40:24 -04:00
parent 61ec1d9698
commit 57ef63d6ba
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 51 additions and 12 deletions

View file

@ -147,18 +147,7 @@ You should use `set-eshell-alias!' to change this.")
(:localleader
"b" #'eshell-insert-buffer-name
"e" #'eshell-insert-envvar
"s" #'+eshell/search-history))
;; HACK Eshell resets its keymap every time `eshell-mode' is enabled. Why? It
;; is not for us mere mortals to question! Fun fact: there's a "FIXME
;; What the hell?!" above the offending line in esh-mode.el.
;; DEPRECATED As of Emacs 28, binding keys in a hook is no longer necessary.
(unless EMACS28+
(add-hook! 'eshell-mode-hook
(defun +eshell-fix-keymap-h ()
"Undo buffer-local `eshell-mode-map', so global keybinds work."
(kill-local-variable 'eshell-mode-map)
(use-local-map eshell-mode-map)))))
"s" #'+eshell/search-history)))
(use-package! eshell-up