# HG changeset patch # User John Paul Wallington # Date 1214589028 0 # Node ID e495cfc33b5efa2aaee2b2d889ac146f643e3d7e # Parent 044f3969e191653b25b22400d19bccad73a139de (list-command-history): Use `bound-and-true-p'. (command-history-map): Define within defvar. Add docstring. diff -r 044f3969e191 -r e495cfc33b5e lisp/chistory.el --- a/lisp/chistory.el Fri Jun 27 15:58:36 2008 +0000 +++ b/lisp/chistory.el Fri Jun 27 17:50:28 2008 +0000 @@ -109,8 +109,7 @@ (buffer-read-only nil) (count (or list-command-history-max -1))) (while (and (/= count 0) history) - (if (and (boundp 'list-command-history-filter) - list-command-history-filter + (if (and (bound-and-true-p list-command-history-filter) (funcall list-command-history-filter (car history))) nil (setq count (1- count)) @@ -124,15 +123,16 @@ (error "No command history") (command-history-mode))))) -(defvar command-history-map nil) -(unless command-history-map - (setq command-history-map (make-sparse-keymap)) - (set-keymap-parent command-history-map lisp-mode-shared-map) - (suppress-keymap command-history-map) - (define-key command-history-map "x" 'command-history-repeat) - (define-key command-history-map "\n" 'next-line) - (define-key command-history-map "\r" 'next-line) - (define-key command-history-map "\177" 'previous-line)) +(defvar command-history-map + (let ((map (make-sparse-keymap))) + (set-keymap-parent map lisp-mode-shared-map) + (suppress-keymap map) + (define-key map "x" 'command-history-repeat) + (define-key map "\n" 'next-line) + (define-key map "\r" 'next-line) + (define-key map "\177" 'previous-line) + map) + "Keymap for `command-history-mode'.") (defun command-history-mode () "Major mode for listing and repeating recent commands.