From unknown Fri Jun 20 07:15:27 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#55393 <55393@debbugs.gnu.org> To: bug#55393 <55393@debbugs.gnu.org> Subject: Status: describe-keymap: suggest symbol at point Reply-To: bug#55393 <55393@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:15:27 +0000 retitle 55393 describe-keymap: suggest symbol at point reassign 55393 emacs submitter 55393 Visuwesh severity 55393 normal tag 55393 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Fri May 13 00:05:56 2022 Received: (at submit) by debbugs.gnu.org; 13 May 2022 04:05:56 +0000 Received: from localhost ([127.0.0.1]:42688 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npMYu-00067k-Cz for submit@debbugs.gnu.org; Fri, 13 May 2022 00:05:56 -0400 Received: from lists.gnu.org ([209.51.188.17]:60260) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npMYs-00067c-H3 for submit@debbugs.gnu.org; Fri, 13 May 2022 00:05:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54762) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npMYs-0000LU-C5 for bug-gnu-emacs@gnu.org; Fri, 13 May 2022 00:05:54 -0400 Received: from mail-pj1-x1042.google.com ([2607:f8b0:4864:20::1042]:37393) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1npMYq-0006dx-Id for bug-gnu-emacs@gnu.org; Fri, 13 May 2022 00:05:54 -0400 Received: by mail-pj1-x1042.google.com with SMTP id t11-20020a17090ad50b00b001d95bf21996so9706613pju.2 for ; Thu, 12 May 2022 21:05:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version; bh=TJFUkXjsmIvnLD3YGpjNxAw/ddtif7ib07xu9M2rWkQ=; b=bGlZHnnxkSJ6CzoA52CHy2dTva/QikIOfKjGTlbI4XEqpeUNBlj/GhKTTHf/2lYhrK P/kdMYx/aBj2eHWUYwNYZ9Ok23r7IN515FZPJmeVUSDrygxxBT03QZLps/BRYzj6frEm JdwY3qo3QODfiYFI8/WhKvQLJjjPDYu5uR+cpny4Y/ebXGsLDRIi7JLyhb1lA2Isljff x1jO/PHHLU2iIV9o7JbtHQ0poBC5P3nOhr8CKCgTyWXxyJbDD+q0zL9nzMK3clyUKmjq 4I8MOrChMlSwxZL/QlWty6XN7Hud3FiXNj/Xdyh+LmQiwSGtTzYISItlMVKGtT8qXXeE TRaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=TJFUkXjsmIvnLD3YGpjNxAw/ddtif7ib07xu9M2rWkQ=; b=TZrumVcu2z4/lMRLd0UsX+M6ReVAEn9Y+QRu4PEy+JMNY2/u/Y0B7aMCkNGVlWicpX QbwUIOrFj+FxNZqlUXYx5u71PVVVry4VK3jYgVpRfOK4tnNcqbbnnCMFHNJSUCQ/pUO8 XXlLhz5KoZv+OKs0KOTa2Ev9jeLh+utSh6Fi8CEC1ZK8Zky8aMdAOAtimWuliTh+imi9 aPIPx2+1OYQPvtrjedB/bjcWWGwlCdVSTyulkh4JXr4BuwVAtErlYaoNOvvqxZYSxdKf QKx2491UV0NxLqumF4nn9X/F+SmYjXDY8M+B+SKT2jQXByH3SEe2/B71HUwvXTOPfOhY JaKQ== X-Gm-Message-State: AOAM532QRTGLNF3cDrF82qINhlhG/PuwfNAc5rITiGiouUzhFicjSpwM /IyeW4ZoWkwg9KG/NjCvlN//AGgtKog= X-Google-Smtp-Source: ABdhPJw693U4Zgr7atTr9rZH0xCbOQYvQ9MP7YhbNol9jCzHcJ+5BAkVuSnj20pZXXrvq4++s7Cdkg== X-Received: by 2002:a17:902:db05:b0:15e:b542:3f23 with SMTP id m5-20020a170902db0500b0015eb5423f23mr3028102plx.143.1652414750502; Thu, 12 May 2022 21:05:50 -0700 (PDT) Received: from localhost ([49.204.118.33]) by smtp.gmail.com with ESMTPSA id p187-20020a625bc4000000b0050dc76281basm611148pfb.148.2022.05.12.21.05.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 May 2022 21:05:49 -0700 (PDT) From: Visuwesh To: bug-gnu-emacs@gnu.org Subject: describe-keymap: suggest symbol at point Date: Fri, 13 May 2022 09:35:25 +0530 Message-ID: <87pmki13i2.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::1042; envelope-from=visuweshm@gmail.com; helo=mail-pj1-x1042.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain Tags: patch describe-keymap differs from other describe-* commands in that it does not suggest the symbol at point which always annoyed me. This patch makes describe-keymap consider the symbol at point first. [ I hope it is okay to use if-let family of macros in these files now? ] --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-describe-keymap-Suggest-symbol-at-point.patch >From 84dbe9924269c2c5e2fb73aadc82536e48e81820 Mon Sep 17 00:00:00 2001 From: Visuwesh Date: Fri, 13 May 2022 09:20:18 +0530 Subject: [PATCH] describe-keymap: Suggest symbol at point * lisp/help-fns.el (help-fns--most-relevant-active-keymap): Suggest the symbol at point if it is a keymap. * etc/NEWS: Announce the change. --- etc/NEWS | 5 +++++ lisp/help-fns.el | 17 +++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 273fa77640..251ebc46ce 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -363,6 +363,11 @@ These will take you (respectively) to the next and previous "page". This will take you to the Emacs Lisp manual entry for the item displayed, if any. +--- +*** 'describe-keymap' now considers the symbol at point. +'describe-keymap' suggests the symbol at point as the default +candidate if it is a keymap. + ** Outline Mode *** Support for customizing the default visibility state of headings. diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 80d7d5cb02..3836cc7367 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -1779,16 +1779,21 @@ help-fns--most-relevant-active-keymap The heuristic to determine which keymap is most likely to be relevant to a user follows this order: -1. 'keymap' text property at point -2. 'local-map' text property at point -3. the `current-local-map' +1. symbol at point +2. 'keymap' text property at point +3. 'local-map' text property at point +4. the `current-local-map' This is used to set the default value for the interactive prompt in `describe-keymap'. See also `Searching the Active Keymaps'." - (help-fns-find-keymap-name (or (get-char-property (point) 'keymap) - (if (get-text-property (point) 'local-map) + (if-let ((sym (symbol-at-point)) + (sym (when sym (intern-soft sym))) + (keymapp (ignore-errors (symbol-value sym)))) + sym + (help-fns-find-keymap-name (or (get-char-property (point) 'keymap) + (if (get-text-property (point) 'local-map) (get-char-property (point) 'local-map) - (current-local-map))))) + (current-local-map)))))) (defvar keymap-name-history nil "History for input to `describe-keymap'.") -- 2.33.1 --=-=-= Content-Type: text/plain In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw scroll bars) Repository revision: ca3858563c7ba8ee3caa82fbd2b7c386ea60c0d3 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12013000 System Description: NixOS 21.11 (Porcupine) Configured using: 'configure --prefix=/nix/store/iqqk7iqfwmfc6r78xg2knyq7hww2mhs4-emacs-git-20220225.0 --disable-build-details --with-modules --with-x-toolkit=lucid --with-xft --with-cairo --with-native-compilation' --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri May 13 01:24:48 2022 Received: (at 55393) by debbugs.gnu.org; 13 May 2022 05:24:48 +0000 Received: from localhost ([127.0.0.1]:42749 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npNnD-0008Uw-JK for submit@debbugs.gnu.org; Fri, 13 May 2022 01:24:48 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:43686) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npNn9-0008Ug-6d for 55393@debbugs.gnu.org; Fri, 13 May 2022 01:24:45 -0400 Received: by mail-pf1-f195.google.com with SMTP id d25so6731543pfo.10 for <55393@debbugs.gnu.org>; Thu, 12 May 2022 22:24:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version; bh=P/p306Tb7Ksr6iksoLT7//KUXJvJ2O2nKE8I9qzmFFs=; b=RItkBzoAZUlc6VOg+J/Ydnae5MIaaYNOGCtVZcpJDm93tsG+jooPx3NLlXw2Mm+KHE RvrTCGuNC2AZZ3QwaPGHeDxXi61nVPW5j/ZjkPEfMmlUhyDhNocsp6mmPtkSmnj6itTW K1dm3UGQYn7+Ksfl/uPOcRLABpf3uMjPZ6X6eEQOyBcEPe9Ft5REqDvV3rmx8pzm1kUv i4D5WHJKy6qQOCbJG6238cP8ykkKZXmrZqwECM5hVDr5NmUwDGshANXEnm6zqxqQ89PZ jlVULv5iZ99c6l4HlyekOuUruHuC2TpAweQmeoy1KaEFvLM5PaU1gCiDAcvH+k5h0X+p Le2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=P/p306Tb7Ksr6iksoLT7//KUXJvJ2O2nKE8I9qzmFFs=; b=QonnksLSitv+NW9lRL+loy+YZCfWQGpQEwKMZepuCtl4Y4bANmc+4+Sz3Jy5QBRADB 9juqavPv17KBnC/zyji6sqSGTg8B9wh2w1gIUxtQFiQzL4l77Dyj5Ic3PpIeEuUPNNRL AAOCPGAig8Kw134NEm99140yhLeuk782CFP+E9+IvgwieN00MWr32Lu3pUcVxyG5ny8T cIYkG05zrEJlgYJtSkysAuRwZYpVXO2mAmjmpl9rVoMKt3T+xYLdRPS3f9NkMZglVT5H RdrHduwuIYbP4oEbC8J4VDe2NNM2fweuXJdnEwK8Oj/LjBZDGDd81R9EXw8pRcRUG67K Lfuw== X-Gm-Message-State: AOAM530NoIBWxxmmobS1J0KizoPaGPZ1Ad+mmtRv31cCWam7TfS0BU8V OaA9UAH4CddPqPfAq113AReRg5jorQg= X-Google-Smtp-Source: ABdhPJwpr43h+gBW70zC8oVxLOLItSE536++GD+Zd8IG4D4KMj8v1tJ0rlCfHbzZqBzkpgAewXNDpQ== X-Received: by 2002:a63:8848:0:b0:3ab:2967:df83 with SMTP id l69-20020a638848000000b003ab2967df83mr2574921pgd.77.1652419476979; Thu, 12 May 2022 22:24:36 -0700 (PDT) Received: from localhost ([49.204.118.33]) by smtp.gmail.com with ESMTPSA id p9-20020a170902780900b0015e8d4eb294sm91139pll.222.2022.05.12.22.24.35 for <55393@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 May 2022 22:24:36 -0700 (PDT) From: Visuwesh To: 55393@debbugs.gnu.org Subject: Re: bug#55393: describe-keymap: suggest symbol at point References: <87pmki13i2.fsf@gmail.com> Date: Fri, 13 May 2022 10:54:12 +0530 In-Reply-To: <87pmki13i2.fsf@gmail.com> (Visuwesh's message of "Fri, 13 May 2022 09:35:25 +0530") Message-ID: <87lev60zur.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 55393 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable [=E0=AE=B5=E0=AF=86=E0=AE=B3=E0=AF=8D=E0=AE=B3=E0=AE=BF =E0=AE=AE=E0=AF=87 = 13, 2022] Visuwesh wrote: > Tags: patch > > describe-keymap differs from other describe-* commands in that it does > not suggest the symbol at point which always annoyed me. This patch > makes describe-keymap consider the symbol at point first. > > [ I hope it is okay to use if-let family of macros in these files now? ] > > > > > In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo vers= ion 1.16.0, Xaw scroll bars) > Repository revision: ca3858563c7ba8ee3caa82fbd2b7c386ea60c0d3 > Repository branch: master > Windowing system distributor 'The X.Org Foundation', version 11.0.12013000 > System Description: NixOS 21.11 (Porcupine) > > Configured using: > 'configure > --prefix=3D/nix/store/iqqk7iqfwmfc6r78xg2knyq7hww2mhs4-emacs-git-2022022= 5.0 > --disable-build-details --with-modules --with-x-toolkit=3Dlucid > --with-xft --with-cairo --with-native-compilation' Turns out I did not git pull master properly so that patch was against an old master. Updated patch attached here, --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-describe-keyap-Suggest-symbol-at-point.patch >From 1911ea3d4963bc945953886fb625db6c838f19cb Mon Sep 17 00:00:00 2001 From: Visuwesh Date: Fri, 13 May 2022 10:52:09 +0530 Subject: [PATCH] describe-keyap: Suggest symbol at point * lisp/help-fns.el (help-fns--most-relevant-active-keymap): Suggest the symbol at point if it is a keymap. * etc/NEWS: Announce the change. --- etc/NEWS | 5 +++++ lisp/help-fns.el | 19 ++++++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index e09834c..54647b8 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -562,6 +562,11 @@ minor modes are listed after the major mode. The apropos commands will now select the apropos window if 'help-window-select' is non-nil. +--- +*** 'describe-keymap' now considers the symbol at point +'describe-keymap' suggests the symbol at point as the default candidate +if it is a keymap. + ** Outline Mode +++ diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 927a4f0..2636ba9 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -1884,16 +1884,21 @@ variable with value KEYMAP." The heuristic to determine which keymap is most likely to be relevant to a user follows this order: -1. 'keymap' text property at point -2. 'local-map' text property at point -3. the `current-local-map' +1. symbol at point +2. 'keymap' text property at point +3. 'local-map' text property at point +4. the `current-local-map' This is used to set the default value for the interactive prompt in `describe-keymap'. See also `Searching the Active Keymaps'." - (help-fns-find-keymap-name (or (get-char-property (point) 'keymap) - (if (get-text-property (point) 'local-map) - (get-char-property (point) 'local-map) - (current-local-map))))) + (if-let ((sym (symbol-at-point)) + (sym (when sym (intern-soft sym))) + (keymapp (ignore-errors (symbol-value sym)))) + sym + (help-fns-find-keymap-name (or (get-char-property (point) 'keymap) + (if (get-text-property (point) 'local-map) + (get-char-property (point) 'local-map) + (current-local-map)))))) (defvar keymap-name-history nil "History for input to `describe-keymap'.") -- 2.33.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri May 13 02:23:08 2022 Received: (at 55393) by debbugs.gnu.org; 13 May 2022 06:23:08 +0000 Received: from localhost ([127.0.0.1]:42776 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npOhg-0001o8-4v for submit@debbugs.gnu.org; Fri, 13 May 2022 02:23:08 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48998) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npOhe-0001nf-RJ for 55393@debbugs.gnu.org; Fri, 13 May 2022 02:23:07 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55208) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npOhZ-0008C6-Hn; Fri, 13 May 2022 02:23:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=eZCybtNEiVcy8TGzWc+CGuk+tVYIKuHplfiVk4s0Log=; b=Nqk5hVNBD5Oy SXO9SXOFtsn1CP8SKh1iyYThAQsiEuSKldpaX21dgUShEL1d5gVwq/oL9bW4gGgAUGLu0p2rHl+7W a8xPuiLxSV5DWZzmzB0Wc9M5LcISESL15LpvFOJLWgGhS2oZjktG8SJBKRfM0Z5xNWTT+nfc5foMD izjxa8ATOzQjLhz5o6zweJyp2lHPC8ngzKiElRFTploQBBvbI4o/W1yMt6/Op7ajAHOr8AjaOSLed VEllCoK0WogomUj55udkrpoWnk1GFrpElhxyaGfS45CuqQ+w0I7NXF44QXwKp1JBsmyDymEWOXA8w dEB1jthCZGvQSj9D3zbU0g==; Received: from [87.69.77.57] (port=4695 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npOhY-0006X8-W6; Fri, 13 May 2022 02:23:01 -0400 Date: Fri, 13 May 2022 09:23:06 +0300 Message-Id: <83fslene7p.fsf@gnu.org> From: Eli Zaretskii To: Visuwesh In-Reply-To: <87pmki13i2.fsf@gmail.com> (message from Visuwesh on Fri, 13 May 2022 09:35:25 +0530) Subject: Re: bug#55393: describe-keymap: suggest symbol at point References: <87pmki13i2.fsf@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 55393 Cc: 55393@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Visuwesh > Date: Fri, 13 May 2022 09:35:25 +0530 > > describe-keymap differs from other describe-* commands in that it does > not suggest the symbol at point which always annoyed me. This patch > makes describe-keymap consider the symbol at point first. > > [ I hope it is okay to use if-let family of macros in these files now? ] Yes, but I think a cleaner solution would be to do this kind of stuff in the 'interactive' form of describe-keymap, instead of this subroutine. The DWIM-ish operation of describe-SOMETHING commands is better done there, because it doesn't really belong to non-interactive invocations. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Fri May 13 02:36:04 2022 Received: (at 55393) by debbugs.gnu.org; 13 May 2022 06:36:04 +0000 Received: from localhost ([127.0.0.1]:42812 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npOuB-0002Bp-Se for submit@debbugs.gnu.org; Fri, 13 May 2022 02:36:04 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:43747) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npOuA-0002BJ-53 for 55393@debbugs.gnu.org; Fri, 13 May 2022 02:36:02 -0400 Received: by mail-pl1-f196.google.com with SMTP id i17so7039524pla.10 for <55393@debbugs.gnu.org>; Thu, 12 May 2022 23:36:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=QBQmOxTzBhQKdXxz8WhK1ZrLuujDebEwpkA0am0VyQw=; b=ZNeE4YKWwL05BL0/OIG4/AHRY8BZ35weGyyEmwiOncu9SCd/qfAfcVwsXirxRJzzR7 Z/q48xQAJwT4CXVbSIc5nBGcZz7SbvIH53WAXIKT7cKaCNmGrYYbBgjKVyc18SZWRrmX SCFueydyfnuykI/uoBbOWooHtDUwHlltaTUlEIs/IaQwk5O8IgXrrvPV3QL9rG466s9u fbPDDBlK4wspkmYKCxnaIIzC9wFgQ5lZXQI3wQekkEYHYwxtIpRsx/a9ntREVBGmHLjY Ip8wdxC7dyM1g5OKjXpD0mzXFgedWTbu0AohzB4HbcoE+52cT+E5QKUCviP88wBGc4k4 RQyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=QBQmOxTzBhQKdXxz8WhK1ZrLuujDebEwpkA0am0VyQw=; b=0I5yRc9o4RtkgI0a47cCTl977GiA8S6COr1atJKHTCw0pi9woeKbAFX1LL43Umwjl+ X0cPLn2LaSESR1wTO7MaWi7OIGQ82KwLzxlUkmM1s/YzkPcFafdyHi0QbuMJztH3DHhs 1H5OViN0xjYnWKK/bsIIrS4kW/Al3eKajDKgOKjrW5pYB/qPdqj0gX1sTOpvD3kmQ32V LeNwcUZBIROv5A0VnHHfAzKbwFqo8Tj6R89vySD//aczE2yzivY83htfK/hzWqoAavub XAl52gYuvZXUHq9AtMBuBnKhhHqyU7f5d1IphjUv3wI9s8dZ+S/LV7pnPXCUEXo2Yvpw xSSQ== X-Gm-Message-State: AOAM532SG0DDWV7W6DVU4uYgCgj/A04ljTn1eX3+R6PPkLxIVGF9AA1P oAplezLU3Uz+bApgF+H9EBc= X-Google-Smtp-Source: ABdhPJxFkT9yNCJHRe3tpPsPnkGEt89nAxyopMs44cRG2XP5U3t36c50oTm2Ed4TlPonaupxr4ucEA== X-Received: by 2002:a17:90b:164f:b0:1dc:199c:56cc with SMTP id il15-20020a17090b164f00b001dc199c56ccmr3352003pjb.177.1652423756002; Thu, 12 May 2022 23:35:56 -0700 (PDT) Received: from localhost ([49.204.118.33]) by smtp.gmail.com with ESMTPSA id m13-20020a170902db0d00b0015e8d4eb2d2sm981375plx.284.2022.05.12.23.35.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 May 2022 23:35:55 -0700 (PDT) From: Visuwesh To: Eli Zaretskii Subject: Re: bug#55393: describe-keymap: suggest symbol at point References: <87pmki13i2.fsf@gmail.com> <83fslene7p.fsf@gnu.org> Date: Fri, 13 May 2022 12:05:42 +0530 In-Reply-To: <83fslene7p.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 13 May 2022 09:23:06 +0300") Message-ID: <87h75u0wjl.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 55393 Cc: 55393@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) [=E0=AE=B5=E0=AF=86=E0=AE=B3=E0=AF=8D=E0=AE=B3=E0=AE=BF =E0=AE=AE=E0=AF=87 = 13, 2022] Eli Zaretskii wrote: >> From: Visuwesh >> Date: Fri, 13 May 2022 09:35:25 +0530 >>=20 >> describe-keymap differs from other describe-* commands in that it does >> not suggest the symbol at point which always annoyed me. This patch >> makes describe-keymap consider the symbol at point first. >>=20 >> [ I hope it is okay to use if-let family of macros in these files now? ] > > Yes, but I think a cleaner solution would be to do this kind of stuff > in the 'interactive' form of describe-keymap, instead of this > subroutine. The DWIM-ish operation of describe-SOMETHING commands is > better done there, because it doesn't really belong to non-interactive > invocations. > > Thanks. The 'interactive' form of describe-keymap uses this function. I don't see this function being used anywhere else either. From debbugs-submit-bounces@debbugs.gnu.org Fri May 13 02:51:44 2022 Received: (at 55393) by debbugs.gnu.org; 13 May 2022 06:51:44 +0000 Received: from localhost ([127.0.0.1]:42850 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npP9M-0002gU-7c for submit@debbugs.gnu.org; Fri, 13 May 2022 02:51:44 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52258) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npP9K-0002g5-Gw for 55393@debbugs.gnu.org; Fri, 13 May 2022 02:51:43 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55340) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npP9F-0003tm-5G; Fri, 13 May 2022 02:51:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=x8HN+TOM/rTNw44BHXhS43EJx9O5ulkCCSVluD4jprg=; b=LeMl769zfU3i jVgjA6OoBocSC63vslRoUEac2KYKsxPu4g/GLUibs3tk860msjhF937W3tLB1219SLuu0Sa7JZsMO ep8bT88AJIHj1PLpha+OYVgOz3JwFpdUbAdYDPyQ6Rif5ZJ8V68d5Zozw/TXrX9mmxYG/pBxu64tB Kbcp+QQty/WACEFk05Pv50gZFPoTAyrbOZ7qPca48VjkE4KF54xI6fHll1/6AaQFaP29r9cPBAC0l hbexmX4swgcovYXPFgKGrp1sjVExbEm1L5jdwMTOvVUxrOOT4nIdawNiLWozk/D+xw46EtXblN2F/ MI0jPiWVl9cLQq8AOzJNZg==; Received: from [87.69.77.57] (port=2497 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npP9E-0007nB-Je; Fri, 13 May 2022 02:51:36 -0400 Date: Fri, 13 May 2022 09:51:42 +0300 Message-Id: <83bkw2ncw1.fsf@gnu.org> From: Eli Zaretskii To: Visuwesh In-Reply-To: <87h75u0wjl.fsf@gmail.com> (message from Visuwesh on Fri, 13 May 2022 12:05:42 +0530) Subject: Re: bug#55393: describe-keymap: suggest symbol at point References: <87pmki13i2.fsf@gmail.com> <83fslene7p.fsf@gnu.org> <87h75u0wjl.fsf@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 55393 Cc: 55393@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Visuwesh > Cc: 55393@debbugs.gnu.org > Date: Fri, 13 May 2022 12:05:42 +0530 > > > Yes, but I think a cleaner solution would be to do this kind of stuff > > in the 'interactive' form of describe-keymap, instead of this > > subroutine. The DWIM-ish operation of describe-SOMETHING commands is > > better done there, because it doesn't really belong to non-interactive > > invocations. > > > > Thanks. > > The 'interactive' form of describe-keymap uses this function. I don't > see this function being used anywhere else either. Nothing prevents future reuse of the subroutine in another place. I would prefer to have this code directly in the interactive form, to be more future-proof. And note that the if-let form's result is not used in any way in the rest of the code of that function, which also speaks volumes of its being an independent issue. From debbugs-submit-bounces@debbugs.gnu.org Fri May 13 03:43:11 2022 Received: (at 55393) by debbugs.gnu.org; 13 May 2022 07:43:11 +0000 Received: from localhost ([127.0.0.1]:42910 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npPx9-00046r-Iq for submit@debbugs.gnu.org; Fri, 13 May 2022 03:43:11 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:40847) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npPx8-00046c-Dh for 55393@debbugs.gnu.org; Fri, 13 May 2022 03:43:10 -0400 Received: by mail-pl1-f194.google.com with SMTP id i1so7193369plg.7 for <55393@debbugs.gnu.org>; Fri, 13 May 2022 00:43:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=iavltoORB2ANkXSrnjZBABVCvSEPRIXPzskYgQeAN2g=; b=k/Tq0btVIpH9btQcDMirkro/qm5iGA8yPGlmPk6zBXlRyCWI8/zgXUjha/pAzsdFsm oFe0mjpUyObmZvp0lhHJULRNQ/wIftCDFUZwyF7lI19soVUVxWrMwoRurB8POPnXKfNf Kgrid4/+kYKHIdqploFHK0jdVDYKuk8JQI1O97CuI0Gw2MHOUVDPi8c4EmKyl23pxcZC cyKeGpNHSUPie+xP83w4Vbc5IKCykYrQpM+kaWMvC679I07WoQP6zQOwFRjxynXjzw5P dTLax+llIF8tZFNjVKvGUQAbXP7drcB4F5e/ktKDx4qbBsVur9edyU9pL0p8OY/BI8P9 aTKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=iavltoORB2ANkXSrnjZBABVCvSEPRIXPzskYgQeAN2g=; b=LMnffOHWw+2kE3fbujYPxfLmTIwDX1OUMQUfEhCSEIKYq+Hr1oDjuTQd/G2XRF8R0M 21tIO6iNR4iEN3dcV9c4bJRaB0JfgwmvNNYaIlAwIqrF7eBUGxjJC+47rY+tUcq8aqq3 YHuG73y8sWawS+L25C+NIMnGXMb5s2z2rXbsxq+udlUrvlHanDF3L005F2BnZuK1eU2H A8rWaFBS+e4xzPjzsGW+1wLQuiAgKtHwHCsRDrs00BNeqM03q/l7gu1DnHyDFxsVIMip RCPgGeK6xC56obaTGQExGmbFlIA9syndb+87ntc55XW8EeLpDv/RbvQ+LUXwMdWTbqtH 0OyQ== X-Gm-Message-State: AOAM5314I9qOvzZRE02s7+S3v0gt4TeW2URmSWvUfylaA3M5j7HvNBLW cahjGJE5EOYhpxZWoFW8RYj8oWvA17E= X-Google-Smtp-Source: ABdhPJz5m0Wv++t6jchCy3c2+v9xHO8HsAv1L4KkTGt3WNYMgzCNVm5kMOav+CWUtwZV8vIJaS+5Cw== X-Received: by 2002:a17:902:7109:b0:15f:2074:3276 with SMTP id a9-20020a170902710900b0015f20743276mr3631405pll.25.1652427784510; Fri, 13 May 2022 00:43:04 -0700 (PDT) Received: from localhost ([49.204.118.33]) by smtp.gmail.com with ESMTPSA id t10-20020a65554a000000b003c1ee2c4242sm957016pgr.33.2022.05.13.00.43.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 00:43:04 -0700 (PDT) From: Visuwesh To: Eli Zaretskii Subject: Re: bug#55393: describe-keymap: suggest symbol at point References: <87pmki13i2.fsf@gmail.com> <83fslene7p.fsf@gnu.org> <87h75u0wjl.fsf@gmail.com> <83bkw2ncw1.fsf@gnu.org> Date: Fri, 13 May 2022 13:12:26 +0530 In-Reply-To: <83bkw2ncw1.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 13 May 2022 09:51:42 +0300") Message-ID: <87czgh280t.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 55393 Cc: 55393@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable [=E0=AE=B5=E0=AF=86=E0=AE=B3=E0=AF=8D=E0=AE=B3=E0=AE=BF =E0=AE=AE=E0=AF=87 = 13, 2022] Eli Zaretskii wrote: >> From: Visuwesh >> Cc: 55393@debbugs.gnu.org >> Date: Fri, 13 May 2022 12:05:42 +0530 >>=20 >> > Yes, but I think a cleaner solution would be to do this kind of stuff >> > in the 'interactive' form of describe-keymap, instead of this >> > subroutine. The DWIM-ish operation of describe-SOMETHING commands is >> > better done there, because it doesn't really belong to non-interactive >> > invocations. >> > >> > Thanks. >>=20 >> The 'interactive' form of describe-keymap uses this function. I don't >> see this function being used anywhere else either. > > Nothing prevents future reuse of the subroutine in another place. I > would prefer to have this code directly in the interactive form, to be > more future-proof. And note that the if-let form's result is not used > in any way in the rest of the code of that function, which also speaks > volumes of its being an independent issue. Now done, please check. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-describe-keymap-Suggest-symbol-at-point.patch >From 596a0f21791cf9d1ffc87e9e142ff81f853c0513 Mon Sep 17 00:00:00 2001 From: Visuwesh Date: Fri, 13 May 2022 13:09:55 +0530 Subject: [PATCH] describe-keymap: Suggest symbol at point * lisp/help-fns.el (describe-keymap): Suggest symbol at point if it is a keymap. * etc/NEWS: Announce the change. --- etc/NEWS | 5 +++++ lisp/help-fns.el | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/etc/NEWS b/etc/NEWS index e09834c..1cbc9cd 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -562,6 +562,11 @@ minor modes are listed after the major mode. The apropos commands will now select the apropos window if 'help-window-select' is non-nil. +--- +*** 'describe-keymap' now considers the symbol at point. +'describe-keymap' suggests the symbol at point as the default +candidate if it is a keymap. + ** Outline Mode +++ diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 927a4f0..807498f 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -1904,7 +1904,10 @@ in `describe-keymap'. See also `Searching the Active Keymaps'." When called interactively, prompt for a variable that has a keymap value." (interactive - (let* ((km (help-fns--most-relevant-active-keymap)) + (let* ((sym (symbol-at-point)) + (km (or (and (keymapp (ignore-errors (symbol-value sym))) + sym) + (help-fns--most-relevant-active-keymap))) (val (completing-read (format-prompt "Keymap" km) obarray -- 2.33.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri May 13 08:06:44 2022 Received: (at 55393) by debbugs.gnu.org; 13 May 2022 12:06:44 +0000 Received: from localhost ([127.0.0.1]:43069 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npU4C-0005ym-CF for submit@debbugs.gnu.org; Fri, 13 May 2022 08:06:44 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58460) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npU4B-0005yT-OO for 55393@debbugs.gnu.org; Fri, 13 May 2022 08:06:44 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:52752) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npU46-0003fL-Fi; Fri, 13 May 2022 08:06:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=UTbLPJEALgjKzEpKJPRaOdbXcZXJaLELCOWk8fpbLsM=; b=KN8xzaWSpG1j BNMoXR/Y4q3znAX5FU0p2xw99KUCsgtOM8hsEg5X6Sl3iamJ8ovoAeZhbsfKgrTvGTEQ4T09vnIVI ITlM/6BJ/LINGhyBAY9gFmoYznjFiDFppIre0KS6ezE7IYHJGrhsPImhDG2dsHFOLCZCfW51lA4PB MlIyaa8kfRF80NFLyjdEFpv6A5ol5EiLTou6Zca6DvYGD2b2B2C/rOyE3jgdF5otb1UQDDTJKVpQ1 y1rf66o27IxIxCfFff+xrAndQtDyB911NvJX8W2E4ooRC7vW2QsqgVcG75UIQGsI4TWwsvotTUG4V +rOSkx/ZN82EvxWW5/r9JQ==; Received: from [87.69.77.57] (port=1861 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npU42-0008Je-Q6; Fri, 13 May 2022 08:06:38 -0400 Date: Fri, 13 May 2022 15:06:40 +0300 Message-Id: <83y1z5myb3.fsf@gnu.org> From: Eli Zaretskii To: Visuwesh In-Reply-To: <87czgh280t.fsf@gmail.com> (message from Visuwesh on Fri, 13 May 2022 13:12:26 +0530) Subject: Re: bug#55393: describe-keymap: suggest symbol at point References: <87pmki13i2.fsf@gmail.com> <83fslene7p.fsf@gnu.org> <87h75u0wjl.fsf@gmail.com> <83bkw2ncw1.fsf@gnu.org> <87czgh280t.fsf@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 55393 Cc: 55393@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Visuwesh > Cc: 55393@debbugs.gnu.org > Date: Fri, 13 May 2022 13:12:26 +0530 > > >> The 'interactive' form of describe-keymap uses this function. I don't > >> see this function being used anywhere else either. > > > > Nothing prevents future reuse of the subroutine in another place. I > > would prefer to have this code directly in the interactive form, to be > > more future-proof. And note that the if-let form's result is not used > > in any way in the rest of the code of that function, which also speaks > > volumes of its being an independent issue. > > Now done, please check. LGTM, thanks. A minor nit: > --- a/etc/NEWS > +++ b/etc/NEWS > @@ -562,6 +562,11 @@ minor modes are listed after the major mode. > The apropos commands will now select the apropos window if > 'help-window-select' is non-nil. > > +--- > +*** 'describe-keymap' now considers the symbol at point. > +'describe-keymap' suggests the symbol at point as the default > +candidate if it is a keymap. That "it" is ambiguous, since it could allude to more than one entity mentioned before it. I suggest to change the order, so that "if it is a keymap" directly follows "symbol at point". Let's wait for a day or two to let others time to comment on this. From debbugs-submit-bounces@debbugs.gnu.org Fri May 13 08:47:33 2022 Received: (at 55393) by debbugs.gnu.org; 13 May 2022 12:47:33 +0000 Received: from localhost ([127.0.0.1]:43133 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npUhg-0000yZ-Lo for submit@debbugs.gnu.org; Fri, 13 May 2022 08:47:33 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:43940) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npUhe-0000t1-VQ for 55393@debbugs.gnu.org; Fri, 13 May 2022 08:47:31 -0400 Received: by mail-pg1-f196.google.com with SMTP id q76so7385726pgq.10 for <55393@debbugs.gnu.org>; Fri, 13 May 2022 05:47:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=UIjcFmvXPKLM8GV5AmRcgUWVd2P+wmgV2qvTk8f4G9s=; b=p0BUL6XmGnCh2LRTxVoxRaJkzoVlZ814g5cFZLCFljRMsym07WqYJP9EFsM8ALkMx8 8fG/e3hPwNtrx+sNso2XmAnoTtlsKMdZB5rHuPLLO7cGikjKg5Pkwm2/WER+MP4g41vH qNn2wycRFpVXoQnjz42SMdrzyNto+4ij8gV7J+G9tOnxadaaHAsG5K64aGyl5erV6tte FhXaMvDhy59Z4g388jNVCGVSLE+ZfwL6rbhQLX81plegu60dJzv0/sNetLS4LMU3fhFV nJBuaTNeXd3kWN2HixV4lgK9a7QXq5q8XYc/eK/aABaecCOhyaDG1YP3ZNELGHIOq1tS hxiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=UIjcFmvXPKLM8GV5AmRcgUWVd2P+wmgV2qvTk8f4G9s=; b=E33O7v4NrraNHOKe38YsGWeVFtQB9JuBTUzQXnc4b9g4LHOzrPCId+ZqO5uiIzOjuT 64wZAw6okuYnYGtbHDjX/i0VDFpE/FVvBKVPtIeAlG3HRymt4XhowpGUNTYh663Az0ON 8QA16Nu8UqID3d10B9dO0/upJnT+ul68jQLsU8CUskjX14l1tbZ4C7QGCmpZ+lt7mGE7 Ebdg8RK0qKKWp0L2tVFCGD//n+JV0sE8cOTJz0KmQfXx2lLXJzQV1XV/mhcAemJuHWwX LTPuVFjj5HoEk4zJSy38an63omADTdtYeM0Xg5siLwLYd2tggDgM8B2kGMvRoS8JHdKt 2Q/A== X-Gm-Message-State: AOAM530cH2k7i89ghI4ULhulg+Su8S3VK93jdxS4ZzYQe3NOYIBzivh2 x3636cDuZWygqtc147ijmyo= X-Google-Smtp-Source: ABdhPJzC4cARglOYxZLlgqiatFVNJGk0AwW46elz1gD0NiyPiaZ66thTd+dUPH5J0P+ZR8YLJJr2jA== X-Received: by 2002:a05:6a00:1781:b0:50a:94f0:661d with SMTP id s1-20020a056a00178100b0050a94f0661dmr4386763pfg.10.1652446044049; Fri, 13 May 2022 05:47:24 -0700 (PDT) Received: from localhost ([49.204.118.33]) by smtp.gmail.com with ESMTPSA id h3-20020a170902680300b0015e8d4eb2aesm1738118plk.248.2022.05.13.05.47.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 05:47:23 -0700 (PDT) From: Visuwesh To: Eli Zaretskii Subject: Re: bug#55393: describe-keymap: suggest symbol at point References: <87pmki13i2.fsf@gmail.com> <83fslene7p.fsf@gnu.org> <87h75u0wjl.fsf@gmail.com> <83bkw2ncw1.fsf@gnu.org> <87czgh280t.fsf@gmail.com> <83y1z5myb3.fsf@gnu.org> Date: Fri, 13 May 2022 18:17:11 +0530 In-Reply-To: <83y1z5myb3.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 13 May 2022 15:06:40 +0300") Message-ID: <874k1t1tww.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 55393 Cc: 55393@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable [=E0=AE=B5=E0=AF=86=E0=AE=B3=E0=AF=8D=E0=AE=B3=E0=AE=BF =E0=AE=AE=E0=AF=87 = 13, 2022] Eli Zaretskii wrote: >> From: Visuwesh >> Cc: 55393@debbugs.gnu.org >> Date: Fri, 13 May 2022 13:12:26 +0530 >>=20 >> >> The 'interactive' form of describe-keymap uses this function. I don't >> >> see this function being used anywhere else either. >> > >> > Nothing prevents future reuse of the subroutine in another place. I >> > would prefer to have this code directly in the interactive form, to be >> > more future-proof. And note that the if-let form's result is not used >> > in any way in the rest of the code of that function, which also speaks >> > volumes of its being an independent issue. >>=20 >> Now done, please check. > > LGTM, thanks. > > A minor nit: > >> --- a/etc/NEWS >> +++ b/etc/NEWS >> @@ -562,6 +562,11 @@ minor modes are listed after the major mode. >> The apropos commands will now select the apropos window if >> 'help-window-select' is non-nil. >>=20=20 >> +--- >> +*** 'describe-keymap' now considers the symbol at point. >> +'describe-keymap' suggests the symbol at point as the default >> +candidate if it is a keymap. > > That "it" is ambiguous, since it could allude to more than one entity > mentioned before it. I suggest to change the order, so that "if it is > a keymap" directly follows "symbol at point". > I changed the text to, *** 'describe-keymap' now considers the symbol at point. If the symbol at point is a keymap, 'describe-keymap' suggests it as the default candidate. Updated patch below, --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-describe-keymap-Suggest-symbol-at-point.patch >From 891efcc198e7cd308e8ee34fefee121439c46dff Mon Sep 17 00:00:00 2001 From: Visuwesh Date: Fri, 13 May 2022 13:09:55 +0530 Subject: [PATCH] describe-keymap: Suggest symbol at point * lisp/help-fns.el (describe-keymap): Suggest symbol at point if it is a keymap. * etc/NEWS: Announce the change. --- etc/NEWS | 5 +++++ lisp/help-fns.el | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/etc/NEWS b/etc/NEWS index e09834c..d50a852 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -562,6 +562,11 @@ minor modes are listed after the major mode. The apropos commands will now select the apropos window if 'help-window-select' is non-nil. +--- +*** 'describe-keymap' now considers the symbol at point. +If the symbol at point is a keymap, 'describe-keymap' suggests it as +the default candidate. + ** Outline Mode +++ diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 927a4f0..807498f 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -1904,7 +1904,10 @@ in `describe-keymap'. See also `Searching the Active Keymaps'." When called interactively, prompt for a variable that has a keymap value." (interactive - (let* ((km (help-fns--most-relevant-active-keymap)) + (let* ((sym (symbol-at-point)) + (km (or (and (keymapp (ignore-errors (symbol-value sym))) + sym) + (help-fns--most-relevant-active-keymap))) (val (completing-read (format-prompt "Keymap" km) obarray -- 2.33.1 --=-=-= Content-Type: text/plain > Let's wait for a day or two to let others time to comment on this. Sure! --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun May 15 01:26:51 2022 Received: (at 55393-done) by debbugs.gnu.org; 15 May 2022 05:26:51 +0000 Received: from localhost ([127.0.0.1]:48349 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nq6mI-0004XW-Us for submit@debbugs.gnu.org; Sun, 15 May 2022 01:26:51 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54426) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nq6mI-0004XK-A5 for 55393-done@debbugs.gnu.org; Sun, 15 May 2022 01:26:50 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:43062) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nq6mC-00063S-Of; Sun, 15 May 2022 01:26:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=3RIspUZB3WZ7ezyUobjGYB33t+k8u5YkOBrxbMfkPaY=; b=Gt5ciZ+eX3Dy S7lmEf/3naItkaEy7wAP3bZle/WMFdn26+3VKM4P/L36yCSeRSw8m2mW0JmQVx5Kx8mKfYJo9oXuF nT4roMPMBn3R+M5TacgS8fk76e+/Pnu+9R8BfB/2Fi6RCUYxrthu8WEEJ5MXDC+qJ6H3kWcUkfOUl LDMO3TDEjnsDftfjIjpzPbYKHYhVIUR+OoqqehFZnJ2CM76h6t7X6olr5oAQYlFpquvVYAiOkisT+ q3XwcKvOpawyp6jBNqkIit4t8uRwTtJgiW1Bu8QKr8fM51VrsuoDv+5ctcpwcF1V9dpg0Vw37A0bq INJpl9qlchPF8/QvX8M5Ng==; Received: from [87.69.77.57] (port=2696 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nq6mC-00055G-8T; Sun, 15 May 2022 01:26:44 -0400 Date: Sun, 15 May 2022 08:26:30 +0300 Message-Id: <831qwvl62h.fsf@gnu.org> From: Eli Zaretskii To: Visuwesh In-Reply-To: <874k1t1tww.fsf@gmail.com> (message from Visuwesh on Fri, 13 May 2022 18:17:11 +0530) Subject: Re: bug#55393: describe-keymap: suggest symbol at point References: <87pmki13i2.fsf@gmail.com> <83fslene7p.fsf@gnu.org> <87h75u0wjl.fsf@gmail.com> <83bkw2ncw1.fsf@gnu.org> <87czgh280t.fsf@gmail.com> <83y1z5myb3.fsf@gnu.org> <874k1t1tww.fsf@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 55393-done Cc: 55393-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Visuwesh > Cc: 55393@debbugs.gnu.org > Date: Fri, 13 May 2022 18:17:11 +0530 > > I changed the text to, > > *** 'describe-keymap' now considers the symbol at point. > If the symbol at point is a keymap, 'describe-keymap' suggests it as > the default candidate. Perfect, thanks. > > Let's wait for a day or two to let others time to comment on this. > > Sure! No further comments, so I've now installed this on the master branch. One nit for the future: please always mention the bug number, when it's known, in the commit log message. (I added it for you this time.) And with that, I'm closing the bug. Thanks for working on this. From debbugs-submit-bounces@debbugs.gnu.org Sun May 15 01:49:00 2022 Received: (at 55393) by debbugs.gnu.org; 15 May 2022 05:49:00 +0000 Received: from localhost ([127.0.0.1]:48356 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nq77j-0005CI-QQ for submit@debbugs.gnu.org; Sun, 15 May 2022 01:48:59 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:37722) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nq77h-0005C5-50 for 55393@debbugs.gnu.org; Sun, 15 May 2022 01:48:58 -0400 Received: by mail-pg1-f196.google.com with SMTP id 191so60574pgf.4 for <55393@debbugs.gnu.org>; Sat, 14 May 2022 22:48:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=OUO+6d6bmPHWrlY5700XomQ27fAHPGqw5wG6/9UovB4=; b=CQAvhYvpD7oR/olIL0N2TpzCSq9tux7jPHt8IevcWPhJb/Ho0cjoC0AVLeyFZoH3gl OXHPuMmUHz3qPphA4IuiVJl1flEOapQ5WUBgZWZlpH/rKQKDhaEseqYEg8u/H+a8bGmo kxDqB89XJ89qX5/fKvXd/DYKfYNorTL3GH/GyJkZbHDqHnWI4yI+wlHT376vKkO2z97f 3m5/i5wXNGP8V3pv0+RfSAxLBtlLC6jH85225GFM6cO2Syl7CkJcrYWQnu3AWGXDX0t+ Zj2QI02ERvSp7G9BvfFfIsxbrQdiNbjX6w9rHVNGsNVVLOCnaNBS3nx3FfSKvJRc+5WV e9hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=OUO+6d6bmPHWrlY5700XomQ27fAHPGqw5wG6/9UovB4=; b=ebug/CtZHp6U784t8so5LnpT/DRSIP8xsHOwEHEK3zYWn76xDiV9UkBADNr/h6cafp ejtnJtwwxRPChoy9TBJgZ2EF1muWZgiYs2gm23tMqAKBbEJruJOc9SSj/Ps/6E61/fH3 puvW8Kad2Qbl4mEVO933R3jbEZE9j8JTbgGZI/BKiiRtvshyJVInpGmwRt2iJ/BMgaHe cgijYzEfet1EU36OnwS6GKIxWbcWumQ1w1Qb/iFDB8Dmz5XXYvPcHllxpHV2m+qi1Hl7 5aoDnSLDOdOxVwy64/90rjkGxRavFmSom0+3I3+Frk+Ah3pfUTJJnJjHDLVZCLTMah7/ NahA== X-Gm-Message-State: AOAM530OgynV5rbfdxK5V99u35MZunEQEa5VzLUwSssQINDahpM2F3/L HwWLDRMoUD51EeQRMvU+RbAb7S91Mlc8Cw== X-Google-Smtp-Source: ABdhPJx/BWLF/SFSOLmNqYSjzCx1o7NGIcl0+D6uGAHFislcPzeF8ONNuIgBApp5dBJWjrg7MMXbIA== X-Received: by 2002:a05:6a00:80b:b0:510:845d:ff60 with SMTP id m11-20020a056a00080b00b00510845dff60mr12259163pfk.76.1652593731120; Sat, 14 May 2022 22:48:51 -0700 (PDT) Received: from localhost ([49.204.115.240]) by smtp.gmail.com with ESMTPSA id m4-20020a056a00080400b0050dc76281c4sm4509478pfk.158.2022.05.14.22.48.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 May 2022 22:48:50 -0700 (PDT) From: Visuwesh To: 55393@debbugs.gnu.org Subject: Re: bug#55393: describe-keymap: suggest symbol at point References: <87pmki13i2.fsf@gmail.com> <83fslene7p.fsf@gnu.org> <87h75u0wjl.fsf@gmail.com> <83bkw2ncw1.fsf@gnu.org> <87czgh280t.fsf@gmail.com> <83y1z5myb3.fsf@gnu.org> <874k1t1tww.fsf@gmail.com> <831qwvl62h.fsf@gnu.org> Date: Sun, 15 May 2022 11:18:08 +0530 In-Reply-To: <831qwvl62h.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 15 May 2022 08:26:30 +0300") Message-ID: <87k0anl52f.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 55393 Cc: eliz@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) [=E0=AE=9E=E0=AE=BE=E0=AE=AF=E0=AE=BF=E0=AE=B1=E0=AF=81 =E0=AE=AE=E0=AF=87 = 15, 2022] Eli Zaretskii wrote: >> From: Visuwesh >> Cc: 55393@debbugs.gnu.org >> Date: Fri, 13 May 2022 18:17:11 +0530 >>=20 >> I changed the text to, >>=20 >> *** 'describe-keymap' now considers the symbol at point. >> If the symbol at point is a keymap, 'describe-keymap' suggests it as >> the default candidate. > > Perfect, thanks. > >> > Let's wait for a day or two to let others time to comment on this. >>=20 >> Sure! > > No further comments, so I've now installed this on the master branch. > > One nit for the future: please always mention the bug number, when > it's known, in the commit log message. (I added it for you this > time.) > Sorry, I keep forgetting about this. I will make sure to remember=20 next time. [ BTW, there's no way to know what the bug number will be when I first do M-x submit-emacs-patch, is there? ] > And with that, I'm closing the bug. Thanks for working on this. From debbugs-submit-bounces@debbugs.gnu.org Sun May 15 02:19:31 2022 Received: (at 55393) by debbugs.gnu.org; 15 May 2022 06:19:31 +0000 Received: from localhost ([127.0.0.1]:48409 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nq7bH-0006A9-JZ for submit@debbugs.gnu.org; Sun, 15 May 2022 02:19:31 -0400 Received: from eggs.gnu.org ([209.51.188.92]:32798) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nq7bG-00069x-FT for 55393@debbugs.gnu.org; Sun, 15 May 2022 02:19:30 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:43406) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nq7bB-0002Rb-8r; Sun, 15 May 2022 02:19:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=KkKCl8EzRN4RcPP/xb9WQJUW7M7WLS4kBxc0nKolGXo=; b=auXzdE8i8vtSMgcotwtO jddaw+NTpE18TF3Vb+09B6xUEHiyTwIVj8xorw/aOR90K2UqUpRsKLWUIUcNYorWXIlKwIy76fUKp uzeCoAGXH632U7viwx0v/nXv441TZLHrEIQx+aQgm1tAWou7/tih0N2jn4EP6XQNdnWhhl/lxOfvl rVuPBvTq/Y9JTG7ZuHyRaZeW+OKUlB71Osp02S9/dHSUFWP5eV05HlXb0It8U2BEe58LPSrYtbguW VNeKFkGTeTPynwG0YLBs1+fFaBlASnenfcmRlyt910pSECEEfltLxUBfwEUPM6Ua5PJKwwoJsfDsB wgX/pGgI/LfpFA==; Received: from [87.69.77.57] (port=1970 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nq7b8-0006nq-9g; Sun, 15 May 2022 02:19:23 -0400 Date: Sun, 15 May 2022 09:19:08 +0300 Message-Id: <83wnenjp2b.fsf@gnu.org> From: Eli Zaretskii To: Visuwesh In-Reply-To: <87k0anl52f.fsf@gmail.com> (message from Visuwesh on Sun, 15 May 2022 11:18:08 +0530) Subject: Re: bug#55393: describe-keymap: suggest symbol at point References: <87pmki13i2.fsf@gmail.com> <83fslene7p.fsf@gnu.org> <87h75u0wjl.fsf@gmail.com> <83bkw2ncw1.fsf@gnu.org> <87czgh280t.fsf@gmail.com> <83y1z5myb3.fsf@gnu.org> <874k1t1tww.fsf@gmail.com> <831qwvl62h.fsf@gnu.org> <87k0anl52f.fsf@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 55393 Cc: 55393@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Visuwesh > Cc: eliz@gnu.org > Date: Sun, 15 May 2022 11:18:08 +0530 > > [ஞாயிறு மே 15, 2022] Eli Zaretskii wrote: > > > One nit for the future: please always mention the bug number, when > > it's known, in the commit log message. (I added it for you this > > time.) > > > > Sorry, I keep forgetting about this. I will make sure to remember > next time. > [ BTW, there's no way to know what the bug number will be when I first > do M-x submit-emacs-patch, is there? ] No, there isn't. (Some people first report the problem, and then post the patch in a separate message, once they receive the response from the bug tracker with the bug number, for this very reason.) So for the first submission you cannot put the number there. However, for the other submissions you can add it. From unknown Fri Jun 20 07:15:27 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 12 Jun 2022 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator