(Info-goto-node, Info-search):
[bpt/emacs.git] / lisp / echistory.el
index 59e51cd..0aa19c5 100644 (file)
@@ -1,13 +1,15 @@
 ;;; echistory.el --- Electric Command History Mode
 
 ;; Copyright (C) 1985 Free Software Foundation, Inc.
-;; Principal author K. Shane Hartman
+
+;; Author: K. Shane Hartman
+;; Maintainer: FSF
 
 ;; This file is part of GNU Emacs.
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 1, or (at your option)
+;; the Free Software Foundation; either version 2, or (at your option)
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
@@ -19,6 +21,7 @@
 ;; along with GNU Emacs; see the file COPYING.  If not, write to
 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
 
+;;; Code:
 
 (require 'electric)                    ; command loop
 (require 'chistory)                    ; history lister
@@ -39,10 +42,10 @@ With prefix arg NOCONFIRM, execute current line as-is without editing."
 (defvar electric-history-map ())
 (if electric-history-map
     ()
-  (setq electric-history-map (make-keymap))
-  (fillarray electric-history-map 'Electric-history-undefined)
-  (define-key electric-history-map "\e" (make-keymap))
-  (fillarray (lookup-key electric-history-map "\e") 'Electric-history-undefined)
+  (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)
@@ -60,7 +63,7 @@ With prefix arg NOCONFIRM, execute current line as-is without editing."
   (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-emacs)
-  (define-key electric-history-map "\C-h" 'Helper-help)
+  (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)
@@ -71,6 +74,11 @@ With prefix arg NOCONFIRM, execute current line as-is without editing."
   (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))
 
@@ -128,7 +136,7 @@ The Command History listing is recomputed each time this mode is invoked."
 (defun Electric-history-undefined ()
   (interactive)
   (ding)
-  (message "Type C-h for help, ? for commands, C-c to quit, Space to execute")
+  (message (substitute-command-keys "Type \\[Helper-help] for help, ? for commands, C-c C-c to quit, Space to execute"))
   (sit-for 4))
 
 (defun Electric-history-quit ()