Subject: bug#61440: 27.2; Be able to have `view-lossage' report only on the current buffer

From: Eli Zaretskii <[email-masked]>
Date: Sun, 12 Feb 2023 08:09:37 +0200

> From: Drew Adams <[email-masked]>
> Date: Sat, 11 Feb 2023 21:59:09 +0000
> 
> Be able (e.g. with a prefix arg) to have `C-h l' show only the recent
> commands used in the current buffer.  The max number should be the same
> as if listing the commands used in all buffers.  IOW, it shouldn't just be a
> filtering of what `C-h l' without a prefix arg would give you (i.e., limited
> to the max number).
> 
> It would be good to also extend `recent-keys' to accept an additional
> optional arg, to have it return only events in the current buffer.

How do you define "commands used in the current buffer"?

  . are commands in the minibuffer when Emacs prompts considered to be
    "used in the current buffer"?
  . are commands invoked from the minibuffer via M-x considered to be
    "used in the current buffer"?
  . what about commands that switch to temporary buffers and enter
    recursive edit there?
  . what about commands that switch to another buffer in the middle of
    typing a key sequence?
  . etc. etc.

IOW, I don't understand how this hypothetical feature could work in
practice, let alone how to document what exactly it produces.  Emacs
commands are by their very nature "global", unrelated to a buffer.