|
From: | Juri Linkov |
Subject: | bug#51173: 28.0.60; gnus-article-describe-key doesn't work |
Date: | Sat, 16 Oct 2021 20:55:51 +0300 |
User-agent: | Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) |
>> + (let* ((key (read-key-sequence nil t)) >> + (buffer (if (consp key) >> + (window-buffer (posn-window (event-start key))) >> + (current-buffer)))) >> + (describe-key key 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). There is still something missing: `gnus-article-describe-key` already selects the required buffer with `with-current-buffer`. Then why should it provide the same buffer as an argument to `describe-key` to select it again in `describe-key`? Maybe you intended to add a new argument `buffer` to pass it down to `help--analyze-key` that could use it somehow in this condition: (defn (if (consp event) (save-excursion (mouse-set-point event) (key-binding key t)) (key-binding key t))) But I have no idea how. Maybe not to set point (that also selects another window) when the `buffer` arg is provided? E.g. (defn (if (not buffer) (save-excursion (mouse-set-point event) (key-binding key t)) (key-binding key t))) IOW, the semantics of `buffer` is not clear here. > 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). `gnus-article-describe-key` just passes down the value that `read-key-sequence` returns.
[Prev in Thread] | Current Thread | [Next in Thread] |