问题
How do I recover the most recent keystrokes I just typed in Emacs? I'm a long-time Emacs user (30 years), but every so often I mistype a key sequence, something strange happens, and I want to know what sequence of chars I typed, compared with what I thought I typed. I know there's a command that shows a couple dozen of the most recent chars I typed, but I can't remember what it is, and I can't seem to find it either. For example, sometimes in dired-mode
, I move the cursor to a file, and I type !
to run a command on that file, but I type some other sequence by mistake, and suddenly I see I've selected all files in the dired
buffer—all files are marked with *
. I'm trying to debug my typing in this situation.
回答1:
Type C-hl, which invokes view-lossage
.
回答2:
Use M-x view-lossage
RET.
view-lossage is an interactive compiled Lisp function in `help.el'. It is bound to C-h l, <f1> l, <help> l.
(view-lossage)
Display last 300 input keystrokes.
来源:https://stackoverflow.com/questions/14833530/displaying-recent-keystrokes-in-emacs