aboutsummaryrefslogtreecommitdiffstats
path: root/oni-eshell.el
diff options
context:
space:
mode:
authorGravatar Tom Willemse2020-11-06 16:40:57 -0800
committerGravatar Tom Willemse2020-11-06 16:40:57 -0800
commitdb42ad1a171b00132b0d3228b737e2631c4b6fd9 (patch)
tree074118eb1cc473eae3e9f73af666124b0f27abb0 /oni-eshell.el
parent27bc014a64f92bb7d43e062449c2e5800d8361d2 (diff)
downloademacs-config-db42ad1a171b00132b0d3228b737e2631c4b6fd9.tar.gz
emacs-config-db42ad1a171b00132b0d3228b737e2631c4b6fd9.zip
Fix adding ‘C-c b’ to the eshell keymap
‘eshell-mode-map’ isn’t a keymap until after ‘eshell-mode’ has run. It’s defined as ‘nil’ in the top-level of the ‘esh-mode’ package. ‘nil’ is not a valid keymap that new keys can be defined into.
Diffstat (limited to 'oni-eshell.el')
-rw-r--r--oni-eshell.el11
1 files changed, 5 insertions, 6 deletions
diff --git a/oni-eshell.el b/oni-eshell.el
index 7f8e9ed..71f1e31 100644
--- a/oni-eshell.el
+++ b/oni-eshell.el
@@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local
-;; Version: 2020.1026.133507
+;; Version: 2020.1106.164034
;; Package-Requires: (eshell-fringe-status esh-autosuggest xterm-color eshell-syntax-highlighting)
;; This program is free software; you can redistribute it and/or modify
@@ -56,9 +56,10 @@
(setq eshell-output-filter-functions
(remove 'eshell-handle-ansi-color eshell-output-filter-functions)))
-(defun oni-eshell--set-eshell-C-d ()
+(defun oni-eshell--expand-keymap ()
"Set `C-d' to quit eshell if used at end of prompt."
- (define-key eshell-mode-map (kbd "C-d") #'oni-eshell--C-d))
+ (define-key eshell-mode-map (kbd "C-d") #'oni-eshell--C-d)
+ (define-key eshell-mode-map (kbd "C-c b") #'oni-eshell-goto-buffer-directory))
(defun oni-eshell--set-xterm-variables ()
"Set ‘xterm-color-preserve-properties’ to t."
@@ -81,7 +82,7 @@
(eshell-reset))
(add-hook 'eshell-before-prompt-hook #'oni-eshell--set-xterm-variables)
-(add-hook 'eshell-first-time-mode-hook #'oni-eshell--set-eshell-C-d)
+(add-hook 'eshell-first-time-mode-hook #'oni-eshell--expand-keymap)
(add-hook 'eshell-load-hook #'oni-eshell--disable-ansi-color-handling)
(add-hook 'eshell-load-hook #'oni-eshell--enable-truncating-buffers)
(add-hook 'eshell-load-hook #'oni-eshell--enable-xterm-filter)
@@ -91,8 +92,6 @@
(add-hook 'esh-autosuggest-mode-hook #'oni-eshell-fix-esh-autosuggest-active-keymap)
-(define-key eshell-mode-map (kbd "C-c b") #'oni-eshell-goto-buffer-directory)
-
(when (display-graphic-p)
(add-hook 'eshell-mode-hook 'eshell-fringe-status-mode))