1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-24 10:38:38 +00:00

(list-command-history): Use `bound-and-true-p'.

(command-history-map): Define within defvar.  Add docstring.
This commit is contained in:
John Paul Wallington 2008-06-27 17:51:24 +00:00
parent 24c23999e1
commit 610117a9d0
2 changed files with 17 additions and 12 deletions

View File

@ -1,3 +1,8 @@
2008-06-27 John Paul Wallington <jpw@pobox.com>
* chistory.el (list-command-history): Use `bound-and-true-p'.
(command-history-map): Define within defvar. Add docstring.
2008-06-27 Juanma Barranquero <lekktu@gmail.com> 2008-06-27 Juanma Barranquero <lekktu@gmail.com>
* image.el (image-jpeg-p): Don't fail if the arg cannot be converted * image.el (image-jpeg-p): Don't fail if the arg cannot be converted
@ -43,7 +48,7 @@
2008-06-26 John Paul Wallington <jpw@pobox.com> 2008-06-26 John Paul Wallington <jpw@pobox.com>
* ibuf-ext.el (ibuffer-diff-buffer-with-file-1): New function. * ibuf-ext.el (ibuffer-diff-buffer-with-file-1): New function.
(ibuffer-diff-with-file): Use it. Do diff on marked buffers (ibuffer-diff-with-file): Use it. Do diff on marked buffers.
(ibuffer-mark-on-buffer): Don't display message when removing marks. (ibuffer-mark-on-buffer): Don't display message when removing marks.
(ibuffer-mark-by-mode): Use `buffer-local-value'. (ibuffer-mark-by-mode): Use `buffer-local-value'.

View File

@ -109,8 +109,7 @@ The buffer is left in Command History mode."
(buffer-read-only nil) (buffer-read-only nil)
(count (or list-command-history-max -1))) (count (or list-command-history-max -1)))
(while (and (/= count 0) history) (while (and (/= count 0) history)
(if (and (boundp 'list-command-history-filter) (if (and (bound-and-true-p list-command-history-filter)
list-command-history-filter
(funcall list-command-history-filter (car history))) (funcall list-command-history-filter (car history)))
nil nil
(setq count (1- count)) (setq count (1- count))
@ -124,15 +123,16 @@ The buffer is left in Command History mode."
(error "No command history") (error "No command history")
(command-history-mode))))) (command-history-mode)))))
(defvar command-history-map nil) (defvar command-history-map
(unless command-history-map (let ((map (make-sparse-keymap)))
(setq command-history-map (make-sparse-keymap)) (set-keymap-parent map lisp-mode-shared-map)
(set-keymap-parent command-history-map lisp-mode-shared-map) (suppress-keymap map)
(suppress-keymap command-history-map) (define-key map "x" 'command-history-repeat)
(define-key command-history-map "x" 'command-history-repeat) (define-key map "\n" 'next-line)
(define-key command-history-map "\n" 'next-line) (define-key map "\r" 'next-line)
(define-key command-history-map "\r" 'next-line) (define-key map "\177" 'previous-line)
(define-key command-history-map "\177" 'previous-line)) map)
"Keymap for `command-history-mode'.")
(defun command-history-mode () (defun command-history-mode ()
"Major mode for listing and repeating recent commands. "Major mode for listing and repeating recent commands.