Commands entered after pressing M-x can be viewed using the up/down arrow keys.
How can I get a list of all the commands including menu bar invocation, commands triggered using mouse clicks, etc. in Emacs?
Commands entered after pressing M-x can be viewed using the up/down arrow keys.
How can I get a list of all the commands including menu bar invocation, commands triggered using mouse clicks, etc. in Emacs?
I've used mwe-log-commands to make screencasts. It shows events and the commands they trigger as you work in Emacs.
I've just forked it and made it into a proper minor-mode and global-minor-mode along with some other improvements as command-log-mode.
Give it a shot and file issues against me if the documentation is unclear or if you find any bugs.
For a complete list of history, type C-h l (lowercase "L").
Note: this list is complete in the sense that it keeps all events and commands that happened recently, but it's not complete in the sense that it only keeps track of the last 300 or so events (and corresponding commands).
command history
. Event history does not show commands. –
Estuary C-h l
only showed events, but it has since been improved to also show the commands triggered in response to those events. –
Barlow I've used mwe-log-commands to make screencasts. It shows events and the commands they trigger as you work in Emacs.
I've just forked it and made it into a proper minor-mode and global-minor-mode along with some other improvements as command-log-mode.
Give it a shot and file issues against me if the documentation is unclear or if you find any bugs.
So you want the history of of all commands, regardless of where they are executed? I don't know if emacs provides this by default, but you can add your own function to post-command-hook
which is executed after every command, so you can use it to collect all the executed commands.
M-x view-lossage
From emacs documentation
(view-lossage)
Display last few input keystrokes and the commands run. For convenience this uses the same format as
edit-last-kbd-macro
. Seelossage-size
to update the number of recorded keystrokes.To record all your input, use
open-dribble-file
.
(open-dribble-file FILE)
Start writing input events to a dribble file called
FILE
. Any previously open dribble file will be closed first. IfFILE
is nil, just close the dribble file, if any. If the file is still open when Emacs exits, it will be closed then.The events written to the file include keyboard and mouse input events, but not events from executing keyboard macros. The events are written to the dribble file immediately without line buffering.
Be aware that this records all characters you type! This may include sensitive information such as passwords.
You can also use the keycast package which comes with a handy keycast-mode-line-mode
which displays the last executed keybinding along with its command in the modeline.
It also has a keycast-log-mode
which
displays a list of recent bindings in a dedicated frame.
But this only keeps track of the commands after enabling the mode
In my opinion M-x view-lossage
OR C-h l (lowercase "L") as mentioned by others here is the best option and additionally, it is also an in-built tool, so no additional packages..
© 2022 - 2025 — McMap. All rights reserved.