summaryrefslogtreecommitdiff
path: root/lisp/eshell/em-pred.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/em-pred.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/em-pred.el')
-rw-r--r--lisp/eshell/em-pred.el15
1 files changed, 13 insertions, 2 deletions
diff --git a/lisp/eshell/em-pred.el b/lisp/eshell/em-pred.el
index 9bc856a2966..cfef59f962e 100644
--- a/lisp/eshell/em-pred.el
+++ b/lisp/eshell/em-pred.el
@@ -229,6 +229,12 @@ FOR LISTS OF ARGUMENTS:
EXAMPLES:
*.c(:o) sorted list of .c files")
+(defvar eshell-pred-mode-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map (kbd "C-c M-q") #'eshell-display-predicate-help)
+ (define-key map (kbd "C-c M-m") #'eshell-display-modifier-help)
+ map))
+
;;; Functions:
(defun eshell-display-predicate-help ()
@@ -245,12 +251,17 @@ EXAMPLES:
(lambda ()
(insert eshell-modifier-help-string)))))
+(define-minor-mode eshell-pred-mode
+ "Minor mode for the eshell-pred module.
+
+\\{eshell-pred-mode-map}"
+ :keymap eshell-pred-mode-map)
+
(defun eshell-pred-initialize () ;Called from `eshell-mode' via intern-soft!
"Initialize the predicate/modifier code."
(add-hook 'eshell-parse-argument-hook
#'eshell-parse-arg-modifier t t)
- (define-key eshell-command-map [(meta ?q)] 'eshell-display-predicate-help)
- (define-key eshell-command-map [(meta ?m)] 'eshell-display-modifier-help))
+ (eshell-pred-mode))
(defun eshell-apply-modifiers (lst predicates modifiers)
"Apply to LIST a series of PREDICATES and MODIFIERS."