diff options
| author | Richard M. Stallman | 1999-12-31 23:41:32 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1999-12-31 23:41:32 +0000 |
| commit | 40891308b8e73488d12d385b49d5901397f2087f (patch) | |
| tree | 022991b499bc21d62a3594fb49aaca34c595e5c4 | |
| parent | e65f2cc09364b340d23e379ce5de14c2fce3891b (diff) | |
| download | emacs-40891308b8e73488d12d385b49d5901397f2087f.tar.gz emacs-40891308b8e73488d12d385b49d5901397f2087f.zip | |
(command-history): Renamed from command-history-mode.
(Command-history-setup): Don't switch buffers. Take
no args, and do not set major-mode, mode-name or the local map.
(command-history-mode): New function, does some of those things
Command-history-setup used to do.
(list-command-history): Call command-history-mode, not
Command-history-setup.
| -rw-r--r-- | lisp/chistory.el | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/lisp/chistory.el b/lisp/chistory.el index 29bc7b9b8d7..6c5eaba8b72 100644 --- a/lisp/chistory.el +++ b/lisp/chistory.el | |||
| @@ -122,17 +122,22 @@ The buffer is left in Command History mode." | |||
| 122 | (goto-char (point-min)) | 122 | (goto-char (point-min)) |
| 123 | (if (eobp) | 123 | (if (eobp) |
| 124 | (error "No command history") | 124 | (error "No command history") |
| 125 | (Command-history-setup))))) | 125 | (command-history-mode))))) |
| 126 | 126 | ||
| 127 | (defun Command-history-setup (&optional majormode modename keymap) | 127 | (defun command-history-mode () |
| 128 | (set-buffer "*Command History*") | 128 | "Major mode for listing and repeating recent commands." |
| 129 | (Command-history-setup) | ||
| 130 | (setq major-mode 'command-history-mode) | ||
| 131 | (setq mode-name "Command History") | ||
| 132 | (use-local-map command-history-map) | ||
| 133 | (run-hooks 'command-history-mode-hook)) | ||
| 134 | |||
| 135 | (defun Command-history-setup () | ||
| 136 | (kill-all-local-variables) | ||
| 129 | (use-local-map (or keymap command-history-map)) | 137 | (use-local-map (or keymap command-history-map)) |
| 130 | (lisp-mode-variables nil) | 138 | (lisp-mode-variables nil) |
| 131 | (set-syntax-table emacs-lisp-mode-syntax-table) | 139 | (set-syntax-table emacs-lisp-mode-syntax-table) |
| 132 | (setq buffer-read-only t) | 140 | (setq buffer-read-only t)) |
| 133 | (use-local-map (or keymap command-history-map)) | ||
| 134 | (setq major-mode (or majormode 'command-history-mode)) | ||
| 135 | (setq mode-name (or modename "Command History"))) | ||
| 136 | 141 | ||
| 137 | (defcustom command-history-hook nil | 142 | (defcustom command-history-hook nil |
| 138 | "If non-nil, its value is called on entry to `command-history-mode'." | 143 | "If non-nil, its value is called on entry to `command-history-mode'." |
| @@ -163,8 +168,8 @@ The buffer for that command is the previous current buffer." | |||
| 163 | (car (cdr (buffer-list)))))))) | 168 | (car (cdr (buffer-list)))))))) |
| 164 | 169 | ||
| 165 | ;;;###autoload | 170 | ;;;###autoload |
| 166 | (defun command-history-mode () | 171 | (defun command-history () |
| 167 | "Major mode for examining commands from `command-history'. | 172 | "Examine commands from `command-history' in a buffer. |
| 168 | The number of commands listed is controlled by `list-command-history-max'. | 173 | The number of commands listed is controlled by `list-command-history-max'. |
| 169 | The command history is filtered by `list-command-history-filter' if non-nil. | 174 | The command history is filtered by `list-command-history-filter' if non-nil. |
| 170 | Use \\<command-history-map>\\[command-history-repeat] to repeat the command on the current line. | 175 | Use \\<command-history-map>\\[command-history-repeat] to repeat the command on the current line. |
| @@ -172,8 +177,9 @@ Use \\<command-history-map>\\[command-history-repeat] to repeat the command on t | |||
| 172 | Otherwise much like Emacs-Lisp Mode except that there is no self-insertion | 177 | Otherwise much like Emacs-Lisp Mode except that there is no self-insertion |
| 173 | and digits provide prefix arguments. Tab does not indent. | 178 | and digits provide prefix arguments. Tab does not indent. |
| 174 | \\{command-history-map} | 179 | \\{command-history-map} |
| 175 | Calls the value of `command-history-hook' if that is non-nil. | 180 | |
| 176 | The Command History listing is recomputed each time this mode is invoked." | 181 | This command always recompiles the Command History listing |
| 182 | and runs the normal hook `command-history-hook'." | ||
| 177 | (interactive) | 183 | (interactive) |
| 178 | (list-command-history) | 184 | (list-command-history) |
| 179 | (pop-to-buffer "*Command History*") | 185 | (pop-to-buffer "*Command History*") |