diff options
| author | Stefan Monnier <monnier@iro.umontreal.ca> | 2014-11-09 21:58:52 -0500 |
|---|---|---|
| committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2014-11-09 21:58:52 -0500 |
| commit | eca1ea96559e04e18a62a61208d501c557dd4cab (patch) | |
| tree | bc1b7bb276957c445917c7a70dbfe604710545ff /lisp/help.el | |
| parent | 155d93fff87a516197d29edbd02af9a10517bd61 (diff) | |
| download | emacs-eca1ea96559e04e18a62a61208d501c557dd4cab.tar.gz | |
* lisp/help.el (view-lossage): Include the actual commands run.
* src/keyboard.c (command_loop_1): Record this-command in recent-keys.
(Frecent_keys): Rewrite. and add optional `include-cmds' arg.
Diffstat (limited to 'lisp/help.el')
| -rw-r--r-- | lisp/help.el | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/lisp/help.el b/lisp/help.el index 2da43d3ed48..eaee6d14736 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -448,25 +448,32 @@ is specified by the variable `message-log-max'." (info "(efaq)Packages that do not come with Emacs")) (defun view-lossage () - "Display last 300 input keystrokes. + "Display last few input keystrokes and the commands run. To record all your input, use `open-dribble-file'." (interactive) (help-setup-xref (list #'view-lossage) (called-interactively-p 'interactive)) (with-help-window (help-buffer) + (princ " ") (princ (mapconcat (lambda (key) - (if (or (integerp key) (symbolp key) (listp key)) - (single-key-description key) - (prin1-to-string key nil))) - (recent-keys) + (cond + ((and (consp key) (null (car key))) + (format "[%s]\n" (if (symbolp (cdr key)) (cdr key) + "anonymous-command"))) + ((or (integerp key) (symbolp key) (listp key)) + (single-key-description key)) + (t + (prin1-to-string key nil)))) + (recent-keys 'include-cmds) " ")) (with-current-buffer standard-output (goto-char (point-min)) - (while (progn (move-to-column 50) (not (eobp))) - (when (search-forward " " nil t) - (delete-char -1)) - (insert "\n")) + (while (not (eobp)) + (move-to-column 50) + (unless (eolp) + (fill-region (line-beginning-position) (line-end-position))) + (forward-line 1)) ;; jidanni wants to see the last keystrokes immediately. (set-marker help-window-point-marker (point))))) |
