GNU bug report logs - #55393
describe-keymap: suggest symbol at point

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; Reported by: Visuwesh <visuweshm@HIDDEN>; Keywords: patch; dated Fri, 13 May 2022 04:06:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

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


Received: (at 55393) by debbugs.gnu.org; 13 May 2022 12:47:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 13 08:47:33 2022
Received: from localhost ([127.0.0.1]:43133 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1npUhg-0000yZ-Lo
	for submit <at> 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 <visuweshm@HIDDEN>) id 1npUhe-0000t1-VQ
 for 55393 <at> 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 <at> 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 <visuweshm@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#55393: describe-keymap: suggest symbol at point
References: <87pmki13i2.fsf@HIDDEN> <83fslene7p.fsf@HIDDEN>
 <87h75u0wjl.fsf@HIDDEN> <83bkw2ncw1.fsf@HIDDEN>
 <87czgh280t.fsf@HIDDEN> <83y1z5myb3.fsf@HIDDEN>
Date: Fri, 13 May 2022 18:17:11 +0530
In-Reply-To: <83y1z5myb3.fsf@HIDDEN> (Eli Zaretskii's message of "Fri, 13 May
 2022 15:06:40 +0300")
Message-ID: <874k1t1tww.fsf@HIDDEN>
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 <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.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 <visuweshm@HIDDEN>
>> Cc: 55393 <at> 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 <visuweshm@HIDDEN>
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!

--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#55393; Package emacs. Full text available.

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


Received: (at 55393) by debbugs.gnu.org; 13 May 2022 12:06:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 13 08:06:44 2022
Received: from localhost ([127.0.0.1]:43069 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1npU4C-0005ym-CF
	for submit <at> 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 <eliz@HIDDEN>) id 1npU4B-0005yT-OO
 for 55393 <at> 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 <eliz@HIDDEN>)
 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 <eliz@HIDDEN>)
 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@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Visuwesh <visuweshm@HIDDEN>
In-Reply-To: <87czgh280t.fsf@HIDDEN> (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@HIDDEN> <83fslene7p.fsf@HIDDEN>
 <87h75u0wjl.fsf@HIDDEN> <83bkw2ncw1.fsf@HIDDEN> <87czgh280t.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 55393
Cc: 55393 <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 (---)

> From: Visuwesh <visuweshm@HIDDEN>
> Cc: 55393 <at> 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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#55393; Package emacs. Full text available.

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


Received: (at 55393) by debbugs.gnu.org; 13 May 2022 07:43:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 13 03:43:11 2022
Received: from localhost ([127.0.0.1]:42910 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1npPx9-00046r-Iq
	for submit <at> 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 <visuweshm@HIDDEN>) id 1npPx8-00046c-Dh
 for 55393 <at> 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 <at> 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 <visuweshm@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#55393: describe-keymap: suggest symbol at point
References: <87pmki13i2.fsf@HIDDEN> <83fslene7p.fsf@HIDDEN>
 <87h75u0wjl.fsf@HIDDEN> <83bkw2ncw1.fsf@HIDDEN>
Date: Fri, 13 May 2022 13:12:26 +0530
In-Reply-To: <83bkw2ncw1.fsf@HIDDEN> (Eli Zaretskii's message of "Fri, 13 May
 2022 09:51:42 +0300")
Message-ID: <87czgh280t.fsf@HIDDEN>
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 <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.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 <visuweshm@HIDDEN>
>> Cc: 55393 <at> 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 <visuweshm@HIDDEN>
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


--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#55393; Package emacs. Full text available.

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


Received: (at 55393) by debbugs.gnu.org; 13 May 2022 06:51:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 13 02:51:44 2022
Received: from localhost ([127.0.0.1]:42850 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1npP9M-0002gU-7c
	for submit <at> 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 <eliz@HIDDEN>) id 1npP9K-0002g5-Gw
 for 55393 <at> 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 <eliz@HIDDEN>)
 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 <eliz@HIDDEN>)
 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@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Visuwesh <visuweshm@HIDDEN>
In-Reply-To: <87h75u0wjl.fsf@HIDDEN> (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@HIDDEN> <83fslene7p.fsf@HIDDEN>
 <87h75u0wjl.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 55393
Cc: 55393 <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 (---)

> From: Visuwesh <visuweshm@HIDDEN>
> Cc: 55393 <at> 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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#55393; Package emacs. Full text available.

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


Received: (at 55393) by debbugs.gnu.org; 13 May 2022 06:36:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 13 02:36:04 2022
Received: from localhost ([127.0.0.1]:42812 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1npOuB-0002Bp-Se
	for submit <at> 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 <visuweshm@HIDDEN>) id 1npOuA-0002BJ-53
 for 55393 <at> 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 <at> 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 <visuweshm@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#55393: describe-keymap: suggest symbol at point
References: <87pmki13i2.fsf@HIDDEN> <83fslene7p.fsf@HIDDEN>
Date: Fri, 13 May 2022 12:05:42 +0530
In-Reply-To: <83fslene7p.fsf@HIDDEN> (Eli Zaretskii's message of "Fri, 13 May
 2022 09:23:06 +0300")
Message-ID: <87h75u0wjl.fsf@HIDDEN>
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 <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.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 <visuweshm@HIDDEN>
>> 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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#55393; Package emacs. Full text available.

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


Received: (at 55393) by debbugs.gnu.org; 13 May 2022 06:23:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 13 02:23:08 2022
Received: from localhost ([127.0.0.1]:42776 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1npOhg-0001o8-4v
	for submit <at> 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 <eliz@HIDDEN>) id 1npOhe-0001nf-RJ
 for 55393 <at> 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 <eliz@HIDDEN>)
 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 <eliz@HIDDEN>)
 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@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Visuwesh <visuweshm@HIDDEN>
In-Reply-To: <87pmki13i2.fsf@HIDDEN> (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@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 55393
Cc: 55393 <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 (---)

> From: Visuwesh <visuweshm@HIDDEN>
> 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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#55393; Package emacs. Full text available.

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


Received: (at 55393) by debbugs.gnu.org; 13 May 2022 05:24:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 13 01:24:48 2022
Received: from localhost ([127.0.0.1]:42749 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1npNnD-0008Uw-JK
	for submit <at> 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 <visuweshm@HIDDEN>) id 1npNn9-0008Ug-6d
 for 55393 <at> 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 <at> 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 <at> 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 <visuweshm@HIDDEN>
To: 55393 <at> debbugs.gnu.org
Subject: Re: bug#55393: describe-keymap: suggest symbol at point
References: <87pmki13i2.fsf@HIDDEN>
Date: Fri, 13 May 2022 10:54:12 +0530
In-Reply-To: <87pmki13i2.fsf@HIDDEN> (Visuwesh's message of "Fri, 13 May
 2022 09:35:25 +0530")
Message-ID: <87lev60zur.fsf@HIDDEN>
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 <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.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 <visuweshm@HIDDEN>
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


--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#55393; Package emacs. Full text available.

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


Received: (at submit) by debbugs.gnu.org; 13 May 2022 04:05:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 13 00:05:56 2022
Received: from localhost ([127.0.0.1]:42688 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1npMYu-00067k-Cz
	for submit <at> 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 <visuweshm@HIDDEN>) id 1npMYs-00067c-H3
 for submit <at> 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 <visuweshm@HIDDEN>)
 id 1npMYs-0000LU-C5
 for bug-gnu-emacs@HIDDEN; 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 <visuweshm@HIDDEN>)
 id 1npMYq-0006dx-Id
 for bug-gnu-emacs@HIDDEN; Fri, 13 May 2022 00:05:54 -0400
Received: by mail-pj1-x1042.google.com with SMTP id
 t11-20020a17090ad50b00b001d95bf21996so9706613pju.2
 for <bug-gnu-emacs@HIDDEN>; 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 <bug-gnu-emacs@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 12 May 2022 21:05:49 -0700 (PDT)
From: Visuwesh <visuweshm@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: describe-keymap: suggest symbol at point
Date: Fri, 13 May 2022 09:35:25 +0530
Message-ID: <87pmki13i2.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=2607:f8b0:4864:20::1042;
 envelope-from=visuweshm@HIDDEN; 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 <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.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 <visuweshm@HIDDEN>
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'


--=-=-=--




Acknowledgement sent to Visuwesh <visuweshm@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#55393; Package emacs. 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: Fri, 13 May 2022 13:00:03 UTC

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