* lisp/eshell/em-hist.el (eshell-isearch-map): Initialize in the defvar.
authorGlenn Morris <rgm@gnu.org>
Tue, 7 May 2013 07:57:02 +0000 (00:57 -0700)
committerGlenn Morris <rgm@gnu.org>
Tue, 7 May 2013 07:57:02 +0000 (00:57 -0700)
Remove explicit eshell-isearch-cancel-map.

lisp/ChangeLog
lisp/eshell/em-hist.el

index 2d4a638..7f43a36 100644 (file)
@@ -1,5 +1,8 @@
 2013-05-07  Glenn Morris  <rgm@gnu.org>
 
+       * eshell/em-hist.el (eshell-isearch-map): Initialize in the defvar.
+       Remove explicit eshell-isearch-cancel-map.
+
        * progmodes/f90.el (f90-smart-end-names): New option.
        (f90-smart-end): Doc fix.
        (f90-end-block-optional-name): New constant.
index 62d3ae1..694fe71 100644 (file)
@@ -189,21 +189,18 @@ element, regardless of any text on the command line.  In that case,
 (defvar eshell-matching-input-from-input-string "")
 (defvar eshell-save-history-index nil)
 
-(defvar eshell-isearch-map nil)
-
-(unless eshell-isearch-map
-  (setq eshell-isearch-map (copy-keymap isearch-mode-map))
-  (define-key eshell-isearch-map [(control ?m)] 'eshell-isearch-return)
-  (define-key eshell-isearch-map [return] 'eshell-isearch-return)
-  (define-key eshell-isearch-map [(control ?r)] 'eshell-isearch-repeat-backward)
-  (define-key eshell-isearch-map [(control ?s)] 'eshell-isearch-repeat-forward)
-  (define-key eshell-isearch-map [(control ?g)] 'eshell-isearch-abort)
-  (define-key eshell-isearch-map [backspace] 'eshell-isearch-delete-char)
-  (define-key eshell-isearch-map [delete] 'eshell-isearch-delete-char)
-  (defvar eshell-isearch-cancel-map)
-  (define-prefix-command 'eshell-isearch-cancel-map)
-  (define-key eshell-isearch-map [(control ?c)] 'eshell-isearch-cancel-map)
-  (define-key eshell-isearch-cancel-map [(control ?c)] 'eshell-isearch-cancel))
+(defvar eshell-isearch-map
+  (let ((map (copy-keymap isearch-mode-map)))
+    (define-key map [(control ?m)] 'eshell-isearch-return)
+    (define-key map [return] 'eshell-isearch-return)
+    (define-key map [(control ?r)] 'eshell-isearch-repeat-backward)
+    (define-key map [(control ?s)] 'eshell-isearch-repeat-forward)
+    (define-key map [(control ?g)] 'eshell-isearch-abort)
+    (define-key map [backspace] 'eshell-isearch-delete-char)
+    (define-key map [delete] 'eshell-isearch-delete-char)
+    (define-key map "\C-c\C-c" 'eshell-isearch-cancel)
+    map)
+  "Keymap used in isearch in Eshell.")
 
 (defvar eshell-rebind-keys-alist)