[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Time of last command invoked
From: |
Robert Thorpe |
Subject: |
Re: Time of last command invoked |
Date: |
Sun, 28 Feb 2021 06:17:18 +0000 |
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>>> Is there some internal log in Emacs that keeps the date and
>>> time of last command invoked by a key or M-x?
>> That would imply a huge overhead.
>
> Not really, no.
> We already keep a log of the keys and commands (as used for `C-h l`),
> so it's a small matter of adding timestamps in there.
>
> But given the way this is currently implemented, it would have to be
> done in the C code, I think.
I think this depends on what Jean Louis wants. There are different
possible interpretations.
For just M-x it wouldn't be so difficult. That would just mean
replacing execute-extended-command with something that records the time
somewhere. The problem is that other keys.
If it means a function that's activated directly then it seems possible.
Every key that doesn't do "self-insert-command" could be remapped to a
different command. That command could record the key pressed before
handing over to the usual command. That would be tricky though, and
would break some Emacs features like C-h k. It would be a lot of work
and I don't think it would be worth it.
BR,
Robert Thorpe