From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#51173: 28.0.60; gnus-article-describe-key doesn't work Date: Sat, 16 Oct 2021 20:55:51 +0300 Organization: LINKOV.NET Message-ID: <87h7dgg8go.fsf@mail.linkov.net> References: <87h7dl6spg.fsf@gnus.org> <87r1cox4th.fsf@mail.linkov.net> <87h7dkx2g5.fsf@mail.linkov.net> <87r1cm3hqb.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3226"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: Lars Ingebrigtsen , Katsumi Yamaoka , 51173@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 16 20:01:39 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mbo03-0000iK-Hs for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 16 Oct 2021 20:01:39 +0200 Original-Received: from localhost ([::1]:37324 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbo02-0007KT-Ay for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 16 Oct 2021 14:01:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39132) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbnzY-0007H1-0j for bug-gnu-emacs@gnu.org; Sat, 16 Oct 2021 14:01:09 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59704) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mbnzS-0006OB-Er for bug-gnu-emacs@gnu.org; Sat, 16 Oct 2021 14:01:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mbnzS-0003v1-6C; Sat, 16 Oct 2021 14:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bugs@gnus.org Resent-Date: Sat, 16 Oct 2021 18:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51173 X-GNU-PR-Package: emacs,gnus Original-Received: via spool by 51173-submit@debbugs.gnu.org id=B51173.163440725215041 (code B ref 51173); Sat, 16 Oct 2021 18:01:02 +0000 Original-Received: (at 51173) by debbugs.gnu.org; 16 Oct 2021 18:00:52 +0000 Original-Received: from localhost ([127.0.0.1]:43017 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbnzI-0003uW-B2 for submit@debbugs.gnu.org; Sat, 16 Oct 2021 14:00:52 -0400 Original-Received: from relay4-d.mail.gandi.net ([217.70.183.196]:57431) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbnzG-0003uH-40 for 51173@debbugs.gnu.org; Sat, 16 Oct 2021 14:00:51 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id CEFCBE0007; Sat, 16 Oct 2021 18:00:41 +0000 (UTC) In-Reply-To: (Stefan Monnier's message of "Fri, 15 Oct 2021 14:32:56 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:217381 Archived-At: >> + (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.