summaryrefslogtreecommitdiff
path: root/lisp/eshell/esh-var.el
diff options
context:
space:
mode:
authorAlex Branham <alex.branham@gmail.com>2019-06-26 13:59:06 -0500
committerNoam Postavsky <npostavs@gmail.com>2019-08-15 20:49:15 -0400
commit1ee0192b792124663a0a40a729dd83c047d21535 (patch)
treeee51acecf6d02868d81344c7d0249d45b070ab9b /lisp/eshell/esh-var.el
parentb3713265cbb8eb591ac832ae4c35bf8185544467 (diff)
downloademacs-1ee0192b792124663a0a40a729dd83c047d21535.tar.gz
emacs-1ee0192b792124663a0a40a729dd83c047d21535.tar.bz2
emacs-1ee0192b792124663a0a40a729dd83c047d21535.zip
Fix eshell-mode-map initialization
* lisp/eshell/esh-mode.el (eshell-mode-map, eshell-command-map): Set up normal keymaps and prefix commands rather than re-initializing them in each eshell buffer * lisp/eshell/em-cmpl.el (eshell-cmpl-mode-map, eshell-cmpl-mode) (eshell-cmpl-initialize): * lisp/eshell/em-hist.el (eshell-hist-mode-map, eshell-hist-mode) (eshell-hist-initialize): * lisp/eshell/em-pred.el (eshell-pred-mode-map, eshell-pred-mode) (eshell-pred-initialize): * lisp/eshell/em-prompt.el (eshell-prompt-mode-map, eshell-prompt-mode) (eshell-prompt-initialize): * lisp/eshell/em-rebind.el (eshell-rebind-mode-map, eshell-rebind-mode) (eshell-rebind-initialize): * lisp/eshell/esh-arg.el (eshell-arg-mode-map, eshell-arg-mode) (eshell-arg-initialize): * lisp/eshell/esh-proc.el (eshell-proc-mode-map, eshell-proc-mode) (eshell-proc-initialize): * lisp/eshell/esh-var.el (eshell-var-mode-map, eshell-var-mode) (eshell-var-initialize): Create a new minor mode with a keymap and call it in the module initialization function. bug#33808 bug#22792
Diffstat (limited to 'lisp/eshell/esh-var.el')
-rw-r--r--lisp/eshell/esh-var.el16
1 files changed, 11 insertions, 5 deletions
diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el
index b08a5d242fe..6ec58464c54 100644
--- a/lisp/eshell/esh-var.el
+++ b/lisp/eshell/esh-var.el
@@ -197,8 +197,19 @@ function), and the arguments passed to this function would be the list
(put 'eshell-variable-aliases-list 'risky-local-variable t)
+(defvar eshell-var-mode-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map (kbd "C-c M-v") #'eshell-insert-envvar)
+ map))
+
;;; Functions:
+(define-minor-mode eshell-var-mode
+ "Minor mode for the esh-var module.
+
+\\{eshell-var-mode-map}"
+ :keymap eshell-var-mode-map)
+
(defun eshell-var-initialize () ;Called from `eshell-mode' via intern-soft!
"Initialize the variable handle code."
;; Break the association with our parent's environment. Otherwise,
@@ -207,11 +218,6 @@ function), and the arguments passed to this function would be the list
(set (make-local-variable 'process-environment)
(eshell-copy-environment)))
- ;; This is supposedly run after enabling esh-mode, when eshell-command-map
- ;; already exists.
- (defvar eshell-command-map)
- (define-key eshell-command-map [(meta ?v)] 'eshell-insert-envvar)
-
(set (make-local-variable 'eshell-special-chars-inside-quoting)
(append eshell-special-chars-inside-quoting '(?$)))
(set (make-local-variable 'eshell-special-chars-outside-quoting)