Function: electric-command-history
electric-command-history is an interactive and byte-compiled function
defined in echistory.el.gz.
Signature
(electric-command-history)
Documentation
Major mode for examining and redoing commands from command-history(var)/command-history(fun).
This pops up a window with the Command History listing.
The number of command listed is controlled by list-command-history-max.
The command history is filtered by list-command-history-filter if non-nil.
Combines typeout Command History list window with menu like selection
of an expression from the history for re-evaluation in the *original* buffer.
The history displayed is filtered by list-command-history-filter if non-nil.
Like Emacs-Lisp mode except that characters do not insert themselves and
Tab and Linefeed do not indent. Instead these commands are provided:
! Electric-command-history-redo-expression
<down> next-line
<home> beginning-of-buffer
<next> scroll-up
<prior> scroll-down
<t> Electric-history-undefined
<up> previous-line
? Helper-describe-bindings
C-M-a beginning-of-defun
C-M-b backward-sexp
C-M-d down-list
C-M-e end-of-defun
C-M-f forward-sexp
C-M-n forward-list
C-M-p backward-list
C-M-u backward-up-list
C-M-v scroll-other-window
C-] Electric-history-quit
C-c C-c Electric-history-quit
C-h Helper-help
C-j next-line
C-l recenter
C-n next-line
C-p previous-line
C-u universal-argument
C-v scroll-up
C-z suspend-frame
DEL previous-line
ESC <t> Electric-history-undefined
M-< beginning-of-buffer
M-> end-of-buffer
M-v scroll-down
RET next-line
SPC Electric-command-history-redo-expression
q Electric-history-quit
Calls the value of electric-command-history-hook if that is non-nil.
The Command History listing is recomputed each time this mode is invoked.
Probably introduced at or before Emacs version 16.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/echistory.el.gz
(defvar Helper-return-blurb) ; from helper.el
(defun electric-command-history ()
"\\<electric-history-map>Major mode for examining and redoing commands from `command-history'.
This pops up a window with the Command History listing.
The number of command listed is controlled by `list-command-history-max'.
The command history is filtered by `list-command-history-filter' if non-nil.
Combines typeout Command History list window with menu like selection
of an expression from the history for re-evaluation in the *original* buffer.
The history displayed is filtered by `list-command-history-filter' if non-nil.
Like Emacs-Lisp mode except that characters do not insert themselves and
Tab and Linefeed do not indent. Instead these commands are provided:
\\{electric-history-map}
Calls the value of `electric-command-history-hook' if that is non-nil.
The Command History listing is recomputed each time this mode is invoked."
(interactive)
(let ((electric-history-in-progress t)
(old-buffer (current-buffer))
(todo))
(unwind-protect
(setq todo
(catch 'electric-history-quit
(save-window-excursion
(save-window-excursion
(list-command-history)
(set-buffer "*Command History*")
(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)
(progn (ding)
(message "No command history.")
(throw 'electric-history-quit nil))
(let ((Helper-return-blurb "return to History"))
(Electric-command-loop 'electric-history-quit
"->" t))))))
(set-buffer "*Command History*")
(command-history-mode)
(bury-buffer (current-buffer)))
(if (consp todo)
(progn (set-buffer old-buffer)
(if (car todo)
(apply (car (car (cdr todo))) (cdr (car (cdr todo))))
(edit-and-eval-command "Redo: " (car (cdr todo))))))))