Fix history key binding for Eshell with new Emacs 28.1

There's a new mode map `eshell-hist-mode-map` which already contains a binding
for `M-r`, so we have to redefine that key binding there to make it work.
This commit is contained in:
Daniel - 2022-04-29 07:42:39 +02:00
parent 92e30c7d47
commit 8773e60052
No known key found for this signature in database
GPG Key ID: 1C7071A75BB72D64
1 changed files with 16 additions and 6 deletions

10
init.el
View File

@ -2620,6 +2620,7 @@ With given ARG, display files in `db/important-document-path."
:config (progn (require 'em-prompt)
(require 'em-term)
(require 'em-cmpl)
(require 'em-hist)
(setenv "PAGER" "cat")
@ -2632,12 +2633,21 @@ With given ARG, display files in `db/important-document-path."
(add-hook 'eshell-mode-hook
'with-editor-export-editor)
(if (<= emacs-major-version 27)
(add-hook 'eshell-mode-hook
(lambda ()
(bind-key "C-a" #'eshell-bol eshell-mode-map)
(bind-key "M-r" #'eshell-insert-history eshell-mode-map)
(bind-key "M-P" #'eshell-previous-prompt eshell-mode-map)
(bind-key "M-N" #'eshell-next-prompt eshell-mode-map)))
;; In Emacs 28.1, eshell's mode maps have been refactored to
;; follow standard extensibility. There's thus no need
;; anymore to use the special hook construction.
(progn
(bind-key "C-a" #'eshell-bol eshell-mode-map)
(bind-key "M-r" #'eshell-insert-history eshell-hist-mode-map)
(bind-key "M-P" #'eshell-previous-prompt eshell-mode-map)
(bind-key "M-N" #'eshell-next-prompt eshell-mode-map)))
;; Ignoring case when completing file names seems to have a
;; bug: when a ~ is encountered, it is implicitly expaned by