Subject: bug#51173: 28.0.60; gnus-article-describe-key doesn't work

From: Stefan Monnier <[email-masked]>
Date: Fri, 15 Oct 2021 14:32:56 -0400

> +	  (let* ((key (read-key-sequence nil t))
> +                 (buffer (if (consp key)
> +                             (window-buffer (posn-window (event-start key)))
> +                           (current-buffer))))
> +            (describe-key key buffer))))
> +    (describe-key key (if (consp key)
> +                          (window-buffer (posn-window (event-start key)))
> +                        (current-buffer)))))

I think the first `describe-key` above should always use
`current-buffer` (that's the whole point of the function: to lookup the
keybinding in that other buffer).

And for the second, it's supposed to be a fallback that does whatever
`describe-key` does normally, so I don't see why we'd need/want this
(if ...) construction.

OTOH we should probably try and change the `key` arg to use the new
key-list format expected by `describe-key` (i.e. a list of (SEQ
. RAW-SEQ) pairs).

> +	  (let ((key (read-key-sequence nil t))
> +                (buffer (if (consp key)
> +                            (window-buffer (posn-window (event-start key)))
> +                          (current-buffer))))
> +            (describe-key-briefly key insert buffer))))
> +    (describe-key-briefly key insert
> +                          (if (consp key)
> +                              (window-buffer (posn-window (event-start key)))
> +                            (current-buffer)))))

Same here.

        Stefan