From: Visuwesh <visuweshm@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 55393@debbugs.gnu.org
Subject: bug#55393: describe-keymap: suggest symbol at point
Date: Fri, 13 May 2022 18:17:11 +0530 [thread overview]
Message-ID: <874k1t1tww.fsf@gmail.com> (raw)
In-Reply-To: <83y1z5myb3.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 13 May 2022 15:06:40 +0300")
[-- Attachment #1: Type: text/plain, Size: 1559 bytes --]
[வெள்ளி மே 13, 2022] Eli Zaretskii wrote:
>> From: Visuwesh <visuweshm@gmail.com>
>> 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".
>
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,
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-describe-keymap-Suggest-symbol-at-point.patch --]
[-- Type: text/x-patch, Size: 1538 bytes --]
From 891efcc198e7cd308e8ee34fefee121439c46dff Mon Sep 17 00:00:00 2001
From: Visuwesh <visuweshm@gmail.com>
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
[-- Attachment #3: Type: text/plain, Size: 77 bytes --]
> Let's wait for a day or two to let others time to comment on this.
Sure!
next prev parent reply other threads:[~2022-05-13 12:47 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-13 4:05 bug#55393: describe-keymap: suggest symbol at point Visuwesh
2022-05-13 5:24 ` Visuwesh
2022-05-13 6:23 ` Eli Zaretskii
2022-05-13 6:35 ` Visuwesh
2022-05-13 6:51 ` Eli Zaretskii
2022-05-13 7:42 ` Visuwesh
2022-05-13 12:06 ` Eli Zaretskii
2022-05-13 12:47 ` Visuwesh [this message]
2022-05-15 5:26 ` Eli Zaretskii
2022-05-15 5:48 ` Visuwesh
2022-05-15 6:19 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874k1t1tww.fsf@gmail.com \
--to=visuweshm@gmail.com \
--cc=55393@debbugs.gnu.org \
--cc=eliz@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.