Function: view-lossage

view-lossage is an interactive and byte-compiled function defined in help.el.gz.

Signature

(view-lossage)

Documentation

Display last few input keystrokes and the commands run.

For convenience this uses the same format as edit-last-kbd-macro. See lossage-size to update the number of recorded keystrokes.

To record all your input, use open-dribble-file.

View in manual

Probably introduced at or before Emacs version 23.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/help.el.gz
(defun view-lossage ()
  "Display last few input keystrokes and the commands run.
For convenience this uses the same format as
`edit-last-kbd-macro'.
See `lossage-size' to update the number of recorded keystrokes.

To record all your input, use `open-dribble-file'."
  (interactive)
  (let ((help-buffer-under-preparation t))
    (help-setup-xref (list #'view-lossage)
		     (called-interactively-p 'interactive))
    (with-help-window (help-buffer)
      (princ " ")
      (princ (mapconcat (lambda (key)
			  (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))
	(let ((comment-start ";; ")
              ;; Prevent 'comment-indent' from handling a single
              ;; semicolon as the beginning of a comment.
              (comment-start-skip ";; ")
              (comment-use-syntax nil)
              (comment-column 24))
          (while (not (eobp))
            (comment-indent)
	    (forward-line 1)))
	;; Show point near the end of "lossage", as we did in Emacs 24.
	(set-marker help-window-point-marker (point))))))