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: Mon, 29 Nov 2021 20:49:12 +0200 Organization: LINKOV.NET Message-ID: <86o862re53.fsf@mail.linkov.net> References: <87h7dl6spg.fsf@gnus.org> <87r1cox4th.fsf@mail.linkov.net> <87h7dkx2g5.fsf@mail.linkov.net> <87r1cm3hqb.fsf@mail.linkov.net> <87h7dgg8go.fsf@mail.linkov.net> <87ilxumi07.fsf@mail.linkov.net> <87sfwvy411.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37091"; 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: 51173@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 29 20:02:19 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 1mrlus-0009Pr-Gw for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 29 Nov 2021 20:02:18 +0100 Original-Received: from localhost ([::1]:47792 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mrlur-0004Ll-7Z for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 29 Nov 2021 14:02:17 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:56052) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mrlsh-000252-1T for bug-gnu-emacs@gnu.org; Mon, 29 Nov 2021 14:00:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56080) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mrlsg-0007XN-MB for bug-gnu-emacs@gnu.org; Mon, 29 Nov 2021 14:00:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mrlsg-0000Hz-Es; Mon, 29 Nov 2021 14:00:02 -0500 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: Mon, 29 Nov 2021 19:00: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.16382123431011 (code B ref 51173); Mon, 29 Nov 2021 19:00:02 +0000 Original-Received: (at 51173) by debbugs.gnu.org; 29 Nov 2021 18:59:03 +0000 Original-Received: from localhost ([127.0.0.1]:39393 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mrlrf-0000Fv-UO for submit@debbugs.gnu.org; Mon, 29 Nov 2021 13:59:03 -0500 Original-Received: from relay10.mail.gandi.net ([217.70.178.230]:47115) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mrlrd-0000Ff-BX for 51173@debbugs.gnu.org; Mon, 29 Nov 2021 13:58:58 -0500 Original-Received: (Authenticated sender: juri@linkov.net) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 57C36240005; Mon, 29 Nov 2021 18:58:47 +0000 (UTC) In-Reply-To: (Stefan Monnier's message of "Thu, 21 Oct 2021 12:43:10 -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:221069 Archived-At: --=-=-= Content-Type: text/plain >>>>>> 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, Oh, another regression: C-s ;; isearch-forward C-h k ;; isearch-describe-key then typing any key to describe in isearch-mode leaves isearch in a broken state: it displays the search prompt, but no isearch indicator on the mode-line. So something exits isearch. Adding a breakpoint in isearch-done reveals this backtrace: isearch-done() isearch-mouse-leave-buffer() mouse-minibuffer-check(19) mouse-set-point(19) help--analyze-key("\23" [19] nil) describe-key((("\23" . [19]))) funcall-interactively(describe-key (("\23" . [19]))) isearch-describe-key() funcall-interactively(isearch-describe-key) command-execute(isearch-describe-key) I don't know if more functions using describe-key are broken, but copying the same code from gnus-article-describe-key that gives the buffer argument to describe-key fixes this. I have no idea for a better way to avoid such problems. More precautions are added to this patch: when isearch-mouse-commands contains isearch-describe-key, isearch-mouse-leave-buffer won't leave isearch-mode. Also to avoid a broken state, isearch-update should be used only when isearch-mode is active: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=isearch-describe-key.patch diff --git a/lisp/isearch.el b/lisp/isearch.el index 0a041b7a1e..043d2c016e 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -525,15 +525,17 @@ isearch-describe-key "Display documentation of the function invoked by isearch key." (interactive) (let ((display-buffer-overriding-action isearch--display-help-action)) - (call-interactively 'describe-key)) - (isearch-update)) + (describe-key (list (cons (read-key-sequence nil t) + (this-single-command-raw-keys))) + (current-buffer))) + (when isearch-mode (isearch-update))) (defun isearch-describe-mode () "Display documentation of Isearch mode." (interactive) (let ((display-buffer-overriding-action isearch--display-help-action)) (describe-function 'isearch-forward)) - (isearch-update)) + (when isearch-mode (isearch-update))) (defalias 'isearch-mode-help 'isearch-describe-mode) @@ -1498,7 +1500,7 @@ isearch-done (and (not edit) isearch-recursive-edit (exit-recursive-edit))) -(defvar isearch-mouse-commands '(mouse-minor-mode-menu) +(defvar isearch-mouse-commands '(mouse-minor-mode-menu isearch-describe-key) "List of mouse commands that are allowed during Isearch.") (defun isearch-mouse-leave-buffer () --=-=-=--