From ab391624d609c70962c6201fa256046c5758760c Mon Sep 17 00:00:00 2001 From: Tim McCarthy Date: Thu, 19 Sep 2024 19:29:00 -0700 Subject: [PATCH] Improve how eat semi-char keymaps are modified --- thoom-emacs/modules/thoom-eshell.el | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/thoom-emacs/modules/thoom-eshell.el b/thoom-emacs/modules/thoom-eshell.el index ad7d236..3a92521 100644 --- a/thoom-emacs/modules/thoom-eshell.el +++ b/thoom-emacs/modules/thoom-eshell.el @@ -8,13 +8,18 @@ (eval-after-load 'eshell #'eat-eshell-mode) (eval-after-load 'eshell #'eat-eshell-visual-command-mode) :config - (add-to-list 'eat-semi-char-non-bound-keys (vector meta-prefix-char ?`)) - (add-to-list 'eat-semi-char-non-bound-keys [?\C-o]) - (eat-update-semi-char-mode-map) + (defun advise-eat-keymap (map) + (define-key map [?\C-o] nil) + (define-key map (vector meta-prefix-char ?`) nil) + (define-key map [S-v] #'eat-yank)) - (add-to-list 'eat-eshell-semi-char-non-bound-keys (vector meta-prefix-char ?`)) - (add-to-list 'eat-eshell-semi-char-non-bound-keys [?\C-o]) - (eat-eshell-update-semi-char-mode-map) + (define-advice eat-eshell-semi-char-mode + (:after (&rest r)) + (advise-eat-keymap eat-eshell-semi-char-mode-map)) + + (define-advice eat-semi-char-mode + (:after (&rest r)) + (advise-eat-keymap eat-semi-char-mode-map)) :hook (eat-mode . (lambda () (setq display-line-numbers nil)