changeset 95537:d5cfdf662741

(electric-history-map): Define within defvar. Add docstring.
author John Paul Wallington <jpw@pobox.com>
date Wed, 04 Jun 2008 11:20:52 +0000
parents b1ce615c4de6
children 73018c6032be
files lisp/echistory.el
diffstat 1 files changed, 42 insertions(+), 42 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/echistory.el	Wed Jun 04 11:14:07 2008 +0000
+++ b/lisp/echistory.el	Wed Jun 04 11:20:52 2008 +0000
@@ -41,48 +41,48 @@
       (if (boundp 'electric-history-in-progress)
 	  (if todo (throw 'electric-history-quit (list noconfirm todo)))))))
 
-(defvar electric-history-map ())
-(if electric-history-map
-    ()
-  (setq electric-history-map (make-sparse-keymap))
-  (define-key electric-history-map [t] 'Electric-history-undefined)
-  (define-key electric-history-map "\e" (make-sparse-keymap))
-  (define-key electric-history-map [?\e t] 'Electric-history-undefined)
-  (define-key electric-history-map "\C-u" 'universal-argument)
-  (define-key electric-history-map " " 'Electric-command-history-redo-expression)
-  (define-key electric-history-map "!" 'Electric-command-history-redo-expression)
-  (define-key electric-history-map "\e\C-x" 'eval-sexp)
-  (define-key electric-history-map "\e\C-d" 'down-list)
-  (define-key electric-history-map "\e\C-u" 'backward-up-list)
-  (define-key electric-history-map "\e\C-b" 'backward-sexp)
-  (define-key electric-history-map "\e\C-f" 'forward-sexp)
-  (define-key electric-history-map "\e\C-a" 'beginning-of-defun)
-  (define-key electric-history-map "\e\C-e" 'end-of-defun)
-  (define-key electric-history-map "\e\C-n" 'forward-list)
-  (define-key electric-history-map "\e\C-p" 'backward-list)
-  (define-key electric-history-map "q" 'Electric-history-quit)
-  (define-key electric-history-map "\C-c" nil)
-  (define-key electric-history-map "\C-c\C-c" 'Electric-history-quit)
-  (define-key electric-history-map "\C-]" 'Electric-history-quit)
-  (define-key electric-history-map "\C-z" 'suspend-frame)
-  (define-key electric-history-map (char-to-string help-char) 'Helper-help)
-  (define-key electric-history-map "?" 'Helper-describe-bindings)
-  (define-key electric-history-map "\e>" 'end-of-buffer)
-  (define-key electric-history-map "\e<" 'beginning-of-buffer)
-  (define-key electric-history-map "\n" 'next-line)
-  (define-key electric-history-map "\r" 'next-line)
-  (define-key electric-history-map "\177" 'previous-line)
-  (define-key electric-history-map "\C-n" 'next-line)
-  (define-key electric-history-map "\C-p" 'previous-line)
-  (define-key electric-history-map "\ev" 'scroll-down)
-  (define-key electric-history-map "\C-v" 'scroll-up)
-  (define-key electric-history-map [home] 'beginning-of-buffer)
-  (define-key electric-history-map [down] 'next-line)
-  (define-key electric-history-map [up] 'previous-line)
-  (define-key electric-history-map [prior] 'scroll-down)
-  (define-key electric-history-map [next] 'scroll-up)
-  (define-key electric-history-map "\C-l" 'recenter)
-  (define-key electric-history-map "\e\C-v" 'scroll-other-window))
+(defvar electric-history-map
+  (let ((map (make-sparse-keymap)))
+    (define-key map [t] 'Electric-history-undefined)
+    (define-key map "\e" (make-sparse-keymap))
+    (define-key map [?\e t] 'Electric-history-undefined)
+    (define-key map "\C-u" 'universal-argument)
+    (define-key map " " 'Electric-command-history-redo-expression)
+    (define-key map "!" 'Electric-command-history-redo-expression)
+    (define-key map "\e\C-x" 'eval-sexp)
+    (define-key map "\e\C-d" 'down-list)
+    (define-key map "\e\C-u" 'backward-up-list)
+    (define-key map "\e\C-b" 'backward-sexp)
+    (define-key map "\e\C-f" 'forward-sexp)
+    (define-key map "\e\C-a" 'beginning-of-defun)
+    (define-key map "\e\C-e" 'end-of-defun)
+    (define-key map "\e\C-n" 'forward-list)
+    (define-key map "\e\C-p" 'backward-list)
+    (define-key map "q" 'Electric-history-quit)
+    (define-key map "\C-c" nil)
+    (define-key map "\C-c\C-c" 'Electric-history-quit)
+    (define-key map "\C-]" 'Electric-history-quit)
+    (define-key map "\C-z" 'suspend-frame)
+    (define-key map (char-to-string help-char) 'Helper-help)
+    (define-key map "?" 'Helper-describe-bindings)
+    (define-key map "\e>" 'end-of-buffer)
+    (define-key map "\e<" 'beginning-of-buffer)
+    (define-key map "\n" 'next-line)
+    (define-key map "\r" 'next-line)
+    (define-key map "\177" 'previous-line)
+    (define-key map "\C-n" 'next-line)
+    (define-key map "\C-p" 'previous-line)
+    (define-key map "\ev" 'scroll-down)
+    (define-key map "\C-v" 'scroll-up)
+    (define-key map [home] 'beginning-of-buffer)
+    (define-key map [down] 'next-line)
+    (define-key map [up] 'previous-line)
+    (define-key map [prior] 'scroll-down)
+    (define-key map [next] 'scroll-up)
+    (define-key map "\C-l" 'recenter)
+    (define-key map "\e\C-v" 'scroll-other-window)
+    map)
+  "Keymap for Electric Command History mode.")
 
 (defvar electric-command-history-hook nil
   "If non-nil, its value is called by `electric-command-history'.")