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:
parent
92e30c7d47
commit
8773e60052
22
init.el
22
init.el
|
@ -2620,6 +2620,7 @@ With given ARG, display files in `db/important-document-path’."
|
||||||
:config (progn (require 'em-prompt)
|
:config (progn (require 'em-prompt)
|
||||||
(require 'em-term)
|
(require 'em-term)
|
||||||
(require 'em-cmpl)
|
(require 'em-cmpl)
|
||||||
|
(require 'em-hist)
|
||||||
|
|
||||||
(setenv "PAGER" "cat")
|
(setenv "PAGER" "cat")
|
||||||
|
|
||||||
|
@ -2632,12 +2633,21 @@ With given ARG, display files in `db/important-document-path’."
|
||||||
(add-hook 'eshell-mode-hook
|
(add-hook 'eshell-mode-hook
|
||||||
'with-editor-export-editor)
|
'with-editor-export-editor)
|
||||||
|
|
||||||
(add-hook 'eshell-mode-hook
|
(if (<= emacs-major-version 27)
|
||||||
(lambda ()
|
(add-hook 'eshell-mode-hook
|
||||||
(bind-key "C-a" #'eshell-bol eshell-mode-map)
|
(lambda ()
|
||||||
(bind-key "M-r" #'eshell-insert-history eshell-mode-map)
|
(bind-key "C-a" #'eshell-bol eshell-mode-map)
|
||||||
(bind-key "M-P" #'eshell-previous-prompt eshell-mode-map)
|
(bind-key "M-r" #'eshell-insert-history eshell-mode-map)
|
||||||
(bind-key "M-N" #'eshell-next-prompt 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
|
;; Ignoring case when completing file names seems to have a
|
||||||
;; bug: when a ~ is encountered, it is implicitly expaned by
|
;; bug: when a ~ is encountered, it is implicitly expaned by
|
||||||
|
|
Loading…
Reference in New Issue