summaryrefslogtreecommitdiff
path: root/lisp/chistory.el
diff options
context:
space:
mode:
authorJohn Paul Wallington <jpw@pobox.com>2008-06-27 17:51:24 +0000
committerJohn Paul Wallington <jpw@pobox.com>2008-06-27 17:51:24 +0000
commit610117a9d0573342a271aed9d67327d0c0a921a3 (patch)
tree2d4c392e32ce71a26aea69395aa12af471f7c04c /lisp/chistory.el
parent24c23999e1d5352664cbb4d4a8e927efb1ec43b1 (diff)
downloademacs-610117a9d0573342a271aed9d67327d0c0a921a3.tar.gz
(list-command-history): Use `bound-and-true-p'.
(command-history-map): Define within defvar. Add docstring.
Diffstat (limited to 'lisp/chistory.el')
-rw-r--r--lisp/chistory.el22
1 files changed, 11 insertions, 11 deletions
diff --git a/lisp/chistory.el b/lisp/chistory.el
index 47f5309cb44..21053950c9e 100644
--- a/lisp/chistory.el
+++ b/lisp/chistory.el
@@ -109,8 +109,7 @@ The buffer is left in Command History mode."
(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 @@ The buffer is left in Command History mode."
(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.