From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Visuwesh Newsgroups: gmane.emacs.bugs Subject: bug#55393: describe-keymap: suggest symbol at point Date: Fri, 13 May 2022 18:17:11 +0530 Message-ID: <874k1t1tww.fsf@gmail.com> 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> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27982"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 55393@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 13 14:48:20 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1npUiS-000787-3w for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 13 May 2022 14:48:20 +0200 Original-Received: from localhost ([::1]:48388 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1npUiR-0007qy-7f for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 13 May 2022 08:48:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60462) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npUiA-0007p2-P9 for bug-gnu-emacs@gnu.org; Fri, 13 May 2022 08:48:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49236) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1npUiA-00032r-G2 for bug-gnu-emacs@gnu.org; Fri, 13 May 2022 08:48:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1npUiA-00013r-EZ for bug-gnu-emacs@gnu.org; Fri, 13 May 2022 08:48:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Visuwesh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 13 May 2022 12:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55393 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 55393-submit@debbugs.gnu.org id=B55393.16524460533778 (code B ref 55393); Fri, 13 May 2022 12:48:02 +0000 Original-Received: (at 55393) by debbugs.gnu.org; 13 May 2022 12:47:33 +0000 Original-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 Original-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 Original-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) Original-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) In-Reply-To: <83y1z5myb3.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 13 May 2022 15:06:40 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:232132 Archived-At: --=-=-= 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! --=-=-=--