X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/3a801d0c71755fad1c33585e7ed54d9dc240999c..88e15d0eca7546c5f42e9d06771b391d5f05f28a:/lisp/echistory.el diff --git a/lisp/echistory.el b/lisp/echistory.el index 840244813c..a01cad89f4 100644 --- a/lisp/echistory.el +++ b/lisp/echistory.el @@ -18,8 +18,11 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to -;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Commentary: ;;; Code: @@ -42,10 +45,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) @@ -63,17 +66,22 @@ 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) (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 "\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)) @@ -107,9 +115,10 @@ The Command History listing is recomputed each time this mode is invoked." (save-window-excursion (list-command-history) (set-buffer "*Command History*") - (Command-history-setup 'electric-command-history - "Electric History" - electric-history-map)) + (Command-history-setup) + (setq major-mode 'electric-command-history) + (setq mode-name "Electric History") + (use-local-map electric-history-map)) (Electric-pop-up-window "*Command History*") (run-hooks 'electric-command-history-hook) (if (eobp) @@ -120,7 +129,7 @@ The Command History listing is recomputed each time this mode is invoked." (Electric-command-loop 'electric-history-quit "->" t)))))) (set-buffer "*Command History*") - (Command-history-setup) + (command-history-mode) (bury-buffer (current-buffer))) (if (consp todo) (progn (set-buffer old-buffer) @@ -131,7 +140,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 () @@ -141,4 +150,7 @@ The Command History listing is recomputed each time this mode is invoked." (progn (message "") (throw 'electric-history-quit nil)))) +(provide 'echistory) + +;;; arch-tag: 1e5018fe-190f-44a7-9109-a895dcac4c50 ;;; echistory.el ends here