GNU bug report logs - #51173
28.0.60; gnus-article-describe-key doesn't work

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs,gnus; Reported by: Katsumi Yamaoka <yamaoka@HIDDEN>; Done: Juri Linkov <juri@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
bug unarchived. Request was from Juri Linkov <juri@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
bug archived. Request was from Debbugs Internal Request <help-debbugs@HIDDEN> to internal_control <at> debbugs.gnu.org. Full text available.

Message received at 51173 <at> debbugs.gnu.org:


Received: (at 51173) by debbugs.gnu.org; 21 Oct 2021 16:43:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 21 12:43:29 2021
Received: from localhost ([127.0.0.1]:58413 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mdbA8-00063Z-SD
	for submit <at> debbugs.gnu.org; Thu, 21 Oct 2021 12:43:29 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:26384)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1mdbA6-00063I-F0
 for 51173 <at> debbugs.gnu.org; Thu, 21 Oct 2021 12:43:27 -0400
Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 22DEA8072A;
 Thu, 21 Oct 2021 12:43:20 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id C4447804E6;
 Thu, 21 Oct 2021 12:43:18 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1634834598;
 bh=ytxsOkVracnHkN6WE6nUCqmwh1Z3lgUUnq09F4bmYt0=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=eQVUd3U503Q39Q+gIu5VzaiD8+Q1UK20s52EcdkftM6xxd83w/m79zlmXmS1XpN+p
 OMNOPQyfw5lHJph3474NQEQ0WPB6OZRSB0Su8Z/I/cxKbntRaJFAiQ9I3BBKK/FDhl
 es6YP5qiFArXQwW5BZQfYCoqqV/Liwk6EEfZvjlLW7J7r630SPoTVW5l0MXcSENHOr
 9D5wxXyTX3oezdbfKKy/O7Urw0Gz+FanCfcB//NcRalQHLa1MJRTGzHMlE3rRB2fzN
 55h3YyZ0ZoJuLfkevSrn0GG1v6HjC4kawWStzSl0fVpldftne9vQQzjfFcZDNpZmNI
 D+gIVOjgG28YA==
Received: from milanesa (unknown [45.72.241.23])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 8CBA2120218;
 Thu, 21 Oct 2021 12:43:18 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#51173: 28.0.60; gnus-article-describe-key doesn't work
Message-ID: <jwvk0i6cos9.fsf-monnier+emacs@HIDDEN>
References: <b4mczo9hgyb.fsf@HIDDEN> <87h7dl6spg.fsf@HIDDEN>
 <87r1cox4th.fsf@HIDDEN> <87h7dkx2g5.fsf@HIDDEN>
 <jwv35p4pus6.fsf-monnier+emacs@HIDDEN>
 <87r1cm3hqb.fsf@HIDDEN>
 <jwva6jaywko.fsf-monnier+emacs@HIDDEN>
 <87h7dgg8go.fsf@HIDDEN>
 <jwv35p0lppe.fsf-monnier+emacs@HIDDEN>
 <87ilxumi07.fsf@HIDDEN> <87sfwvy411.fsf@HIDDEN>
Date: Thu, 21 Oct 2021 12:43:10 -0400
In-Reply-To: <87sfwvy411.fsf@HIDDEN> (Juri Linkov's message of "Wed, 
 20 Oct 2021 20:55:38 +0300")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.067 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 51173
Cc: Lars Ingebrigtsen <larsi@HIDDEN>, Katsumi Yamaoka <yamaoka@HIDDEN>,
 51173 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

>>>>> 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.
>>>
>>> I know.  This is the old calling convention of `describe-key`; we
>>> should move to the new one.
>>
>> Is seems everything is covered by this patch:
>
> So this is pushed now.

Thanks, and sorry I didn't get to it earlier.  FWIW, it does look good,


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN, bugs@HIDDEN:
bug#51173; Package emacs,gnus. Full text available.

Message received at 51173 <at> debbugs.gnu.org:


Received: (at 51173) by debbugs.gnu.org; 20 Oct 2021 17:55:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 20 13:55:59 2021
Received: from localhost ([127.0.0.1]:55389 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mdFol-0002g7-HS
	for submit <at> debbugs.gnu.org; Wed, 20 Oct 2021 13:55:59 -0400
Received: from relay4-d.mail.gandi.net ([217.70.183.196]:45339)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1mdFoj-0002ft-Gq
 for 51173 <at> debbugs.gnu.org; Wed, 20 Oct 2021 13:55:58 -0400
Received: (Authenticated sender: juri@HIDDEN)
 by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id D7722E0008;
 Wed, 20 Oct 2021 17:55:48 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#51173: 28.0.60; gnus-article-describe-key doesn't work
Organization: LINKOV.NET
References: <b4mczo9hgyb.fsf@HIDDEN> <87h7dl6spg.fsf@HIDDEN>
 <87r1cox4th.fsf@HIDDEN> <87h7dkx2g5.fsf@HIDDEN>
 <jwv35p4pus6.fsf-monnier+emacs@HIDDEN>
 <87r1cm3hqb.fsf@HIDDEN>
 <jwva6jaywko.fsf-monnier+emacs@HIDDEN>
 <87h7dgg8go.fsf@HIDDEN>
 <jwv35p0lppe.fsf-monnier+emacs@HIDDEN>
 <87ilxumi07.fsf@HIDDEN>
Date: Wed, 20 Oct 2021 20:55:38 +0300
In-Reply-To: <87ilxumi07.fsf@HIDDEN> (Juri Linkov's message of "Mon, 
 18 Oct 2021 19:20:00 +0300")
Message-ID: <87sfwvy411.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 51173
Cc: Lars Ingebrigtsen <larsi@HIDDEN>, Katsumi Yamaoka <yamaoka@HIDDEN>,
 51173 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>>>> 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.
>>
>> I know.  This is the old calling convention of `describe-key`; we
>> should move to the new one.
>
> Is seems everything is covered by this patch:

So this is pushed now.




Information forwarded to bug-gnu-emacs@HIDDEN, bugs@HIDDEN:
bug#51173; Package emacs,gnus. Full text available.

Message received at 51173 <at> debbugs.gnu.org:


Received: (at 51173) by debbugs.gnu.org; 18 Oct 2021 16:21:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 18 12:21:42 2021
Received: from localhost ([127.0.0.1]:48359 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mcVOP-0001MR-PN
	for submit <at> debbugs.gnu.org; Mon, 18 Oct 2021 12:21:42 -0400
Received: from relay2-d.mail.gandi.net ([217.70.183.194]:43599)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1mcVOK-0001Lq-Cl
 for 51173 <at> debbugs.gnu.org; Mon, 18 Oct 2021 12:21:37 -0400
Received: (Authenticated sender: juri@HIDDEN)
 by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id D5F6E40006;
 Mon, 18 Oct 2021 16:21:27 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#51173: 28.0.60; gnus-article-describe-key doesn't work
Organization: LINKOV.NET
References: <b4mczo9hgyb.fsf@HIDDEN> <87h7dl6spg.fsf@HIDDEN>
 <87r1cox4th.fsf@HIDDEN> <87h7dkx2g5.fsf@HIDDEN>
 <jwv35p4pus6.fsf-monnier+emacs@HIDDEN>
 <87r1cm3hqb.fsf@HIDDEN>
 <jwva6jaywko.fsf-monnier+emacs@HIDDEN>
 <87h7dgg8go.fsf@HIDDEN>
 <jwv35p0lppe.fsf-monnier+emacs@HIDDEN>
Date: Mon, 18 Oct 2021 19:20:00 +0300
In-Reply-To: <jwv35p0lppe.fsf-monnier+emacs@HIDDEN> (Stefan Monnier's message
 of "Sat, 16 Oct 2021 15:53:03 -0400")
Message-ID: <87ilxumi07.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 51173
Cc: Lars Ingebrigtsen <larsi@HIDDEN>, Katsumi Yamaoka <yamaoka@HIDDEN>,
 51173 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

--=-=-=
Content-Type: text/plain

>> 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`?
>
> Because `describe-key` otherwise uses the buffer of the window
> associated with the event (this is in done in `help--analyse-key` where
> we currently use `mouse-set-point`).  So we need to pass an explicit
> buffer to tell `describe-key` to ignore the event's window (and we need
> to change this part of `describe-key/help--analyse-key` to obey such a
> buffer argument).
>
>>          (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.
>
> If nil it means "defaults to the (window-buffer (posn-window (event-end event)))"
>
>>> 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.
>
> I know.  This is the old calling convention of `describe-key`; we
> should move to the new one.

Is seems everything is covered by this patch:


--=-=-=
Content-Type: text/x-diff
Content-Disposition: inline; filename=help--analyze-key.patch

diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index bb466b9400..930c739a73 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -6865,7 +6865,9 @@ gnus-article-describe-key
 	       unread-command-events))
 	(let ((cursor-in-echo-area t)
 	      gnus-pick-mode)
-	  (describe-key (read-key-sequence nil t))))
+	  (describe-key (cons (read-key-sequence nil t)
+			      (this-single-command-raw-keys))
+			(current-buffer))))
     (describe-key key)))
 
 (defun gnus-article-describe-key-briefly (key &optional insert)
@@ -6888,7 +6890,9 @@ gnus-article-describe-key-briefly
 	       unread-command-events))
 	(let ((cursor-in-echo-area t)
 	      gnus-pick-mode)
-	  (describe-key-briefly (read-key-sequence nil t) insert)))
+	  (describe-key-briefly (cons (read-key-sequence nil t)
+				      (this-single-command-raw-keys))
+				insert (current-buffer))))
     (describe-key-briefly key insert)))
 
 ;;`gnus-agent-mode' in gnus-agent.el will define it.
diff --git a/lisp/help.el b/lisp/help.el
index 9666ef9805..a7084d29ce 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -677,9 +677,11 @@ help-key-description
 (defun help--binding-undefined-p (defn)
   (or (null defn) (integerp defn) (equal defn 'undefined)))
 
-(defun help--analyze-key (key untranslated)
+(defun help--analyze-key (key untranslated &optional buffer)
   "Get information about KEY its corresponding UNTRANSLATED events.
-Returns a list of the form (BRIEF-DESC DEFN EVENT MOUSE-MSG)."
+Returns a list of the form (BRIEF-DESC DEFN EVENT MOUSE-MSG).
+When BUFFER is nil, it defaults to the
+`(window-buffer (posn-window (event-end event)))'."
   (if (numberp untranslated)
       (error "Missing `untranslated'!"))
   (let* ((event (when (> (length key) 0)
@@ -699,9 +701,8 @@ help--analyze-key
          ;; is selected from the context menu that should describe KEY
          ;; at the position of mouse click that opened the context menu.
          ;; When no mouse was involved, don't use `mouse-set-point'.
-         (defn (if (consp event)
-                   (save-excursion (mouse-set-point event) (key-binding key t))
-                 (key-binding key t))))
+         (defn (if buffer (key-binding key t)
+                 (save-excursion (mouse-set-point event) (key-binding key t)))))
     ;; Handle the case where we faked an entry in "Select and Paste" menu.
     (when (and (eq defn nil)
 	       (stringp (aref key (1- (length key))))
@@ -731,7 +732,7 @@ help--filter-info-list
    ;; If nothing left, then keep one (the last one).
    (last info-list)))
 
-(defun describe-key-briefly (&optional key-list insert untranslated)
+(defun describe-key-briefly (&optional key-list insert buffer)
   "Print the name of the functions KEY-LIST invokes.
 KEY-LIST is a list of pairs (SEQ . RAW-SEQ) of key sequences, where
 RAW-SEQ is the untranslated form of the key sequence SEQ.
@@ -739,8 +740,10 @@ describe-key-briefly
 
 While reading KEY-LIST interactively, this command temporarily enables
 menu items or tool-bar buttons that are disabled to allow getting help
-on them."
-  (declare (advertised-calling-convention (key-list &optional insert) "27.1"))
+on them.
+
+BUFFER is the buffer in which to lookup those keys; it defaults to the
+current buffer."
   (interactive
    ;; Ignore mouse movement events because it's too easy to miss the
    ;; message while moving the mouse.
@@ -748,15 +751,13 @@ describe-key-briefly
      `(,key-list ,current-prefix-arg)))
   (when (arrayp key-list)
     ;; Old calling convention, changed
-    (setq key-list (list (cons key-list
-                               (if (numberp untranslated)
-                                   (this-single-command-raw-keys)
-                                 untranslated)))))
-  (let* ((info-list (mapcar (lambda (kr)
-                              (help--analyze-key (car kr) (cdr kr)))
-                            key-list))
-         (msg (mapconcat #'car (help--filter-info-list info-list 1) "\n")))
-    (if insert (insert msg) (message "%s" msg))))
+    (setq key-list (list (cons key-list nil))))
+  (with-current-buffer (if (buffer-live-p buffer) buffer (current-buffer))
+    (let* ((info-list (mapcar (lambda (kr)
+                                (help--analyze-key (car kr) (cdr kr) buffer))
+                              key-list))
+           (msg (mapconcat #'car (help--filter-info-list info-list 1) "\n")))
+      (if insert (insert msg) (message "%s" msg)))))
 
 (defun help--key-binding-keymap (key &optional accept-default no-remap position)
   "Return a keymap holding a binding for KEY within current keymaps.
@@ -916,7 +917,7 @@ describe-key
              (mapcar (lambda (x)
                        (pcase-let* ((`(,seq . ,raw-seq) x)
                                     (`(,brief-desc ,defn ,event ,_mouse-msg)
-                                     (help--analyze-key seq raw-seq))
+                                     (help--analyze-key seq raw-seq buffer))
                                     (locus
                                      (help--binding-locus
                                       seq (event-start event))))

--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN, bugs@HIDDEN:
bug#51173; Package emacs,gnus. Full text available.

Message received at 51173 <at> debbugs.gnu.org:


Received: (at 51173) by debbugs.gnu.org; 16 Oct 2021 19:53:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 16 15:53:15 2021
Received: from localhost ([127.0.0.1]:43124 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mbpk2-0006ek-Sb
	for submit <at> debbugs.gnu.org; Sat, 16 Oct 2021 15:53:15 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:28671)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1mbpk0-0006eV-Q4
 for 51173 <at> debbugs.gnu.org; Sat, 16 Oct 2021 15:53:13 -0400
Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 4D7A1440BDB;
 Sat, 16 Oct 2021 15:53:06 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id BD6E94409E2;
 Sat, 16 Oct 2021 15:53:04 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1634413984;
 bh=mDOBHq6YI3hM9Af3ceNZQXzg/6BiGwmLnO1HSu2oWEk=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=GPk5+0f14dcM3MQUjcICKCxieQAE6mwKlgUrepCAvJqGc980wahghbpLHPZpRLehD
 I7dx61XBr/v8wArZVkS0EIEwvQKW1VgDebHNuU8BfI4PyKqPJikOgtoMEgtVLxlXwL
 aGKYD1UuUxI0yuCw3LIrNfAlcc9RvPzEA3bhYvd9RcNFbsuf0st+Pdpna/lUpcLTd1
 3KGOC3t7I6v7+5paE5aiqaBguA3rPxveSMIX/wtG4blUOrE4o/8IWP07qg6NZvGJ1q
 tc8IDe1GoNvKpjnIkKiETYJLnMgf9fNrQ+f/AGm1C5/CsC2I6s2XIgCN1iXsp75C0u
 ctRgO8fh5vEvw==
Received: from pastel (unknown [45.72.241.23])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 83843120384;
 Sat, 16 Oct 2021 15:53:04 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#51173: 28.0.60; gnus-article-describe-key doesn't work
Message-ID: <jwv35p0lppe.fsf-monnier+emacs@HIDDEN>
References: <b4mczo9hgyb.fsf@HIDDEN> <87h7dl6spg.fsf@HIDDEN>
 <87r1cox4th.fsf@HIDDEN> <87h7dkx2g5.fsf@HIDDEN>
 <jwv35p4pus6.fsf-monnier+emacs@HIDDEN>
 <87r1cm3hqb.fsf@HIDDEN>
 <jwva6jaywko.fsf-monnier+emacs@HIDDEN>
 <87h7dgg8go.fsf@HIDDEN>
Date: Sat, 16 Oct 2021 15:53:03 -0400
In-Reply-To: <87h7dgg8go.fsf@HIDDEN> (Juri Linkov's message of "Sat, 
 16 Oct 2021 20:55:51 +0300")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.033 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 51173
Cc: Lars Ingebrigtsen <larsi@HIDDEN>, Katsumi Yamaoka <yamaoka@HIDDEN>,
 51173 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

>>> +	  (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`?

Because `describe-key` otherwise uses the buffer of the window
associated with the event (this is in done in `help--analyse-key` where
we currently use `mouse-set-point`).  So we need to pass an explicit
buffer to tell `describe-key` to ignore the event's window (and we need
to change this part of `describe-key/help--analyse-key` to obey such a
buffer argument).

> 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)))

Yes.

> But I have no idea how.  Maybe not to set point (that also selects
> another window) when the `buffer` arg is provided?

Exactly.

>          (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.

If nil it means "defaults to the (window-buffer (posn-window (event-end event)))"

>> 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.

I know.  This is the old calling convention of `describe-key`; we
should move to the new one.


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN, bugs@HIDDEN:
bug#51173; Package emacs,gnus. Full text available.

Message received at 51173 <at> debbugs.gnu.org:


Received: (at 51173) by debbugs.gnu.org; 16 Oct 2021 18:00:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 16 14:00:52 2021
Received: from localhost ([127.0.0.1]:43017 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mbnzI-0003uW-B2
	for submit <at> debbugs.gnu.org; Sat, 16 Oct 2021 14:00:52 -0400
Received: from relay4-d.mail.gandi.net ([217.70.183.196]:57431)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1mbnzG-0003uH-40
 for 51173 <at> debbugs.gnu.org; Sat, 16 Oct 2021 14:00:51 -0400
Received: (Authenticated sender: juri@HIDDEN)
 by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id CEFCBE0007;
 Sat, 16 Oct 2021 18:00:41 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#51173: 28.0.60; gnus-article-describe-key doesn't work
Organization: LINKOV.NET
References: <b4mczo9hgyb.fsf@HIDDEN> <87h7dl6spg.fsf@HIDDEN>
 <87r1cox4th.fsf@HIDDEN> <87h7dkx2g5.fsf@HIDDEN>
 <jwv35p4pus6.fsf-monnier+emacs@HIDDEN>
 <87r1cm3hqb.fsf@HIDDEN>
 <jwva6jaywko.fsf-monnier+emacs@HIDDEN>
Date: Sat, 16 Oct 2021 20:55:51 +0300
In-Reply-To: <jwva6jaywko.fsf-monnier+emacs@HIDDEN> (Stefan Monnier's message
 of "Fri, 15 Oct 2021 14:32:56 -0400")
Message-ID: <87h7dgg8go.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 51173
Cc: Lars Ingebrigtsen <larsi@HIDDEN>, Katsumi Yamaoka <yamaoka@HIDDEN>,
 51173 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>> +	  (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.




Information forwarded to bug-gnu-emacs@HIDDEN, bugs@HIDDEN:
bug#51173; Package emacs,gnus. Full text available.

Message received at 51173 <at> debbugs.gnu.org:


Received: (at 51173) by debbugs.gnu.org; 15 Oct 2021 18:33:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 15 14:33:11 2021
Received: from localhost ([127.0.0.1]:40388 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mbS10-0008Dj-P8
	for submit <at> debbugs.gnu.org; Fri, 15 Oct 2021 14:33:10 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:39310)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1mbS0w-0008DC-Fo
 for 51173 <at> debbugs.gnu.org; Fri, 15 Oct 2021 14:33:09 -0400
Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 55B66440C27;
 Fri, 15 Oct 2021 14:33:00 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 5178B440C16;
 Fri, 15 Oct 2021 14:32:58 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1634322778;
 bh=I/AjK3WCbSrcscDnHN4eW7axzrZYiUzciXkQc6rNy0c=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=Anc8T9y+P67msHm5yo0J10BvNen/zgqECxJn/sjsY2W/rGfA6UeouslaXiZxfAYMi
 0nDYSywVrmjvUu2WSBQG0NjEVWDNdEom3UtkBUTR3KQjeq31/5/BH7KibyvBRjcvZm
 +ZGnBUwliEPrjet+9/pxMstvwVkqWzAKAcweUR+yiwODivTs45o9nxJvpcN5KRfhXn
 gEyGH78Ha4Q0etcOYC9SMBMprfBUrkIUjtMHmVVA1AJ8AjBfnHo/u9QsWgWt9I7Jna
 pJVZ1xGAI+cDAuslHPPL8RbYID6UCFLs1wWF94tFU0RNovZ+hIix0chxhnY0byzSFO
 /bLfa/LTXxBGA==
Received: from ceviche (modemcable004.216-203-24.mc.videotron.ca
 [24.203.216.4])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id DEA61120445;
 Fri, 15 Oct 2021 14:32:57 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#51173: 28.0.60; gnus-article-describe-key doesn't work
Message-ID: <jwva6jaywko.fsf-monnier+emacs@HIDDEN>
References: <b4mczo9hgyb.fsf@HIDDEN> <87h7dl6spg.fsf@HIDDEN>
 <87r1cox4th.fsf@HIDDEN> <87h7dkx2g5.fsf@HIDDEN>
 <jwv35p4pus6.fsf-monnier+emacs@HIDDEN>
 <87r1cm3hqb.fsf@HIDDEN>
Date: Fri, 15 Oct 2021 14:32:56 -0400
In-Reply-To: <87r1cm3hqb.fsf@HIDDEN> (Juri Linkov's message of "Fri, 
 15 Oct 2021 09:49:32 +0300")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.127 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 51173
Cc: Lars Ingebrigtsen <larsi@HIDDEN>, Katsumi Yamaoka <yamaoka@HIDDEN>,
 51173 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> +	  (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





Information forwarded to bug-gnu-emacs@HIDDEN, bugs@HIDDEN:
bug#51173; Package emacs,gnus. Full text available.

Message received at 51173 <at> debbugs.gnu.org:


Received: (at 51173) by debbugs.gnu.org; 15 Oct 2021 07:02:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 15 03:02:49 2021
Received: from localhost ([127.0.0.1]:37896 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mbHEv-0007x5-EL
	for submit <at> debbugs.gnu.org; Fri, 15 Oct 2021 03:02:49 -0400
Received: from relay9-d.mail.gandi.net ([217.70.183.199]:32771)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1mbHEt-0007wm-Ek
 for 51173 <at> debbugs.gnu.org; Fri, 15 Oct 2021 03:02:48 -0400
Received: (Authenticated sender: juri@HIDDEN)
 by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 3A993FF818;
 Fri, 15 Oct 2021 07:02:38 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#51173: 28.0.60; gnus-article-describe-key doesn't work
Organization: LINKOV.NET
References: <b4mczo9hgyb.fsf@HIDDEN> <87h7dl6spg.fsf@HIDDEN>
 <87r1cox4th.fsf@HIDDEN> <87h7dkx2g5.fsf@HIDDEN>
 <jwv35p4pus6.fsf-monnier+emacs@HIDDEN>
Date: Fri, 15 Oct 2021 09:49:32 +0300
In-Reply-To: <jwv35p4pus6.fsf-monnier+emacs@HIDDEN> (Stefan Monnier's message
 of "Wed, 13 Oct 2021 16:01:51 -0400")
Message-ID: <87r1cm3hqb.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 51173
Cc: Lars Ingebrigtsen <larsi@HIDDEN>, Katsumi Yamaoka <yamaoka@HIDDEN>,
 51173 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

--=-=-=
Content-Type: text/plain

> But this will still use "the wrong buffer" for mouse clicks, no?
>
> BTW, maybe a cleaner fix would be as follows:
> - Add a `buffer` argument to `describe-key(-briefly)`.
> - Pass that argument from `gnus-article-describe-key`.
> And to get the behavior that Juri just pushed that `buffer` argument
> would default to (if (consp event) (window-buffer (posn-window
> (event-start event))) (current-buffere)).

Maybe something like this (but currently I have no idea how to test all cases):


--=-=-=
Content-Type: text/x-diff
Content-Disposition: inline; filename=gnus-article-describe-key.patch

diff --git a/lisp/help.el b/lisp/help.el
index 9666ef9805..08a293c3dc 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -731,7 +731,7 @@ help--filter-info-list
    ;; If nothing left, then keep one (the last one).
    (last info-list)))
 
-(defun describe-key-briefly (&optional key-list insert untranslated)
+(defun describe-key-briefly (&optional key-list insert buffer)
   "Print the name of the functions KEY-LIST invokes.
 KEY-LIST is a list of pairs (SEQ . RAW-SEQ) of key sequences, where
 RAW-SEQ is the untranslated form of the key sequence SEQ.
@@ -739,8 +739,10 @@ describe-key-briefly
 
 While reading KEY-LIST interactively, this command temporarily enables
 menu items or tool-bar buttons that are disabled to allow getting help
-on them."
-  (declare (advertised-calling-convention (key-list &optional insert) "27.1"))
+on them.
+
+BUFFER is the buffer in which to lookup those keys; it defaults to the
+current buffer."
   (interactive
    ;; Ignore mouse movement events because it's too easy to miss the
    ;; message while moving the mouse.
@@ -748,15 +750,13 @@ describe-key-briefly
      `(,key-list ,current-prefix-arg)))
   (when (arrayp key-list)
     ;; Old calling convention, changed
-    (setq key-list (list (cons key-list
-                               (if (numberp untranslated)
-                                   (this-single-command-raw-keys)
-                                 untranslated)))))
-  (let* ((info-list (mapcar (lambda (kr)
-                              (help--analyze-key (car kr) (cdr kr)))
-                            key-list))
-         (msg (mapconcat #'car (help--filter-info-list info-list 1) "\n")))
-    (if insert (insert msg) (message "%s" msg))))
+    (setq key-list (list (cons key-list nil))))
+  (with-current-buffer (or buffer (current-buffer))
+    (let* ((info-list (mapcar (lambda (kr)
+                                (help--analyze-key (car kr) (cdr kr)))
+                              key-list))
+           (msg (mapconcat #'car (help--filter-info-list info-list 1) "\n")))
+      (if insert (insert msg) (message "%s" msg)))))
 
 (defun help--key-binding-keymap (key &optional accept-default no-remap position)
   "Return a keymap holding a binding for KEY within current keymaps.
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index bb466b9400..bbb452279a 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -6865,8 +6865,14 @@ gnus-article-describe-key
 	       unread-command-events))
 	(let ((cursor-in-echo-area t)
 	      gnus-pick-mode)
-	  (describe-key (read-key-sequence nil t))))
-    (describe-key key)))
+	  (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)))))
 
 (defun gnus-article-describe-key-briefly (key &optional insert)
   "Display documentation of the function invoked by KEY.
@@ -6888,8 +6894,15 @@ gnus-article-describe-key-briefly
 	       unread-command-events))
 	(let ((cursor-in-echo-area t)
 	      gnus-pick-mode)
-	  (describe-key-briefly (read-key-sequence nil t) insert)))
-    (describe-key-briefly key insert)))
+	  (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)))))
 
 ;;`gnus-agent-mode' in gnus-agent.el will define it.
 (defvar gnus-agent-summary-mode)

--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN, bugs@HIDDEN:
bug#51173; Package emacs,gnus. Full text available.

Message received at 51173 <at> debbugs.gnu.org:


Received: (at 51173) by debbugs.gnu.org; 14 Oct 2021 18:42:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 14 14:42:51 2021
Received: from localhost ([127.0.0.1]:37101 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mb5go-0000GD-UZ
	for submit <at> debbugs.gnu.org; Thu, 14 Oct 2021 14:42:51 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:25881)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1mb5gl-0000Fz-JQ
 for 51173 <at> debbugs.gnu.org; Thu, 14 Oct 2021 14:42:50 -0400
Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id AF5E280658;
 Thu, 14 Oct 2021 14:42:41 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 24CAF803D6;
 Thu, 14 Oct 2021 14:42:40 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1634236960;
 bh=puqe/5SIOTJV0ZRCIASPyiPi6lTYCdWrJFYxiNinQQ4=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=DaDBACSQeURpMCuAsIELNcJ9LGWbErUZB/j9jCaC67WzkeBW3tXZHm4A9V9FwdFZH
 CIK09TKzYZ2OFXFKVJGc62bd7v3DUJ0wKWMHin01S78maYuKH0F82sJ6ZtOAV2+gPc
 nguiz2nLdmMqtvTo6+sXwOonVwa7hvpqKKd12JeffvQkAJHYBllV23ywhjBJLAtYVh
 vvTkCjM+KqeW3Mrr1irYOc1RlZ1M0Xp0I/dCsik0cLGOa60uxNK5YYPP92GzTXgvGN
 MW5sQQgrv8WsEFocBchVMAENvkB0nCPIBnGBInu0yK8JIgEVqMHQtppFiVYL2+J1gX
 TBQsC80ZRUMWg==
Received: from alfajor (lechon.iro.umontreal.ca [132.204.27.242])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 0C4C6120210;
 Thu, 14 Oct 2021 14:42:40 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#51173: 28.0.60; gnus-article-describe-key doesn't work
Message-ID: <jwv5ytz5u7l.fsf-monnier+emacs@HIDDEN>
References: <b4mczo9hgyb.fsf@HIDDEN> <87h7dl6spg.fsf@HIDDEN>
 <87r1cox4th.fsf@HIDDEN> <87h7dkx2g5.fsf@HIDDEN>
 <jwv35p4pus6.fsf-monnier+emacs@HIDDEN>
 <87r1cnio3j.fsf@HIDDEN>
Date: Thu, 14 Oct 2021 14:41:40 -0400
In-Reply-To: <87r1cnio3j.fsf@HIDDEN> (Juri Linkov's message of "Thu, 
 14 Oct 2021 19:16:40 +0300")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL 0.155 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 51173
Cc: Lars Ingebrigtsen <larsi@HIDDEN>, Katsumi Yamaoka <yamaoka@HIDDEN>,
 51173 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

>>> +         (defn (if (consp event)
>>> +                   (save-excursion
>>> +                     (mouse-set-point event) (key-binding key t))
>>> +                 (key-binding key t))))
>>>      ;; Handle the case where we faked an entry in "Select and Paste" menu.
>>>      (when (and (eq defn nil)
>>>  	       (stringp (aref key (1- (length key))))
>>
>> But this will still use "the wrong buffer" for mouse clicks, no?
>
> It seems all mouse clicks expect the buffer where they were clicked
> to be displayed in a window.  I can't imagine how a mouse click
> could originate from a hidden buffer.

`gnus-article-describe-key` is used for those keybindings which Gnus
redirects from the buffer in which they occurred to some other buffer.
So if you use such a redirection for mouse-clicks,
`gnus-article-describe-key` would also want to look them up in the
other buffer.


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN, bugs@HIDDEN:
bug#51173; Package emacs,gnus. Full text available.

Message received at 51173 <at> debbugs.gnu.org:


Received: (at 51173) by debbugs.gnu.org; 14 Oct 2021 16:17:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 14 12:17:43 2021
Received: from localhost ([127.0.0.1]:36936 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mb3QN-0004xo-9l
	for submit <at> debbugs.gnu.org; Thu, 14 Oct 2021 12:17:43 -0400
Received: from relay8-d.mail.gandi.net ([217.70.183.201]:40295)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1mb3QM-0004xa-71
 for 51173 <at> debbugs.gnu.org; Thu, 14 Oct 2021 12:17:42 -0400
Received: (Authenticated sender: juri@HIDDEN)
 by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id E47511BF205;
 Thu, 14 Oct 2021 16:17:33 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#51173: 28.0.60; gnus-article-describe-key doesn't work
Organization: LINKOV.NET
References: <b4mczo9hgyb.fsf@HIDDEN> <87h7dl6spg.fsf@HIDDEN>
 <87r1cox4th.fsf@HIDDEN> <87h7dkx2g5.fsf@HIDDEN>
 <jwv35p4pus6.fsf-monnier+emacs@HIDDEN>
Date: Thu, 14 Oct 2021 19:16:40 +0300
In-Reply-To: <jwv35p4pus6.fsf-monnier+emacs@HIDDEN> (Stefan Monnier's message
 of "Wed, 13 Oct 2021 16:01:51 -0400")
Message-ID: <87r1cnio3j.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 51173
Cc: Lars Ingebrigtsen <larsi@HIDDEN>, Katsumi Yamaoka <yamaoka@HIDDEN>,
 51173 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>> +         (defn (if (consp event)
>> +                   (save-excursion
>> +                     (mouse-set-point event) (key-binding key t))
>> +                 (key-binding key t))))
>>      ;; Handle the case where we faked an entry in "Select and Paste" menu.
>>      (when (and (eq defn nil)
>>  	       (stringp (aref key (1- (length key))))
>
> But this will still use "the wrong buffer" for mouse clicks, no?

It seems all mouse clicks expect the buffer where they were clicked
to be displayed in a window.  I can't imagine how a mouse click
could originate from a hidden buffer.

> BTW, maybe a cleaner fix would be as follows:
> - Add a `buffer` argument to `describe-key(-briefly)`.
> - Pass that argument from `gnus-article-describe-key`.
> And to get the behavior that Juri just pushed that `buffer` argument
> would default to (if (consp event) (window-buffer (posn-window
> (event-start event))) (current-buffere)).

I don't know.  All reported cases work now after Eli fixed
mouse-minibuffer-check not to raise an error when called from
mouse-set-point, so now it's safe to use it in help--analyze-key.




Information forwarded to bug-gnu-emacs@HIDDEN, bugs@HIDDEN:
bug#51173; Package emacs,gnus. Full text available.

Message received at 51173 <at> debbugs.gnu.org:


Received: (at 51173) by debbugs.gnu.org; 13 Oct 2021 20:02:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 13 16:02:03 2021
Received: from localhost ([127.0.0.1]:33634 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1makRv-0003gm-DS
	for submit <at> debbugs.gnu.org; Wed, 13 Oct 2021 16:02:03 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:40490)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1makRs-0003fr-GT
 for 51173 <at> debbugs.gnu.org; Wed, 13 Oct 2021 16:02:02 -0400
Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 7D68B80303;
 Wed, 13 Oct 2021 16:01:54 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 22E9A80084;
 Wed, 13 Oct 2021 16:01:53 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1634155313;
 bh=t6yXDhzybtpvQYJsQOkiQORE2F9kUd2ySKxVjrNL9xE=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=S3bgyw83vwzkRJMIvgxPfWjW5fEEpCtSBML9lCWHZxwNJtaQR+JThd+Ji2aG5/ylB
 NQC0fvo2Zs+QH3Mpv1YyKHl/0SUK8YYspkJyLtZcU8zWQrcXSS+F/o7+YC2rjIgTaU
 x0erMQAV9uGLamhtA5+d6JcvQqKjZBd9CbMmVuDrHhBl9s/bSnqzCNoo41TyszwR9c
 nOH2xS+YuabtkweTGI2YB/XrxJVtxRDn1ZpKo6j0dmV9vGYFy9zpav7JFXepAkzhnZ
 hATEsUMrdMmWH0HbxaXhPlzgsVL0LKUVFWu3UROY6DOUM2tGd4BjL16BcSPi8l73rn
 UfudhtOJOztLw==
Received: from pastel (unknown [45.72.241.23])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 9BEBA1203B5;
 Wed, 13 Oct 2021 16:01:52 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#51173: 28.0.60; gnus-article-describe-key doesn't work
Message-ID: <jwv35p4pus6.fsf-monnier+emacs@HIDDEN>
References: <b4mczo9hgyb.fsf@HIDDEN> <87h7dl6spg.fsf@HIDDEN>
 <87r1cox4th.fsf@HIDDEN> <87h7dkx2g5.fsf@HIDDEN>
Date: Wed, 13 Oct 2021 16:01:51 -0400
In-Reply-To: <87h7dkx2g5.fsf@HIDDEN> (Juri Linkov's message of "Wed, 
 13 Oct 2021 20:24:42 +0300")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.066 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 51173
Cc: Lars Ingebrigtsen <larsi@HIDDEN>, Katsumi Yamaoka <yamaoka@HIDDEN>,
 51173 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

>> I think this is mea culpa - commit 2d1564103e.
>> It was changed to handle context menu clicks
>> in the displayed window.
>
> This patch should handle only mouse events specially:
>
> diff --git a/lisp/help.el b/lisp/help.el
> index fa4eaee417..956a3d0d32 100644
> --- a/lisp/help.el
> +++ b/lisp/help.el
> @@ -699,7 +699,10 @@ help--analyze-key
>           ;; is selected from the context menu that should describe KEY
>           ;; at the position of mouse click that opened the context menu.
>           ;; When no mouse was involved, it defaults to window-point.
> -	 (defn (save-excursion (mouse-set-point event) (key-binding key t))))
> +         (defn (if (consp event)
> +                   (save-excursion
> +                     (mouse-set-point event) (key-binding key t))
> +                 (key-binding key t))))
>      ;; Handle the case where we faked an entry in "Select and Paste" menu.
>      (when (and (eq defn nil)
>  	       (stringp (aref key (1- (length key))))

But this will still use "the wrong buffer" for mouse clicks, no?

BTW, maybe a cleaner fix would be as follows:
- Add a `buffer` argument to `describe-key(-briefly)`.
- Pass that argument from `gnus-article-describe-key`.
And to get the behavior that Juri just pushed that `buffer` argument
would default to (if (consp event) (window-buffer (posn-window
(event-start event))) (current-buffere)).


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN, bugs@HIDDEN:
bug#51173; Package emacs,gnus. Full text available.
bug marked as fixed in version 28.0.60, send any further explanations to 51173 <at> debbugs.gnu.org and Katsumi Yamaoka <yamaoka@HIDDEN> Request was from Juri Linkov <juri@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 51173 <at> debbugs.gnu.org:


Received: (at 51173) by debbugs.gnu.org; 13 Oct 2021 19:19:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 13 15:19:20 2021
Received: from localhost ([127.0.0.1]:33485 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1majma-0007zn-3t
	for submit <at> debbugs.gnu.org; Wed, 13 Oct 2021 15:19:20 -0400
Received: from relay11.mail.gandi.net ([217.70.178.231]:45391)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>)
 id 1majmX-0007zL-KL; Wed, 13 Oct 2021 15:19:18 -0400
Received: (Authenticated sender: juri@HIDDEN)
 by relay11.mail.gandi.net (Postfix) with ESMTPSA id 0508F100002;
 Wed, 13 Oct 2021 19:19:08 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#51173: 28.0.60; gnus-article-describe-key doesn't work
Organization: LINKOV.NET
References: <b4mczo9hgyb.fsf@HIDDEN> <87h7dl6spg.fsf@HIDDEN>
 <87r1cox4th.fsf@HIDDEN> <87h7dkx2g5.fsf@HIDDEN>
 <87k0ig3gll.fsf@HIDDEN>
Date: Wed, 13 Oct 2021 22:18:01 +0300
In-Reply-To: <87k0ig3gll.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Wed,
 13 Oct 2021 20:49:26 +0200")
Message-ID: <87ee8o91jq.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 51173
Cc: Katsumi Yamaoka <yamaoka@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>, 51173 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

close 51173 28.0.60
quit

>> This patch should handle only mouse events specially:
>
> The patch makes both the with-temp-buffer test case as well as `C-h k'
> work in Gnus article buffers, so it seems to fix the problem.

So now pushed to emacs-28.




Information forwarded to bug-gnu-emacs@HIDDEN, bugs@HIDDEN:
bug#51173; Package emacs,gnus. Full text available.

Message received at 51173 <at> debbugs.gnu.org:


Received: (at 51173) by debbugs.gnu.org; 13 Oct 2021 18:49:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 13 14:49:42 2021
Received: from localhost ([127.0.0.1]:33425 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1majJu-0006ey-4M
	for submit <at> debbugs.gnu.org; Wed, 13 Oct 2021 14:49:42 -0400
Received: from quimby.gnus.org ([95.216.78.240]:54688)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1majJr-0006eV-FE
 for 51173 <at> debbugs.gnu.org; Wed, 13 Oct 2021 14:49:40 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=+qYEyko8pVELG7Nir+tXGlEO6c3zQ1fbeYw94IrzWzk=; b=lABkUEtqHaRStw7oUl09KCIlLG
 9PtYCZqPlmFsmmH2ta1+yImaIm8XuuPuBrjfJpOrkQjtnuOwS4MURBVDLIEadzWwt7VjZ0bZAjWRv
 g0dR/uRF46xkYwxBfmMfPjdQEuXSMpX8feBTYKpOAy/xc9geH50EDhy7tqIPnPpwZ9lU=;
Received: from [84.212.220.105] (helo=elva)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1majJf-0002Sp-OI; Wed, 13 Oct 2021 20:49:30 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#51173: 28.0.60; gnus-article-describe-key doesn't work
References: <b4mczo9hgyb.fsf@HIDDEN> <87h7dl6spg.fsf@HIDDEN>
 <87r1cox4th.fsf@HIDDEN> <87h7dkx2g5.fsf@HIDDEN>
X-Now-Playing: Dntel's _Away_: "Fleeting Feeling"
Date: Wed, 13 Oct 2021 20:49:26 +0200
In-Reply-To: <87h7dkx2g5.fsf@HIDDEN> (Juri Linkov's message of "Wed, 
 13 Oct 2021 20:24:42 +0300")
Message-ID: <87k0ig3gll.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Juri Linkov <juri@HIDDEN> writes: > This patch should
 handle only mouse events specially: The patch makes both the with-temp-buffer
 test case as well as `C-h k' work in Gnus article buffers, so it seems to
 fix the problem. 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 51173
Cc: Katsumi Yamaoka <yamaoka@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>, 51173 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Juri Linkov <juri@HIDDEN> writes:

> This patch should handle only mouse events specially:

The patch makes both the with-temp-buffer test case as well as `C-h k'
work in Gnus article buffers, so it seems to fix the problem.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN, bugs@HIDDEN:
bug#51173; Package emacs,gnus. Full text available.

Message received at 51173 <at> debbugs.gnu.org:


Received: (at 51173) by debbugs.gnu.org; 13 Oct 2021 17:33:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 13 13:33:16 2021
Received: from localhost ([127.0.0.1]:33303 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mai7w-0001fN-EA
	for submit <at> debbugs.gnu.org; Wed, 13 Oct 2021 13:33:16 -0400
Received: from relay1-d.mail.gandi.net ([217.70.183.193]:57019)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1mai7u-0001ev-Cr
 for 51173 <at> debbugs.gnu.org; Wed, 13 Oct 2021 13:33:15 -0400
Received: (Authenticated sender: juri@HIDDEN)
 by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id E530324000A;
 Wed, 13 Oct 2021 17:33:04 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#51173: 28.0.60; gnus-article-describe-key doesn't work
Organization: LINKOV.NET
References: <b4mczo9hgyb.fsf@HIDDEN> <87h7dl6spg.fsf@HIDDEN>
 <87r1cox4th.fsf@HIDDEN>
Date: Wed, 13 Oct 2021 20:24:42 +0300
In-Reply-To: <87r1cox4th.fsf@HIDDEN> (Juri Linkov's message of "Wed, 
 13 Oct 2021 19:33:30 +0300")
Message-ID: <87h7dkx2g5.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 51173
Cc: Katsumi Yamaoka <yamaoka@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>, 51173 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

> I think this is mea culpa - commit 2d1564103e.
> It was changed to handle context menu clicks
> in the displayed window.

This patch should handle only mouse events specially:

diff --git a/lisp/help.el b/lisp/help.el
index fa4eaee417..956a3d0d32 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -699,7 +699,10 @@ help--analyze-key
          ;; is selected from the context menu that should describe KEY
          ;; at the position of mouse click that opened the context menu.
          ;; When no mouse was involved, it defaults to window-point.
-	 (defn (save-excursion (mouse-set-point event) (key-binding key t))))
+         (defn (if (consp event)
+                   (save-excursion
+                     (mouse-set-point event) (key-binding key t))
+                 (key-binding key t))))
     ;; Handle the case where we faked an entry in "Select and Paste" menu.
     (when (and (eq defn nil)
 	       (stringp (aref key (1- (length key))))
-- 




Information forwarded to bug-gnu-emacs@HIDDEN, bugs@HIDDEN:
bug#51173; Package emacs,gnus. Full text available.

Message received at 51173 <at> debbugs.gnu.org:


Received: (at 51173) by debbugs.gnu.org; 13 Oct 2021 16:35:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 13 12:35:46 2021
Received: from localhost ([127.0.0.1]:33188 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mahEI-0006Jc-I0
	for submit <at> debbugs.gnu.org; Wed, 13 Oct 2021 12:35:46 -0400
Received: from relay6-d.mail.gandi.net ([217.70.183.198]:44037)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1mahEG-0006JC-8e
 for 51173 <at> debbugs.gnu.org; Wed, 13 Oct 2021 12:35:44 -0400
Received: (Authenticated sender: juri@HIDDEN)
 by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 63AB3C0008;
 Wed, 13 Oct 2021 16:35:34 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#51173: 28.0.60; gnus-article-describe-key doesn't work
Organization: LINKOV.NET
References: <b4mczo9hgyb.fsf@HIDDEN> <87h7dl6spg.fsf@HIDDEN>
Date: Wed, 13 Oct 2021 19:33:30 +0300
In-Reply-To: <87h7dl6spg.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Wed,
 13 Oct 2021 13:59:39 +0200")
Message-ID: <87r1cox4th.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 51173
Cc: Katsumi Yamaoka <yamaoka@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>, 51173 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>> The following example program returns `sh-case' on Emacs 27 and
>> olders, however to make it work on Emacs 28 and 29 the third
>> line has to be uncommented.  So does `describe-key' case.
>>
>> (with-temp-buffer
>>   (sh-mode)
>>   ;;(set-window-buffer nil (current-buffer))
>>   (describe-key-briefly "\C-c\C-c"))
>>
>> I don't know when/why those commands were changed to require the
>> buffer (where the keymap is) to be visited in the selected window,
>> but now `gnus-article-describe-key\(-briefly\)?' doesn't work
>> because of this.  A patch to gnus-art.el is attached, though the
>> one that should be fixed might be help.el.
>
> I think this sounds like a bug in describe-key*, so perhaps it should be
> fixed there?  Looking at the history, I'm not at all sure what caused
> this regression, but perhaps it's:
>
> commit 9d4af3e6bdfac374f6c9591566c010e6a1514751
> Author:     Stefan Monnier <monnier@HIDDEN>
> AuthorDate: Tue Jan 30 11:57:40 2018 -0500
>
> I've added Stefan to the CCs.

I think this is mea culpa - commit 2d1564103e.
It was changed to handle context menu clicks
in the displayed window.




Information forwarded to bug-gnu-emacs@HIDDEN, bugs@HIDDEN:
bug#51173; Package emacs,gnus. Full text available.

Message received at 51173 <at> debbugs.gnu.org:


Received: (at 51173) by debbugs.gnu.org; 13 Oct 2021 11:59:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 13 07:59:53 2021
Received: from localhost ([127.0.0.1]:58752 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1macvI-00076R-MZ
	for submit <at> debbugs.gnu.org; Wed, 13 Oct 2021 07:59:52 -0400
Received: from quimby.gnus.org ([95.216.78.240]:49894)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1macvG-000767-B3
 for 51173 <at> debbugs.gnu.org; Wed, 13 Oct 2021 07:59:50 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=F4fGlABfiTeTLO9P85XoLX/NbRlif5RKR7Kzc7yJIKA=; b=p8VNUvgj6sEOm+rrqALx9uSwpc
 uRbcNCNxJiODJAnN9aU7Elsl6OouMecIsGEFOybcz9aV3q48+1rkhaapGp7c//wwYR8OZFMUbMxmO
 mYIjZ8wzrVK8F9VL91ENHpo9WsPSg2coPZjsUxnKYW2iiOwbVmA273M6q+N/1lY+H6NE=;
Received: from [84.212.220.105] (helo=elva)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1macv5-0007sd-Iv; Wed, 13 Oct 2021 13:59:42 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Katsumi Yamaoka <yamaoka@HIDDEN>
Subject: Re: bug#51173: 28.0.60; gnus-article-describe-key doesn't work
References: <b4mczo9hgyb.fsf@HIDDEN>
X-Now-Playing: Sylvester's _Sylvester-Step II_: "I Took My Strength From You"
Date: Wed, 13 Oct 2021 13:59:39 +0200
In-Reply-To: <b4mczo9hgyb.fsf@HIDDEN> (Katsumi Yamaoka's message of "Wed, 13
 Oct 2021 10:05:48 +0900")
Message-ID: <87h7dl6spg.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Katsumi Yamaoka <yamaoka@HIDDEN> writes: > The following
 example program returns `sh-case' on Emacs 27 and > olders, however to make
 it work on Emacs 28 and 29 the third > line has to be uncommented. So does
 `describe-key' case. > > (with-te [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 51173
Cc: Stefan Monnier <monnier@HIDDEN>, 51173 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Katsumi Yamaoka <yamaoka@HIDDEN> writes:

> The following example program returns `sh-case' on Emacs 27 and
> olders, however to make it work on Emacs 28 and 29 the third
> line has to be uncommented.  So does `describe-key' case.
>
> (with-temp-buffer
>   (sh-mode)
>   ;;(set-window-buffer nil (current-buffer))
>   (describe-key-briefly "\C-c\C-c"))
>
> I don't know when/why those commands were changed to require the
> buffer (where the keymap is) to be visited in the selected window,
> but now `gnus-article-describe-key\(-briefly\)?' doesn't work
> because of this.  A patch to gnus-art.el is attached, though the
> one that should be fixed might be help.el.

I think this sounds like a bug in describe-key*, so perhaps it should be
fixed there?  Looking at the history, I'm not at all sure what caused
this regression, but perhaps it's:

commit 9d4af3e6bdfac374f6c9591566c010e6a1514751
Author:     Stefan Monnier <monnier@HIDDEN>
AuthorDate: Tue Jan 30 11:57:40 2018 -0500

I've added Stefan to the CCs.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN, bugs@HIDDEN:
bug#51173; Package emacs,gnus. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 13 Oct 2021 01:06:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 12 21:06:02 2021
Received: from localhost ([127.0.0.1]:56473 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1maSiX-0005yv-Pm
	for submit <at> debbugs.gnu.org; Tue, 12 Oct 2021 21:06:02 -0400
Received: from lists.gnu.org ([209.51.188.17]:52180)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yamaoka@HIDDEN>) id 1maSiV-0005yg-SZ
 for submit <at> debbugs.gnu.org; Tue, 12 Oct 2021 21:06:00 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:40102)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <yamaoka@HIDDEN>) id 1maSiV-0005qy-O7
 for bug-gnu-emacs@HIDDEN; Tue, 12 Oct 2021 21:05:59 -0400
Received: from bumble.maple.relay.mailchannels.net ([23.83.214.25]:54263)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <yamaoka@HIDDEN>) id 1maSiT-0006tv-VO
 for bug-gnu-emacs@HIDDEN; Tue, 12 Oct 2021 21:05:59 -0400
X-Sender-Id: tih5qno0ow|x-authuser|yamaoka@HIDDEN
Received: from relay.mailchannels.net (localhost [127.0.0.1])
 by relay.mailchannels.net (Postfix) with ESMTP id 274A43624EE;
 Wed, 13 Oct 2021 01:05:55 +0000 (UTC)
Received: from cloud1.hostforweb.net
 (100-96-16-65.trex.outbound.svc.cluster.local [100.96.16.65])
 (Authenticated sender: tih5qno0ow)
 by relay.mailchannels.net (Postfix) with ESMTPA id 6B15D361DEB;
 Wed, 13 Oct 2021 01:05:54 +0000 (UTC)
X-Sender-Id: tih5qno0ow|x-authuser|yamaoka@HIDDEN
Received: from cloud1.hostforweb.net (cloud1.hostforweb.net [154.16.119.57])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384)
 by 100.96.16.65 (trex/6.4.3); Wed, 13 Oct 2021 01:05:54 +0000
X-MC-Relay: Neutral
X-MailChannels-SenderId: tih5qno0ow|x-authuser|yamaoka@HIDDEN
X-MailChannels-Auth-Id: tih5qno0ow
X-Little-Absorbed: 5fa7b8071f62714a_1634087154828_4009521334
X-MC-Loop-Signature: 1634087154828:1237495975
X-MC-Ingress-Time: 1634087154828
Received: from [157.205.200.190] (port=64231 helo=localhost)
 by cloud1.hostforweb.net with esmtpsa (TLS1.2) tls
 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2)
 (envelope-from <yamaoka@HIDDEN>)
 id 1maSiO-005iIr-Mz; Tue, 12 Oct 2021 21:05:53 -0400
Date: Wed, 13 Oct 2021 10:05:48 +0900
Message-ID: <b4mczo9hgyb.fsf@HIDDEN>
From: Katsumi Yamaoka <yamaoka@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 28.0.60; gnus-article-describe-key doesn't work
Organization: Emacsen advocacy group
X-Face: #kKnN,xUnmKia.'[pp`;
 Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk
 B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu; B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw=
 L&i*6&(
X-Debbugs-Package: emacs,gnus
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (x86_64-pc-cygwin)
Cancel-Lock: sha1:wABadqWskSMbrocvm+POLBvPFlc=
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-AuthUser: yamaoka@HIDDEN
Received-SPF: pass client-ip=23.83.214.25; envelope-from=yamaoka@HIDDEN;
 helo=bumble.maple.relay.mailchannels.net
X-Spam_score_int: -18
X-Spam_score: -1.9
X-Spam_bar: -
X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001,
 RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
 T_TVD_MIME_NO_HEADERS=0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.4 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)

--=-=-=

Hi,

The following example program returns `sh-case' on Emacs 27 and
olders, however to make it work on Emacs 28 and 29 the third
line has to be uncommented.  So does `describe-key' case.

(with-temp-buffer
  (sh-mode)
  ;;(set-window-buffer nil (current-buffer))
  (describe-key-briefly "\C-c\C-c"))

I don't know when/why those commands were changed to require the
buffer (where the keymap is) to be visited in the selected window,
but now `gnus-article-describe-key\(-briefly\)?' doesn't work
because of this.  A patch to gnus-art.el is attached, though the
one that should be fixed might be help.el.

Thanks.

--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline

--- gnus-art.el~	2021-10-06 01:11:50.777999500 +0000
+++ gnus-art.el	2021-10-13 01:04:18.073219200 +0000
@@ -6854,19 +6854,24 @@
 		       (read-key-sequence "Describe key: ")))
 	       gnus-article-mode)
   (gnus-article-check-buffer)
-  (if (memq (key-binding key t) '(gnus-article-read-summary-keys
-				  gnus-article-read-summary-send-keys))
-      (with-current-buffer gnus-article-current-summary
-	(setq unread-command-events
-	      (nconc
-	       (mapcar (lambda (x) (if (and (integerp x) (>= x 128))
-				       (list 'meta (- x 128))
-				     x))
-		       key)
-	       unread-command-events))
-	(let ((cursor-in-echo-area t)
-	      gnus-pick-mode)
-	  (describe-key (read-key-sequence nil t))))
+  (if (and (memq (key-binding key t) '(gnus-article-read-summary-keys
+				       gnus-article-read-summary-send-keys))
+	   (buffer-live-p gnus-article-current-summary))
+      (let ((artbuf (current-buffer)))
+	(unwind-protect
+	    (progn
+	      (set-window-buffer nil gnus-article-current-summary)
+	      (setq unread-command-events
+		    (nconc
+		     (mapcar (lambda (x) (if (and (integerp x) (>= x 128))
+					     (list 'meta (- x 128))
+					   x))
+			     key)
+		     unread-command-events))
+	      (let ((cursor-in-echo-area t)
+		    gnus-pick-mode)
+		(describe-key (read-key-sequence nil t))))
+	  (set-window-buffer nil artbuf)))
     (describe-key key)))
 
 (defun gnus-article-describe-key-briefly (key &optional insert)
@@ -6877,19 +6882,24 @@
 		     current-prefix-arg)
 	       gnus-article-mode)
   (gnus-article-check-buffer)
-  (if (memq (key-binding key t) '(gnus-article-read-summary-keys
-				  gnus-article-read-summary-send-keys))
-      (with-current-buffer gnus-article-current-summary
-	(setq unread-command-events
-	      (nconc
-	       (mapcar (lambda (x) (if (and (integerp x) (>= x 128))
-				       (list 'meta (- x 128))
-				     x))
-		       key)
-	       unread-command-events))
-	(let ((cursor-in-echo-area t)
-	      gnus-pick-mode)
-	  (describe-key-briefly (read-key-sequence nil t) insert)))
+  (if (and (memq (key-binding key t) '(gnus-article-read-summary-keys
+				       gnus-article-read-summary-send-keys))
+	   (buffer-live-p gnus-article-current-summary))
+      (let ((artbuf (current-buffer)))
+	(unwind-protect
+	    (progn
+	      (set-window-buffer nil gnus-article-current-summary)
+	      (setq unread-command-events
+		    (nconc
+		     (mapcar (lambda (x) (if (and (integerp x) (>= x 128))
+					     (list 'meta (- x 128))
+					   x))
+			     key)
+		     unread-command-events))
+	      (let ((cursor-in-echo-area t)
+		    gnus-pick-mode)
+		(describe-key-briefly (read-key-sequence nil t) insert)))
+	  (set-window-buffer nil artbuf)))
     (describe-key-briefly key insert)))
 
 ;;`gnus-agent-mode' in gnus-agent.el will define it.

--=-=-=--




Acknowledgement sent to Katsumi Yamaoka <yamaoka@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN, bugs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN, bugs@HIDDEN:
bug#51173; Package emacs,gnus. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 29 Nov 2021 18:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.