GNU bug report logs - #43709
minibuffer keybinding cheatsheet and launcher [CODE SUBMISSION]

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: Boruch Baum <boruch_baum@HIDDEN>; Keywords: patch; dated Tue, 29 Sep 2020 17:01:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

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


Received: (at 43709) by debbugs.gnu.org; 1 Oct 2020 18:25:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 01 14:25:21 2020
Received: from localhost ([127.0.0.1]:38270 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kO3Gb-0005XB-MG
	for submit <at> debbugs.gnu.org; Thu, 01 Oct 2020 14:25:21 -0400
Received: from mout.gmx.net ([212.227.17.22]:33991)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <boruch_baum@HIDDEN>) id 1kO3GX-0005Wt-6r
 for 43709 <at> debbugs.gnu.org; Thu, 01 Oct 2020 14:25:19 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;
 s=badeba3b8450; t=1601576708;
 bh=NCNnfNoWMu0JWE+V0QrE7Q2n3EJdJgNzpIRr1aKAmB4=;
 h=X-UI-Sender-Class:Date:From:To:Cc:Subject:References:In-Reply-To;
 b=TfEmmIjdTok1ZO4OrFHq/uRdk5a+MYIvTl8Y6wil9l8jkDxdWEOnjQNpPKK8OklA/
 he2Uid9XJKPcefMkhIo/RYISkcea3JZUsBkowC8lUipvJCtph/H7lC05kgTffTwQds
 bnVU78qr/cx96QilCZB7DJMDqVqJdiA7RbJKrj7Q=
X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
Received: from E15-2016.optimum.net ([72.89.170.172]) by mail.gmx.com
 (mrgmx104 [212.227.17.174]) with ESMTPSA (Nemesis) id
 1McpJq-1kwpqj2w2k-00ZtX4; Thu, 01 Oct 2020 20:25:08 +0200
Date: Thu, 1 Oct 2020 14:25:04 -0400
From: Boruch Baum <boruch_baum@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#43709: minibuffer keybinding cheatsheet and launcher [CODE
 SUBMISSION]
Message-ID: <20201001182504.mrdldh3rdf3uuvbm@HIDDEN>
References: <20200929165957.ibj67dnyaem6nezg@HIDDEN>
 <jwveemijcub.fsf-monnier+emacs@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <jwveemijcub.fsf-monnier+emacs@HIDDEN>
User-Agent: NeoMutt/20180716
X-Provags-ID: V03:K1:oZckP0OIoHIMAN9FeUPG+A+iJHZ/bQKpyxtHnSnhgRAuoz8R4Kp
 C/L7mThy6CQ+2Ki+m077R4/PQdXTv0UKgHgcrp4U4RQC4YKrLf2bz7DV+X/s7LKScHZOvcK
 37jk9i7NKJ+6I1GgmnvZA6TnLUaY9Z/yzo37xckSKSot5AtTlG73CfAgOVF/JGCJGB5NCfW
 U5qRZn1RRMEKApeOsqmSg==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:uAT1P2RPIiE=:8fTNjX7pHbtAepg8i4FwtC
 5iYqg/DfJqmWNg6qOLlDTt0khh2ODVSpwZ5Wh44UcZq5R0s352u2LH0xRDBKDGbJ5Tz6MSRUS
 m5BTpyOP16HhTzDxdxQmQqPkZPhF+TmvZ1iqQL6iqg872LofYy9lm16Ynq3nbx8cKqVNYMUZ6
 kmk58BScDAZg57UId47lMgpnEY3MBVQdL+J4XO+KFAPrE3BfgOj3PyG0b05rVSyblocnkhPg/
 f5Tu9lgP2lZJTcTYiBIDXsEOD31gjo7wTMzPfltBc9yzeQ6oyLinZEcLQPtntY1qCXsz67a1w
 NZDBHEDTI/iljXzFgkjTOB5o1xKtgmcDEJVrkq2rQ0gjaOYO8erSU9s9SEAJ8XmlBTXR5PqjN
 Z7t6pJte5lbwvlrVFCS8W0TkQ4ONaiKEkTpPMB3hRZk5jWxv2xZ7RmziVGsUci+GLlYGzyC5k
 B60GOcC5zLpUO16FMK3CSSGv9rcOvEEyJFbUHRY3QhxCX/K61jCMoG2u75Tce4r3yLBAMBRPo
 TgZK4G2PIhVGzsVO00TaDoPwhl7SISQCoF3bqCWJwA6etMXmEr9YJs1hBhbeHJS4rQC56ItlK
 zBDA+G1hNRcqdlGDMKT2Hsho1XBRghLgU4zdQO8FCttWFG0sDfrAQtUDlFI/4Vd056LppcPSm
 nlRt0HJ35wrtPSgdf5agZhEWapumhs7FWbRO9Q3ObJer4wqIqx2sGL9DVfsNDQxmVYY/6lfXN
 VlWIZKs7I19sR4BA/WcAvOJSs7CRHJOFmBLmHeiOZcAQTkhrhiIvowjGMoQf/s5GYFbcdoQg2
 QKCMMq/A0xuFKKTKJl7Z30BWJJAzlIXoe2ttMboErgtB/o8a+E4ipnGaY44wPVaXl5XTKC1HU
 uvhG/NKKYFH4D3XbsxgHwi2OakKBzo21LHTN2/K/pTyX5wYArEbpZ1r/f2Dw1vvJABHdYL/lM
 uQ9pmPaZeflsmuWzMZxVyWwSgt5he9lJw0mCibzNTjVoFAkvmgW6lINuaNEBouGdOmPnrUL6R
 L51RXEB/2++GK2wdpTTwNFtbaw85uNTivJSkNG04R9IfE0Ujrm/MKp+BK+b28IrB58QMaW3C1
 i95kxD8827V8sH7nf6J4Y+MbcQucOFuUMcyIaE1FuuejMgjnnaF6nlNyZKy+hxIFxzhR54N2O
 kZV43EimxsekgfJiJ5gIghL1y1garZxIF571QwVOvdJx15n/23KcekQ7rgNTQfpMW9PfNe0CA
 BBnYYGsadouWr+/XCV9WusnBK3EP3Gv4Z9i5CmA==
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 43709
Cc: 43709 <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.7 (-)

On 2020-10-01 09:51, Stefan Monnier wrote:
> > ;;   If you've ever used packages such as `ivy' or `magit', you've
> For those who haven't, it would be good to describe what your package do=
es.

In progress...

> > (require 'cl-seq) ;; cl-member, cl-position
> Please require `cl-lib`grather than `cl-seq`

Done.

> >     (let ((not-found t))
> >       (mapc (lambda (x)
> >               (when (string-match x (format "%s" cmd))
> >                 (setq not-found nil)))
> >             key-assist-exclude-regexps)
> >       not-found)))
>
> You should move the `(format "%s" cmd)` out of the loop (and use
> `dolist` instead of `mapc`).

Done, but I went with symbol-name instead of format.

> >      ((keymapp spec)
> >        (let (cmd)
> >          (dolist (elem spec)
>
> Please use `map-keymap` rather than `dolist` so as to handle all the
> different keymap formats.

I had tried that originally, but map-keymap brings in data from parent
keymaps, which is undesirable in this case. There is a function
map-keymap-internal which might be a usable alternative, but it returns
a single unusable cruft element (the parent keymap) when it exists, so
the result doesn't seem much better than the current code, no?

> >      (funcall (car (nth choice commands))))))
>
> This should probably be `command-execute` rather than `funcall` to fix
> the wrong-number-of-arguments error I bumped into.

Great catch. It solves the bug you found. Done.

As for posting updates to the code submission, I can do any combination of
the following, or something else, but want guidance before proceeding:

1) post to this list;

2) post to the pre-existing thread on emacs-bugs;

3) create a github repo, and post there (and gain potential wider
audience, more features, but fragment communication over two platforms);

4) create a repo on some imagined savannah / gnu server;

Finally: Tomorrow approaching sunset I go offline for about nine
days[1], so what I can squeeze in before then, great; afterwards I
welcome any continued feedback but please be patient and don't expect
any response for ~10-12 days.

But really finally this time: I've twice already made passing reference
to another package about ready to submit, that adds a lot of new
functionality to dired. I can post it now in its current state, and
inconsiderately disappear offline for 9+ days, or I could just as
inconsiderately not post it and deny you for 9+ days. I'm undecided, so
unless I hear otherwise, I'll wait.

=2D-
[1] https://en.wikipedia.org/wiki/Sukkot

=2D-
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0




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

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


Received: (at 43709) by debbugs.gnu.org; 1 Oct 2020 16:04:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 01 12:04:58 2020
Received: from localhost ([127.0.0.1]:38044 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kO14j-00066i-BA
	for submit <at> debbugs.gnu.org; Thu, 01 Oct 2020 12:04:58 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:7286)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1kO14g-00066R-E8
 for 43709 <at> debbugs.gnu.org; Thu, 01 Oct 2020 12:04:55 -0400
Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id B693780B9B;
 Thu,  1 Oct 2020 12:04:48 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id A7DD58073F;
 Thu,  1 Oct 2020 12:04:46 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1601568286;
 bh=f0FxeC60RJV8tMI0FaD0VDRgFCV0jjlg45CH63Xrojk=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=X3+4w0pB0PqdZrcraeA6sOFk8Ii2oVHB932Gbpoc+5ZGn3RM3slCCNqzN4w7x3xdU
 OUDY81sAKmpYRD3K/s/Zppeei00uX9yP+nr3vRPw1ychzNCJZbSI+4xdwKkN5JSuE7
 yg8IufS2terJlbpiqQTOg89DpjoM8I+SEYfI6tGSGFQXTGBX98GC6A6w83dusz9guI
 UnwrJ5uLm72gZquSLwG8S73TRGy/ZzoIILC04ai7MWUNIAX+aJeiAL6sWUYcS/vCY1
 VS1c5YVubsrT6/sojp5/TEgq2BnWH96Qllgdsl4ahooJG06UOTvhY2x9qhjjEB57xz
 219VO9ollEwMw==
Received: from alfajor (unknown [45.72.232.131])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 42FA41202C5;
 Thu,  1 Oct 2020 12:04:46 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Boruch Baum <boruch_baum@HIDDEN>
Subject: Re: bug#43709: minibuffer keybinding cheatsheet and launcher [CODE
 SUBMISSION]
Message-ID: <jwvlfgqhs7i.fsf-monnier+emacs@HIDDEN>
References: <20200929165957.ibj67dnyaem6nezg@HIDDEN>
 <jwveemijcub.fsf-monnier+emacs@HIDDEN>
 <20201001153147.3ucillviu62t2prf@HIDDEN>
Date: Thu, 01 Oct 2020 12:04:45 -0400
In-Reply-To: <20201001153147.3ucillviu62t2prf@HIDDEN> (Boruch
 Baum's message of "Thu, 1 Oct 2020 11:31:47 -0400")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.078 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 43709
Cc: 43709 <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 (---)

>> [ To see why I say it's not quite ready, here's my experience with it:
>>   I just tried it in a fresh new Emacs session, and after `M-x
>>   key-assist` (which itself is a problem because most users won't
>>   know/bother to run this command way, so we'd need some more "obvious"
>>   way to run it)
> Always a problem with a new feature. When you say 'obvious', you seem to
> mean more than the normal publicizing of a new feature?

I'm thinking that this would be useful for someone that not very
familiar with Emacs, which also explains my further comments about the
behavior.  As it is, it seems instead geared toward users that are
already familiar with Emacs and want to get to know some new mode or
something like that.

For a novice, we'd ideally want the user to be able to find and use this
functionality "naturally" without even knowing beforehand how to look
for it and how Emacs generally works ;-)

>>   I get a prompt for something
> You mean the prompt "Optional: Enter command regexp or keymap name:"?

Yes.

>>   and without reading more the description I wouldn't know what the
>>   prompt wants
> True of very many emacs commands. Not a justification though. It could
> be a multi-line verbose explanatory prompt.

I think skipping the prompt is an easier way to avoid the confusion.
Only prompt if the user asks for it (e.g. with a `C-u` prefix, an
alternative entry-point, ...).

> Reasonable. Could be argued both ways. I have no preference, and just
> thought it friendlier this way to explicitly present to the user all the
> options, especially since this is supposed to be a 'help' function.

Or maybe we'd want to offer this prompt *afterwards*, as a special
command to change&recompute the completion table based on
a new criterion.

>>    and then it said "no choices found".
> That's curious. I haven't seen that in my testing. What was your
> response to the first prompt?

RET

> What was the value of 'major-mode' of the 'current-buffer' when you
> ran the command?

I was in *scratch*, so should have been `lisp-interaction-mode`.
Maybe the "no choices found" message should mention the search string
that was used (that's also a good way to teach the user what the first
prompt means).

>>   So I tried again in a dired buffer, where it instead showed me a
>>   minibuffer prompt "Select: " with no indication of what it is I
>>   should be selecting,
>
> I had difficulty deciding what text to use for this prompt because many
> users can be expected to be using some non-default minibuffer completion
> supplemental package (eg. ido, icicles, ivy), and those all have
> slightly different behavior; many present a result-list without needing
> to TAB.

Good point.  For the plain old default, it would make a lot of sense to
eagerly popup the *Completions*, but I'm not sure how we could do it
without getting in the way for ivy and friends.

> Again, true of very many emacs commands. Not a justification though. I'm
> not a regular on this list, but even slashdot.org is reporting that the
> list has been discussing making emacs friendlier to new users, and I'm
> on board with that, so I'll take any suggestions for improvement here,
> but it might be better done as a patch to 'completing-read'.

Ah, now that makes more sense.  I thought you'd sent your package in the
context of that discussion of improving the experience for novice users.

>> I do think it would be nice to have something like it, since it's an
>> alternative to the menus which has the advantage of being
>> auto-constructed, doesn't need the mouse, and focuses on the keybindings.
> Yep. Also, for me it was important that it present command descriptions,

Agreed.

> even if in the end it came at the expense of omitting command names to
> make the strings shorter.

That's a good tradeoff.

>> It would also be nice to make it usable from minibuffers as well ;-)
> Hmm, I wonder.. Maybe it already does programmatically on a per-case
> basis. Interactively, do you mean integrating into the minibuffer
> codebase? I've long wanted something like this for the minibuffer
> options to isearch-

I'm not sure exactly how it should do it.  But yes, `isearch` is an
obvious use case as well (I say "as well", because isearch doesn't
actually use the minibuffer).

>> >      (while (not (setq choice
>> >                    (cl-position
>> >                      (substring-no-properties ; Is -no-properties necessary?
>> >                        (completing-read prompt choices nil t))
>> >                      choices :test 'equal))))
>>
>> Why do you have this loop?  Doesn't the `require-match` arg of
>> `completing-read` make it unnecessary?
>
> I remember thinking so, too, and then needing to add the loop because
> completing-read was accepting a RET. My recollection is that it was
> sending an empty string to cl-position.

Ah, OK, that makes sense.

> But besides all that, it's great, right?

Yes, I like it,


        Stefan





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

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


Received: (at 43709) by debbugs.gnu.org; 1 Oct 2020 15:32:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 01 11:32:08 2020
Received: from localhost ([127.0.0.1]:37966 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kO0Yy-0005F1-43
	for submit <at> debbugs.gnu.org; Thu, 01 Oct 2020 11:32:08 -0400
Received: from mout.gmx.net ([212.227.17.20]:57541)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <boruch_baum@HIDDEN>) id 1kO0Yv-0005EW-AP
 for 43709 <at> debbugs.gnu.org; Thu, 01 Oct 2020 11:32:06 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;
 s=badeba3b8450; t=1601566316;
 bh=xcgPch1ketr0lJMtVrK4zlCZQ3Sa6Qu/P8NYM7GtgYQ=;
 h=X-UI-Sender-Class:Date:From:To:Cc:Subject:References:In-Reply-To;
 b=UIZSmVEvSnfz4+eBYuT8qkpDf26KWhN0Z6UnUysff22rByEx+9sA7TvPXqFSryrH4
 2ZIilHgLKTpwKB7EZspctSKcnNVrU9xZLkh8mk3eR9DuoC0t6o9xB382Z5sknbrrB7
 lRRkb0/yYLDJiAY2BqfqU+P4G4dXccF1co2Nt1/g=
X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
Received: from E15-2016.optimum.net ([72.89.170.172]) by mail.gmx.com
 (mrgmx104 [212.227.17.174]) with ESMTPSA (Nemesis) id
 1Mi2O1-1ksNVD3dbN-00e2Fm; Thu, 01 Oct 2020 17:31:56 +0200
Date: Thu, 1 Oct 2020 11:31:47 -0400
From: Boruch Baum <boruch_baum@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#43709: minibuffer keybinding cheatsheet and launcher [CODE
 SUBMISSION]
Message-ID: <20201001153147.3ucillviu62t2prf@HIDDEN>
References: <20200929165957.ibj67dnyaem6nezg@HIDDEN>
 <jwveemijcub.fsf-monnier+emacs@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <jwveemijcub.fsf-monnier+emacs@HIDDEN>
User-Agent: NeoMutt/20180716
X-Provags-ID: V03:K1:C+2r/LsSPPS0ul2FtJnLtGAA4MnY5ikxiDG1Nl86KSIRyWDWaME
 Tr1qQubajsUoGOVPtDGTwROBaB0aAkZSE1uaU2yoobBG2w94LVlg2Mr52fsGD2/dU3JfddL
 YHZN5PRznq7xhBwa1NkN4xllIDluwsXGE3pjFE/q/C3WXpczcCqGpU995agIRZU6fkwHV44
 3N6MwupDG3Qm9UFoUdO9Q==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:Xam8xrCHQaE=:JiIFgfYk6TJok+BpPl2nWi
 I5ML5L2md84gh/394q8QwjAN+49P1TMqbwyFFuJcWj8ZVoP5IwMJ6zuo++pKN0+Nnt38HtGck
 5fOGxRpfyyIIJrK+2OT6qWLOoh/MI9MMjrOyTMV9RpvelWpyUIK+BToce/58LiUv2UiivK1Mj
 LLHThBZ824ZuF8+v1OSdt4XPxDEIo06ldDRkgoaGfbLkXfdjbrnGOdeduEFMVMTiGEMKAiCvw
 XIcp3SPw+yGwvlt973KimFie9PxyUA4wE7wmodJmNHUERZRb06E3oBDXT6LT/Ftus9XRAh0fc
 mKkJm8vrDkNutqUfG2abAVrDz8ExGv6E7PVI6IHCtYqUqCDCb+YfTYQ8KHY0+K8ppPJwr/mGo
 0RCt4vRraUuOyKo5FqTxr/RplSBLVenjzfxNSXKZ6+pN5nWeSTdFixgEOYcugphq6tZny/+rW
 5jTUE8Crn/P1HTRxrilRacTK2Yg1PqPMHX5ncagt5dITxP5LhswHFyigGyKIyAj8VnQtuX9nX
 twhIp8ZSfb8k6W/5hJ4OWMV+9Ri91SKJRZacyDRiAeE5LavfjWD1x3M2FJi1VW5ZJOasimdvI
 g+TzcZtUJeuM5aIVBbUYkQpZOUcFKvn8NkJR9jPuxI7oBXIfwgbmpCH6e1B24dz6pg8UU5gTh
 Cpm4UWeRU8RQvU9Zqigtt/1xdoC3XGb+mBC1e+8eMsDe6EmCbdbyvOq38w93smZc057cZIKQk
 AsRKd4cNqDbomn+vbuHVZ3FiLmUjHiGE3qBFPQ6EaxEZWSVUY3ywqzQxIVFgiH7Iojun46qhA
 vNmrrrCdpH25xjpu+/IXGSqYqDWhSQvgJ5mGm3fQ4ovSL6dV9mY8pOEbrwuzM73+QNYzMDfXG
 C/0NU21H60OoGjCjo3tp7CHcfbL/GfYMetOfqn9hFDBTtPGLPw+3CF5J+0/HfelKJKd7kzNhT
 G9o8Jk1NIcD2PebCT/xo8V/GdBeE0xy+RTShvL3pLC9ryytY5BCgkXPgi6nwFJAGzbSeTMp6p
 XK8xtITU26w8GEkMj+JE5ydhy0ZTWNN02UCVdY85MvB9T8fHB9V4z1CDq3mX+s1t3CZN9Mma3
 czfuuaFYgd5e7iHUZ7uZSZxuSYsuDiluRADs2kUcv1jqr1n4LrA0FjxE10Iy+dXJdfOMreprK
 6OXsbV/sQpDlGjBaxorYLFszYL7wO31IHqgpKV50ZEPqnex4zKdfp3mIKHnU06ZSFrMe4M4eO
 OU93siX53XAhKDuSDF+VYyPkacSW7VYQsJHastg==
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 43709
Cc: 43709 <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.7 (-)

On 2020-10-01 09:51, Stefan Monnier wrote:
> I'm not completely sure what is the intended use scenario.

1) Interactively...

1.1) A user finds himself in an unfamiliar mode buffer, and isn't sure
     what that mode's options are and how to use them. You mention
     further that you tried it in a dired-mode, so you saw its default
     operation in such a case. For dired-mode, the result-list is very
     long; for other modes, such as occur-mode or a packages buffer,
     you'll get a shorter list. The more obscure the mode, the more
     useful this use-case.

1.2) A user has a vague idea of a command name of interest, so enters a
     regex or substring of it to see a list of keybindings and
     descriptions of matches (as relevant for the current buffer).

2) Programmatically...

2.1) A developer wants to offer a cheat sheet / launcher for a package
     (similar in function to transient/hydra) but with less programming.
     This package offers wide latitude of how to compose a command list,
     what to display, how to sort, how to prompt. The args can be
     trivially simple to quite complex.

     (defun my-mode-low-budget-transient ()
       (interactive)
       (when (eq major-mode my-mode)
         (key-assist ...)))
     (define-key my-mode-map "?" 'my-mode-low-budget-transient)

BTW, On the emacs-bug thread/URL, I shared with Drew Adams the
original inspiration for the package, which includes the motivation for
what seems like an obscure arg option (cmd . function)

> [ To see why I say it's not quite ready, here's my experience with it:
>   I just tried it in a fresh new Emacs session, and after `M-x
>   key-assist` (which itself is a problem because most users won't
>   know/bother to run this command way, so we'd need some more "obvious"
>   way to run it)

Always a problem with a new feature. When you say 'obvious', you seem to
mean more than the normal publicizing of a new feature?

>   I get a prompt for something

You mean the prompt "Optional: Enter command regexp or keymap name:"?

>   and without reading more the description I wouldn't know what the
>   prompt wants

True of very many emacs commands. Not a justification though. It could
be a multi-line verbose explanatory prompt.

>   (I think this prompt should only appear if requested explicitly)

Reasonable. Could be argued both ways. I have no preference, and just
thought it friendlier this way to explicitly present to the user all the
options, especially since this is supposed to be a 'help' function.
Programmatically, this prompt shouldn't ever appear.

>    and then it said "no choices found".

That's curious. I haven't seen that in my testing. What was your
response to the first prompt? What was the value of 'major-mode' of the
'current-buffer' when you ran the command?

>   So I tried again in a dired buffer, where it instead showed me a
>   minibuffer prompt "Select: " with no indication of what it is I
>   should be selecting,

I had difficulty deciding what text to use for this prompt because many
users can be expected to be using some non-default minibuffer completion
supplemental package (eg. ido, icicles, ivy), and those all have
slightly different behavior; many present a result-list without needing
to TAB.

>   after that I hit TAB (because I read that it uses `completing-read`,
>   but for the un-initiated it might not be obvious)

Again, true of very many emacs commands. Not a justification though. I'm
not a regular on this list, but even slashdot.org is reporting that the
list has been discussing making emacs friendlier to new users, and I'm
on board with that, so I'll take any suggestions for improvement here,
but it might be better done as a patch to 'completing-read'.

>   at which point it did show me a list of bindings and short
>   descriptions and when I selected the first entry (i.e. `!`) it
>   signal'd an error about wrong number of arguments. ]

Got it. Thanks much for your concrete suggestion further down on how to
correct this bug. Many of the other options *DO* work though; this is a
bug in the improper way the function calls some interactive functions.

> I do think it would be nice to have something like it, since it's an
> alternative to the menus which has the advantage of being
> auto-constructed, doesn't need the mouse, and focuses on the keybindings=
.

Yep. Also, for me it was important that it present command descriptions,
even if in the end it came at the expense of omitting command names to
make the strings shorter.

> It would also be nice to make it usable from minibuffers as well ;-)

Hmm, I wonder.. Maybe it already does programmatically on a per-case
basis. Interactively, do you mean integrating into the minibuffer
codebase? I've long wanted something like this for the minibuffer
options to isearch-

> See some comments below based on a quick look at the code.

I appreciate the comments a lot. Thanks for the constructive review.

> `where-is-internal` is supposed to return the shortest binding already
> when asked to return the "firstonly".

I wasn't getting my desired result with it..

> Your notion of length is slightly different, admittedly, but I wonder
> what were the concrete cases that motivated doing your own sorting

Oops. Forgetting just now. A secondary motivation for the sort was to
offer multiple sort options. In the end, I left it as an option for
programmers to pass their own sort function. For example, someone may
want to treat prefixes / upper-case differently.

> >      (while (not (setq choice
> >                    (cl-position
> >                      (substring-no-properties ; Is -no-properties nece=
ssary?
> >                        (completing-read prompt choices nil t))
> >                      choices :test 'equal))))
>
> Why do you have this loop?  Doesn't the `require-match` arg of
> `completing-read` make it unnecessary?

I remember thinking so, too, and then needing to add the loop because
completing-read was accepting a RET. My recollection is that it was
sending an empty string to cl-position.

> ....

But besides all that, it's great, right?

=2D-
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0




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

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


Received: (at 43709) by debbugs.gnu.org; 1 Oct 2020 13:51:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 01 09:51:49 2020
Received: from localhost ([127.0.0.1]:34984 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kNyzs-000253-NS
	for submit <at> debbugs.gnu.org; Thu, 01 Oct 2020 09:51:49 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:63523)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1kNyzp-00024o-SG
 for 43709 <at> debbugs.gnu.org; Thu, 01 Oct 2020 09:51:47 -0400
Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id F398B1002CF;
 Thu,  1 Oct 2020 09:51:39 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id D6E381001D2;
 Thu,  1 Oct 2020 09:51:37 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1601560297;
 bh=wTxiU2h5F3+F+OxMS/MpKykS6uZ7doXIgPUTSfRrMkk=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=l5c7Im19L4DzvPJxwt0MJhdYy1okHW5wKMcTGOu4pjLxX652HkReOckA3QCOclFpg
 a01QWHKHuXtdDEjMwCt9JUThZLMTmfz/YbQZOuCPpjmrWOtecN81bpWn3vwtrQ60wF
 G8BAfSjgMfqFiWQQrfHdxEjuyJSK/euCE5HbkaBM4/RlT9MH6hIX9rcph+fH5wC4No
 1tZHauh8OYi+MDKHXRlEA4I1Su1eLqcqYUncQsPpP56hyDCMt5z3AXZvwGJwVV2vnJ
 Pw4FMLHEZhJ5wCdMp6Bn96mXmHszChfnm0yaXBFQrNT7YR23NSbSqNUIrr3zKP8oRb
 ftApw2kX8MVzg==
Received: from alfajor (unknown [45.72.232.131])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id A38E6120225;
 Thu,  1 Oct 2020 09:51:37 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Boruch Baum <boruch_baum@HIDDEN>
Subject: Re: bug#43709: minibuffer keybinding cheatsheet and launcher [CODE
 SUBMISSION]
Message-ID: <jwveemijcub.fsf-monnier+emacs@HIDDEN>
References: <20200929165957.ibj67dnyaem6nezg@HIDDEN>
Date: Thu, 01 Oct 2020 09:51:36 -0400
In-Reply-To: <20200929165957.ibj67dnyaem6nezg@HIDDEN> (Boruch
 Baum's message of "Tue, 29 Sep 2020 12:59:57 -0400")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.055 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 43709
Cc: 43709 <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 (---)

> If you've ever used packages such as `ivy' or `magit', you've probably
> benefited from each's custom combination keybinding cheatsheet and
> launcher: `hydra' in the case of `ivy', and `transient' for `magit'. The
> attached package `key-assist' attempts to offer a generic and very
> simple alternative requiring only the `completing-read' function
> commonly used in core vanilla emacs. `key-assist' is trivial to
> implement "on-the-fly" interactively for any buffer, and
> programmatically much simpler to customize that either `hydra' or
> `transient'. And did I mention that it only requires `completing-read'?

I'm not completely sure what is the intended use scenario.

I mean, I understand the package is not 100% ready, so I'm interested to
know how you imagine it working *ideally* once the various kinks have
been sorted out.

[ To see why I say it's not quite ready, here's my experience with it:
  I just tried it in a fresh new Emacs session, and after `M-x
  key-assist` (which itself is a problem because most users won't
  know/bother to run this command way, so we'd need some more "obvious"
  way to run it) I get a prompt for something and without reading more
  the description I wouldn't know what the prompt wants (I think this
  prompt should only appear if requested explicitly) and then it said
  "no choices found".  So I tried again in a dired buffer, where it
  instead showed me a minibuffer prompt "Select: " with no indication of
  what it is I should be selecting, after that I hit TAB (because I read
  that it uses `completing-read`, but for the un-initiated it might not
  be obvious) at which point it did show me a list of bindings and short
  descriptions and when I selected the first entry (i.e. `!`) it
  signal'd an error about wrong number of arguments.  ]

I do think it would be nice to have something like it, since it's an
alternative to the menus which has the advantage of being
auto-constructed, doesn't need the mouse, and focuses on the keybindings.
It would also be nice to make it usable from minibuffers as well ;-)

See some comments below based on a quick look at the code.


        Stefan


> ;;   If you've ever used packages such as `ivy' or `magit', you've

For those who haven't, it would be good to describe what your package does.

> ;;; Dependencies:
>
> ;; `cl-seq' - For `cl-position', but `cl-lib' is long part of all
> ;;            modern emcasen.

There's no such thing as a `cl-seq` package.
There's a `cl-seq.el` file, which is part of the `cl-lib` package.

> (require 'cl-seq) ;; cl-member, cl-position

Please require `cl-lib` rather than `cl-seq` since which function is
implemented in which file of `cl-lib` is an internal detail (e.g. in
Emacs-24.1 `cl-seq` does not provide `cl-position` but `cl-lib` still does).

> (defun key-assist--get-keybinding (cmd &optional key-map)
>   "Return a string with CMD's shortest keybinding."
>   (let (shortest)
>     (dolist (key (mapcar 'key-description
>                          (where-is-internal
>                            cmd key-map nil t)))
>       (when (or (not shortest)
>                 (> (length shortest) (length key)))
>         (setq shortest key)))
>     shortest))

`where-is-internal` is supposed to return the shortest binding already
when asked to return the "firstonly".  Your notion of length is slightly
different, admittedly, but I wonder what were the concrete cases that
motivated doing your own sorting (might be worth adding that as
a comment in the code).

>     (let ((not-found t))
>       (mapc (lambda (x)
>               (when (string-match x (format "%s" cmd))
>                 (setq not-found nil)))
>             key-assist-exclude-regexps)
>       not-found)))

You should move the `(format "%s" cmd)` out of the loop (and use
`dolist` instead of `mapc`).

>      ((keymapp spec)
>        (let (cmd)
>          (dolist (elem spec)

Please use `map-keymap` rather than `dolist` so as to handle all the
different keymap formats.

>      (while (not (setq choice
>                    (cl-position
>                      (substring-no-properties ; Is -no-properties necessary?
>                        (completing-read prompt choices nil t))
>                      choices :test 'equal))))

Why do you have this loop?  Doesn't the `require-match` arg of
`completing-read` make it unnecessary?

>      (funcall (car (nth choice commands))))))

This should probably be `command-execute` rather than `funcall` to fix
the wrong-number-of-arguments error I bumped into.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#43709; Package emacs. Full text available.
Added tag(s) patch. Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

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


Received: (at 43709) by debbugs.gnu.org; 29 Sep 2020 19:07:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 29 15:07:38 2020
Received: from localhost ([127.0.0.1]:57221 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kNKyQ-0003uQ-Gb
	for submit <at> debbugs.gnu.org; Tue, 29 Sep 2020 15:07:38 -0400
Received: from userp2120.oracle.com ([156.151.31.85]:33868)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <drew.adams@HIDDEN>) id 1kNKyN-0003uC-U3
 for 43709 <at> debbugs.gnu.org; Tue, 29 Sep 2020 15:07:37 -0400
Received: from pps.filterd (userp2120.oracle.com [127.0.0.1])
 by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 08TJ53kR136968;
 Tue, 29 Sep 2020 19:07:28 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com;
 h=mime-version :
 message-id : date : from : sender : to : cc : subject : references :
 in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29;
 bh=OPFF7HUIzsj5tKtftR63/s+BhR9M0j5xOQHy1RdR/w4=;
 b=k5qSjpzivUH6Mr7Q5Crf7Gqq4ioRTM4nBSjtx3cYp5rsv3DFQ2bn4wltICdcJZ+E/DDM
 +NVpe+lXnkq+dvhXeviCc7o15vj5f+9OW2d5x5nXgQaTfFHz5Nh6RSFfNm9C6AuqLryt
 F2+XPKTjymesQNNGpb2L99gbupmHOt//xdCbtsjb0mZPVcwRWBiNITwkB820mpGYY+XC
 47Gm85L1K4asEU36LH/idlwrVw9qnBA69qXCMLtvT7yBEKvQF63fUgyHVcZf5HR9banQ
 80wptO7iHCyHZVM3Y/ivo9JT3r/SRTMqgLVrGRDsRLjxgs0yaDqeoNRG9f61ptnyHS1P nQ== 
Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71])
 by userp2120.oracle.com with ESMTP id 33sx9n4k6d-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL);
 Tue, 29 Sep 2020 19:07:28 +0000
Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1])
 by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 08TJ0qGO087064;
 Tue, 29 Sep 2020 19:05:27 GMT
Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72])
 by aserp3030.oracle.com with ESMTP id 33uv2eb57v-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Tue, 29 Sep 2020 19:05:27 +0000
Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12])
 by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 08TJ5OCM025406;
 Tue, 29 Sep 2020 19:05:25 GMT
MIME-Version: 1.0
Message-ID: <85477a60-4296-4ae5-9ce9-a82b8787dec4@default>
Date: Tue, 29 Sep 2020 12:05:23 -0700 (PDT)
From: Drew Adams <drew.adams@HIDDEN>
To: Boruch Baum <boruch_baum@HIDDEN>
Subject: RE: bug#43709: minibuffer keybinding cheatsheet and launcher [CODE
 SUBMISSION]
References: <20200929165957.ibj67dnyaem6nezg@HIDDEN>
 <ba7b0075-5f95-4304-8b83-8fae031f48b2@default>
 <20200929182219.5r5nbvmipo33l24q@HIDDEN>
In-Reply-To: <20200929182219.5r5nbvmipo33l24q@HIDDEN>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1  (1003210) [OL
 16.0.5056.0 (x86)]
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9759
 signatures=668680
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0
 spamscore=0 adultscore=0
 suspectscore=0 malwarescore=0 bulkscore=0 mlxlogscore=999 mlxscore=0
 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000
 definitions=main-2009290158
X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9759
 signatures=668680
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999
 suspectscore=0
 phishscore=0 mlxscore=0 lowpriorityscore=0 adultscore=0 clxscore=1015
 spamscore=0 impostorscore=0 malwarescore=0 bulkscore=0 priorityscore=1501
 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000
 definitions=main-2009290158
X-Spam-Score: -2.9 (--)
X-Debbugs-Envelope-To: 43709
Cc: 43709 <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.9 (---)

> Oh. Had I known... Would I? / Wouldn't have I?=20

Yes, you should.  And thanks for doing so.

Dunno whether filing a bug is the best way to
provide it, but that will work, no doubt.

Another possibility is to use emacs-devel@HIDDEN
Many more people read that mailing list,
including most who also pay attention to the
bug list.

> BACKGROUND: ...
> ATTACHED: ...
> FOLLOW-UP: ...

That all sounds good.  Keep it up.

FYI: Another related library is `which-key.el',
which you may already be aware of.

https://github.com/justbur/emacs-which-key




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

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


Received: (at 43709) by debbugs.gnu.org; 29 Sep 2020 18:26:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 29 14:26:56 2020
Received: from localhost ([127.0.0.1]:57124 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kNKL2-0002uP-IH
	for submit <at> debbugs.gnu.org; Tue, 29 Sep 2020 14:26:56 -0400
Received: from mout.gmx.net ([212.227.17.21]:33733)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <boruch_baum@HIDDEN>) id 1kNKKz-0002uA-8M
 for 43709 <at> debbugs.gnu.org; Tue, 29 Sep 2020 14:26:55 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;
 s=badeba3b8450; t=1601404002;
 bh=TVXWQuC0/hUynx/mILluKDzIwUSbynEFXI4uLtmUgFA=;
 h=X-UI-Sender-Class:Date:From:To:Cc:Subject:References:In-Reply-To;
 b=eKLIYPbBvJjP0tmmNufKJGbrFdC/VJC6dY3Hubqtw48TaZmRkBoVrAzlug6SalwqA
 x1NknSJIrEVrqj2FPIcUrp5yPMIGpZ2Ywv76ydmr8MLtt9PBdM7yFMN74B/VB8EGVE
 lp+7U+Ks7e2Q9vTPvgA1zd/QtpR29AHuCDyRlcVg=
X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
Received: from E15-2016.optimum.net ([72.89.170.172]) by mail.gmx.com
 (mrgmx104 [212.227.17.174]) with ESMTPSA (Nemesis) id
 1MI5UN-1kALll1CP1-00FB3w; Tue, 29 Sep 2020 20:26:42 +0200
Date: Tue, 29 Sep 2020 14:26:39 -0400
From: Boruch Baum <boruch_baum@HIDDEN>
To: Drew Adams <drew.adams@HIDDEN>
Subject: Re: bug#43709: minibuffer keybinding cheatsheet and launcher [CODE
 SUBMISSION]
Message-ID: <20200929182639.2eemc2fmpps42mp6@HIDDEN>
References: <20200929165957.ibj67dnyaem6nezg@HIDDEN>
 <ba7b0075-5f95-4304-8b83-8fae031f48b2@default>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <ba7b0075-5f95-4304-8b83-8fae031f48b2@default>
User-Agent: NeoMutt/20180716
X-Provags-ID: V03:K1:jZoqkCu6KMA7NMb+A4fzlQKRKb1Q4CorybondcogNdIRlq2nLty
 HYxhixX3+Q1PvMOq9a34Z6vy9038dy47oe3uHcVZBPS6l/ko+w0+VrAxPaYEyjI1z3ug58g
 mQMQk9j0GlLlNlw8lNT0oX+NJN0PkMcBgqrVkVTsDhrt2tM2W6fy3lqs1sXpjQaVe8s81uM
 ULB0USRI6ktKug1h7ZHig==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:e2Pf+xN8+4w=:9mkS0VgqOLJ3Q5YS+yZctD
 3YOzpvqnqmKrihZ8hEMPuskIrzJVMlxtAARqI2OUhmKSlRDG3SeGuYzd885RG/7whcnf867rt
 Cpx25TCxGu087txhOiRAYcvBcWt2ctnd0ONjyr5Ev/LLG2CeSSrRTeYaicxbF482bRqOWGNQN
 bDSKNq3LWngJo9xTyt74xOKTLFl47geDMTDLFoewtczwq498F5SvwewhFR8L3mv1Ax3Sv86ol
 NJzkWoTcspFu2B/ESFd98wZt0xjSlZALCZ4ArjmJydop35NG/I8aQ56BNT/Uf4IxTiyzpnFlJ
 y+gxvQYPt85EoLcJupOCAoFvqzRlwl4n8OLd8ffvL07yXvdu8oCllnNkKb56Mexmbkl8Xmdq3
 i9kFNjsZtUi0kZvfdtDZ5s8lswXhTIMQxzwO15iHI1c60wdm2ZKGH7SDT1nVpXv+a7ian7A7Q
 eZkRDuwXetlLWeAg/+3ZXpLuCwJc7A4HBm7wpCie5h1t4mNNayEaYiSNv2wMOCH8b8Z2GPOkM
 8SNWgbjYBMhmCsWX0rkT4IqpzDLJoM6A7D3usrwOeDMMG+NToSEyR3LMo7VbivgTf/c7UkhW4
 FO/VhGflUDB2WqQNX0nTQ37K2bwgvp2r6DFoLNQYxJqcdtL26hsd2gGcCWJGrqUmgHe7kHIxJ
 WrS7jnlnUq3r9twzMw/7jae0umgAJTddl6CERDyNKKv8FItVjH7upCw5ETzcMl+gVCbhCu9Kz
 TEsuxvnb32MVc0As5Enhod14zfbcLy7TROiKsctBIMqC2fRcawS/LHHm9iFz2zZTUBeZJeF/a
 u+77uZtwzPogPrPyETC4GiB7mIxP6qlSdwnd4nEYcqyIBteXBRxeSsTm491tl0dSAf9nyFXn3
 Sm0+ElAKFXeJkAhBOI/gGMA+OuYwK90U3fuZLcHO4zXf8u5vkuWZ06g2wpIUDbWRCCT5j17vI
 VQnExZNYn5GQqMxBLjapCPIykfRXRzu/qITHqq6awj847XjG4gpj2CHF/YBGThRcY3Bac1rSX
 oq2S0XgBbr/1oZ0b94ct/sEuG6bQ7xtFSvsf7BQUJhKgW+LJ4FuxuKqvroOqieWSSBbj/labW
 jFxP/SaZeWA0rlW7r4v69UAVpSDacGSGWGKZodxnB7J/+Ixzqb1322dRj6REgP3ZE2CZVZghz
 tfZ9qa8jziEA/VIyNGxzUngjVNkipO8GBa/W/UV/znamyCw29CDY9y6l3x+vNToZvPLB3zpNZ
 xsvMB4Sr5+uRWq1in7/rR8BhZ2p3HUYI0/SHsjQ==
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 43709
Cc: 43709 <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.7 (-)

Also, note how in the `diredc-trash-assistant' prototype, how I
exploited the PROMPT arg to sneak in extra status information.

=2D-
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0




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

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


Received: (at 43709) by debbugs.gnu.org; 29 Sep 2020 18:22:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 29 14:22:37 2020
Received: from localhost ([127.0.0.1]:57116 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kNKGr-0002o3-IF
	for submit <at> debbugs.gnu.org; Tue, 29 Sep 2020 14:22:37 -0400
Received: from mout.gmx.net ([212.227.17.22]:42997)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <boruch_baum@HIDDEN>) id 1kNKGp-0002np-7h
 for 43709 <at> debbugs.gnu.org; Tue, 29 Sep 2020 14:22:36 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;
 s=badeba3b8450; t=1601403742;
 bh=1wKPyL6uaS16qZDu68drFI6N0Bcu7ytVHSxqKJuDF8o=;
 h=X-UI-Sender-Class:Date:From:To:Cc:Subject:References:In-Reply-To;
 b=VuUBFdlmiVfimcmGAs0Ttj6WtbJw3HuEU3Hu3VM+q9L7E//2DvwL/cyM+pRk+6NZA
 Qeh2L4LyG/Dmp1aPExeEEblUdVK9JFKKzIsVnL9CCc1JqU/eCD4shyVudMSrXmPGcu
 Vn/8yIpX+yfaQ+2vnO/hyR8EcBZZjy2pSFRNG8uM=
X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
Received: from E15-2016.optimum.net ([72.89.170.172]) by mail.gmx.com
 (mrgmx105 [212.227.17.174]) with ESMTPSA (Nemesis) id
 1MNbkp-1k2bW10H4V-00P6mg; Tue, 29 Sep 2020 20:22:22 +0200
Date: Tue, 29 Sep 2020 14:22:19 -0400
From: Boruch Baum <boruch_baum@HIDDEN>
To: Drew Adams <drew.adams@HIDDEN>
Subject: Re: bug#43709: minibuffer keybinding cheatsheet and launcher [CODE
 SUBMISSION]
Message-ID: <20200929182219.5r5nbvmipo33l24q@HIDDEN>
References: <20200929165957.ibj67dnyaem6nezg@HIDDEN>
 <ba7b0075-5f95-4304-8b83-8fae031f48b2@default>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="jlyugc4je2zrr3gx"
Content-Disposition: inline
In-Reply-To: <ba7b0075-5f95-4304-8b83-8fae031f48b2@default>
User-Agent: NeoMutt/20180716
X-Provags-ID: V03:K1:yWxw94tTzsuXoaodueWT6NOxubGoVJMotnTWm4SelIo6UphZS94
 +U+L06YacyO8z48OAdICWFGfcZHifVqYlYc1kwZ/q7rQy3eeOqwp0t7H+0CfQ2twBmP8pDZ
 IDaxBEu6FwTHcaNcJ71dsgSuV4HJniP17usxQ6n9nLUJeqSXIQL0TMCErQfE9+rgmaV4pI4
 +5mGpdD6NC89Dt87SXVIQ==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:ZxphVb80qhg=:4Tguy72oiadsz2Iy36Mh1T
 rrdG7G6+ao70fdlqERZwErEFvL3oWOvVI4sHo+tGO0IJOiNJJdvQ5YloIPO6zIwre3EfeS99g
 tOREeGK0bG3zR95g/LYNXcRrLqVrhOy4e/qbzzx5cEnqa/I2iCz74PBo/C5B4R/q4+sURzIpZ
 8czo2/HwdazhmPaKmDQAphPev9/S2Qt4PJxvteFmFfHNLW1kJATM/9Dytkd1xECS8Zny+zTv5
 aewttXk8WbcUgdLDtNdybTZ2URKvTQsfXxUCWJLdpZta0TcVvlRtCRFSM6b68YUZYWm+Fq3j8
 ffWyh4XCBNaEqUePy7GLJtIrmEi5Pl+iov/zIba3vPc6q682ZfR0IBhkKDOtLPRzxNdOGjJLR
 hcnH3gAs71oGgI8qBznXpF1+lzOoUnMVNcSEVjFINmCqauxJ75b1fkpevRzmBBN7V/eUiw7Nj
 Dx9ZAM2ryG+1FB0nnEQyDQ3pRKyq5WhpCldDNfBBma1HRPGfw1v3E+pX7ZmsDsiEbDBjxy8EH
 C3JPw1Uv+T3Y3/pUMXgXxqWOG0usm1jFeh/YUZiltebNH+9vsyx34D6r9Tzc8GtIFlxMkEexA
 TeOxctI52FKzjEiey4GCsaAEtFxDAHrObN9ki201W5shfp20RGByrLnD+b8FzOPNkZ3oZt+xm
 lnnFeGkr7ySBb+kRjuWWaiaPr+a8IF/uWkXXE6Cx0GZfdZrz9BCoK82xvDly44aGDm0LYg4wp
 9Uya4MUTzowPsPuWgxRJx6cHJlQS1GIohlawCw9CzvDjpqzsvL3b3N+Q+1gEfUeeE1/a+YlS5
 GQLvj1ZgOKriQ304XhC0vWRcHe02XRinUfRc9weviCfPCVHEyTt6b+VYeZ642aNGm4R0pFmaD
 9Fbz6TpqK4QZwHnSGQuDdqUuZPIWMdkWmoD/0PNRxsfwNEg0RPnOiUS26P7gJaatDDyWJmeKC
 W5R595Npu8PA9u4yu+WJ8k4VLUNNs5SboxrErYN3YTGSx3X5vQrMSHD7GfZuj+0V8EkvjE8Dv
 6Ky1M6BmFvE1GEEypEx1Ggi7j52Iw6cj7i/hAXjS27y6ErC8aXy1uXJsYdSxWJcM1MuRJAWNr
 V7fUG417rZ+g+4f5yEOZg1hINi/6I9FJbNdp9dV7TMab9bMlooI+Cm/9VKh37yZDJVVa8VUcC
 dGx4bNdCFjxiPvXqDH9QgATNbwkqb8sOIPPa13itBn12Rvl80sPUmCji14BesfyrT3FqOxuin
 CTr7VW0CzPZgGhNcGVZGudosY6hFXjw2Vdxluwg==
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: 43709
Cc: 43709 <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: -2.3 (--)


--jlyugc4je2zrr3gx
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On 2020-09-29 10:41, Drew Adams wrote:
> Cf. `keysee.el'
>
> https://www.emacswiki.org/emacs/KeySee
>
> https://www.emacswiki.org/emacs/download/keysee.el

Oh. Had I known... Would I? / Wouldn't have I? From reading the
emacswiki description, it seems that there are some differences in
presentation. My motivation was specifically to write just a few lines
for an element of another code submission I have pending, and then the
idea got out of control. It didn't occur to me to check emacs-wiki.

BACKGROUND: I have a collection of dired extensions that'll be ready for
submission as soon as I complete the documentation. It includes a set of
'trash' management functions, eg. smart empty trash, restore trashed
file(s), report trash status. But who can be expected to remember all
the arcane keybindings of all the arcane modes? So I wrote it hard-wired
for about four commands of diredc-trash, and then ...

ATTACHED: I'm attaching that original function because someone may ask
why include in `key-assist.el' a programmatic option to supply a list of
elements (command . function). In the attached example, you can see that
I'm presenting a description of the command `diredc-trash-toggle' based
upon what it would do at any particular time.

FOLLOW-UP: Another follow-up might be to supply some specific code for
some notorious major modes. I'm thinking in particular of `calc-mode',
which is such a beauty-in-the-rough, but suffers from a particularly bad
case of keybinding hell (it also suffers from a consistent absence of
docstrings).

=2D-
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0

--jlyugc4je2zrr3gx
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="diredc-trash-assistant.el"

(defun diredc-trash-assistant ()
  "Minibuffer cheatsheet and launcher for diredc-trash functions."
  ;; This was the inspiration for `key-assist.el'
  (interactive)
  (let ((zz (lambda (x)
              (let (shortest)
                (dolist (key (mapcar
                               'key-description
                               (where-is-internal
                                 x
                                 diredc-mode-map nil t)))
                  (when (or (not shortest)
                            (> (length shortest) (length key)))
                    (setq shortest key)))
                shortest)))
        (options
                   (list (list (if delete-by-moving-to-trash
                                 "Switch to using deletion"
                                "Switch to using trash")
                               'diredc-trash-toggle)
                     '("Jump to trash files dir" diredc-trash-view)
                     '("Report trash size"       diredc-trash-info)
                     '("Empty the trash"         diredc-trash-empty)
                     '("Restore file at point"   diredc-trash-restore)))
        (prompt (concat (diredc-trash-info) "\nSelect: "))
        choices choice)
    (setq choices (mapcar (lambda(x) (format "%-23s %s" (car x) (funcall zz (cadr x))))
                          options))
    (while (not (setq choice
                  (cl-position
                    (completing-read prompt choices nil t nil 'choices )
                    choices :test 'equal))))
    (funcall (cadr (nth choice options)))))

--jlyugc4je2zrr3gx--




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

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


Received: (at 43709) by debbugs.gnu.org; 29 Sep 2020 17:41:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 29 13:41:51 2020
Received: from localhost ([127.0.0.1]:57073 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kNJdP-0001q9-41
	for submit <at> debbugs.gnu.org; Tue, 29 Sep 2020 13:41:51 -0400
Received: from aserp2120.oracle.com ([141.146.126.78]:53548)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <drew.adams@HIDDEN>) id 1kNJdJ-0001pu-UY
 for 43709 <at> debbugs.gnu.org; Tue, 29 Sep 2020 13:41:49 -0400
Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1])
 by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 08THdW8q026439;
 Tue, 29 Sep 2020 17:41:40 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com;
 h=mime-version :
 message-id : date : from : sender : to : subject : references :
 in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29;
 bh=XMGB+clbtwvU6CQnvE9n3vEAiR7z1+qRbQm1ldDMDeI=;
 b=Dpyt9ZvxxpwJhURDSoHfZjQZE97y4TlZaWmW/oEEApYgLqrNGL/mj08M/yoJo+SINIUg
 yQxaliUk8jldR4ITI5HYsbsa/pg7zt7GyKGIgXUhanLCf+s/RSnhFryu1scoyU92CHLf
 7nsFwQbHwPo/OBUI93Lnrcmj6LFEn7yo1DCy9nVxLeSPo+3ghmqHCTs9YescUGvpXgTZ
 ud3iihecG4Wc33a61LNsyLFpLLU2XDZvRTsnk5rUy6yQZ25OdFDCit/wkOc71vCDtnip
 IvirNlsJVoZOQfZPjySvCgqiifTssv6Bsh5msF3a3Fylh/mbwlrQUPAJGlbzIya4E4ri Vw== 
Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79])
 by aserp2120.oracle.com with ESMTP id 33swkkv9w6-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL);
 Tue, 29 Sep 2020 17:41:39 +0000
Received: from pps.filterd (userp3020.oracle.com [127.0.0.1])
 by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 08THekMM111487;
 Tue, 29 Sep 2020 17:41:39 GMT
Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236])
 by userp3020.oracle.com with ESMTP id 33tfdsfwtd-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Tue, 29 Sep 2020 17:41:39 +0000
Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12])
 by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 08THfbmE016539;
 Tue, 29 Sep 2020 17:41:37 GMT
MIME-Version: 1.0
Message-ID: <ba7b0075-5f95-4304-8b83-8fae031f48b2@default>
Date: Tue, 29 Sep 2020 10:41:36 -0700 (PDT)
From: Drew Adams <drew.adams@HIDDEN>
To: Boruch Baum <boruch_baum@HIDDEN>, 43709 <at> debbugs.gnu.org
Subject: RE: bug#43709: minibuffer keybinding cheatsheet and launcher [CODE
 SUBMISSION]
References: <20200929165957.ibj67dnyaem6nezg@HIDDEN>
In-Reply-To: <20200929165957.ibj67dnyaem6nezg@HIDDEN>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1  (1003210) [OL
 16.0.5056.0 (x86)]
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9759
 signatures=668680
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999
 phishscore=0
 adultscore=0 malwarescore=0 spamscore=0 mlxscore=0 bulkscore=0
 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2006250000 definitions=main-2009290149
X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9759
 signatures=668680
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0
 mlxscore=0 phishscore=0
 suspectscore=0 mlxlogscore=999 clxscore=1011 priorityscore=1501
 impostorscore=0 lowpriorityscore=0 bulkscore=0 spamscore=0 adultscore=0
 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000
 definitions=main-2009290149
X-Spam-Score: -2.9 (--)
X-Debbugs-Envelope-To: 43709
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.9 (---)

> If you've ever used packages such as `ivy' or `magit', you've probably
> benefited from each's custom combination keybinding cheatsheet and
> launcher: `hydra' in the case of `ivy', and `transient' for `magit'. The
> attached package `key-assist' attempts to offer a generic and very
> simple alternative requiring only the `completing-read' function
> commonly used in core vanilla emacs. `key-assist' is trivial to
> implement "on-the-fly" interactively for any buffer, and
> programmatically much simpler to customize that either `hydra' or
> `transient'. And did I mention that it only requires `completing-read'?


Cf. `keysee.el'

https://www.emacswiki.org/emacs/KeySee

https://www.emacswiki.org/emacs/download/keysee.el




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

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


Received: (at submit) by debbugs.gnu.org; 29 Sep 2020 17:00:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 29 13:00:15 2020
Received: from localhost ([127.0.0.1]:57035 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kNIz8-0000sD-RD
	for submit <at> debbugs.gnu.org; Tue, 29 Sep 2020 13:00:15 -0400
Received: from lists.gnu.org ([209.51.188.17]:60046)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <boruch_baum@HIDDEN>) id 1kNIz6-0000s5-Aw
 for submit <at> debbugs.gnu.org; Tue, 29 Sep 2020 13:00:13 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:40116)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <boruch_baum@HIDDEN>)
 id 1kNIz4-0007RN-H9
 for bug-gnu-emacs@HIDDEN; Tue, 29 Sep 2020 13:00:10 -0400
Received: from mout.gmx.net ([212.227.17.20]:57707)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <boruch_baum@HIDDEN>)
 id 1kNIz0-0000Ar-B9
 for bug-gnu-emacs@HIDDEN; Tue, 29 Sep 2020 13:00:10 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;
 s=badeba3b8450; t=1601398800;
 bh=x/prd6ycfv8FgCfheIkxELMB8n5KRBZory+qMGm3XWQ=;
 h=X-UI-Sender-Class:Date:From:To:Subject;
 b=emmIY8WjGc+t7bbduRr/4oWY4Kx3Z1PcUk/NzxidfBBwNqvt490CDCxD6hciaLr1e
 KL16meXRFmE0Pd7nNp/+HxylFUxH6xJQwUWEYE8xWW1eW6QjP45j7SQiR75OQWWLrp
 6Q1pL2jvD8pfxbwgyVzT6B8VljfLRAbUL6kHvcIk=
X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
Received: from E15-2016.optimum.net ([72.89.170.172]) by mail.gmx.com
 (mrgmx104 [212.227.17.174]) with ESMTPSA (Nemesis) id
 1MeCtj-1kwvJQ3SwZ-00bH1Y for <bug-gnu-emacs@HIDDEN>; Tue, 29 Sep 2020
 19:00:00 +0200
Date: Tue, 29 Sep 2020 12:59:57 -0400
From: Boruch Baum <boruch_baum@HIDDEN>
To: Emacs Bug Reporting <bug-gnu-emacs@HIDDEN>
Subject: minibuffer keybinding cheatsheet and launcher [CODE SUBMISSION]
Message-ID: <20200929165957.ibj67dnyaem6nezg@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="6mzweytivy3davt4"
Content-Disposition: inline
User-Agent: NeoMutt/20180716
X-Provags-ID: V03:K1:4ODrfoiEzcs3tS0x/EgbwGQL+a11iB/h/CuTfLO+FTfoGyvIQy8
 AGI9XT6U5mMBqilfUSc1bmpMYRF2xP/3r0x02QkF13EvcR4jVNlRoxBqZIpIsTxktD6WdKe
 nbZNKAuqtTwMKyqkIA2sDUCZUj2r9k/MjPW/piKi94NbC4jEdvn9AKhCllwL2E+6aAyJzJJ
 OMBwUSTGakQXbusNAIbJA==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:wRy5TLbBJUU=:1rdq8k2YDF8Nj9k/j2NCDP
 ybirLQCSqKHELkZAieVJvIa7DBAfyBmaro36798prRB+B/GYoygOHwnnfKmgIbTAMLmUXfBUz
 stCnA7DG7V9WK02lqzl/hzIjyCMmrdwZN50n/TO6dbF7a0hUuhYizKuN1VAvzWfETByc5g2oe
 mRZZF7SReJVzspU6sakMuv0taPwkdjPnHC8Ph5YFmYSJz5nf6FRKGp4qyvh9txIu4CLRAGv27
 InQJKS3hKsZgGEebtRjBO6dQaIUJsn/VXf5kF9AnkD6ZI6w6Jrk6ZEqc8UvDMpjkZCQAh4WF6
 pXTVIfAg5L+B4NuMhnvXLbz2slpLKwjLPXFnPDJfXoLFzN+3WjnCJ0vZtfPcUgQ0kJMMtUxPI
 tFcgdEvUb+xqkTqpnEXLsgHbnw4sYxQPf1hD+QBTdGFsHkVfEa7TVQjkCtG3OOP9vcrllxraC
 Q9ucWgzLbAmcREeoe/GUxhszYe7VfcfPcY8649sRZoWfcz9ipcz+mZ/tQ7EVqYO2940R5zvTf
 iHDHAYcVb6WWLaVwnr5hbvVNgXWCYqqkqUHPLX6Rpdxybofr6RIPk/UgELZ75jr9Zb1X7zqfc
 yH9LAs008jZM7D/6Pvk82pD7E+inboZfqHBh1HSUeIsvAR0GRyf5KYC2ukwYnw0zQ3/5lOfZq
 9roSAgmJc+sFRQaFNjlzusBvgQXynF7SESOmVj/qlBfDv5qK8zXhCUKq374sqeJomSgGCAwiC
 eX7stGGVS+79jSpNurJ7t3eFkig2L7DPumtzBzTyovdKSCuGG0//jq2Mgbr5ZX6nOHVtSEJtU
 4SpFsf5gwKMzcibwFf+Jibvr+uR1W8QMw2WTEtYPD4ywo/vCiqt2T33Wm2u5G9C1OmMWKr/uD
 UQfpI7hp57UMWRCgMZAI3hGxIMDoV5knxyhBiu0c7jbbL15N0q5D2Ek6AFRcoX65vDwFHjl73
 CY666DgYpcFeTUxh4hFjmmPeD6TNMUioPrQt/WRl0TMJzvm02TcNei8YQMtfsoCXcllpYDxbM
 QILcaJ0RkaIBzFflg319X9kwUJPRX61GGtUQIDmS768+OJaBVfC4tc+/ba+8FwR/wUov/oENz
 PLghP4lJsGM22nOq0Uuz5M2oXO27iRO48PaIb6SEB1bNlFmrxicmjTf2Mp2SFxI3FL/WF/BPY
 XviWRcIh/D2zFLteI+vcJBLYI64x/Fk3zpKjG56Awu/GGgeYc0ezvgmxvIMT1T6rIctRhpbEB
 1veKvvGQpvSTJe81Oc8g1J3ZB/0VOG4tHXE5ZUQ==
Received-SPF: pass client-ip=212.227.17.20; envelope-from=boruch_baum@HIDDEN;
 helo=mout.gmx.net
X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/29 13:00:00
X-ACL-Warn: Detected OS   = Linux 3.11 and newer
X-Spam_score_int: -31
X-Spam_score: -3.2
X-Spam_bar: ---
X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7,
 RCVD_IN_MSPIKE_H2=-0.614, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.6 (/)
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.4 (--)


--6mzweytivy3davt4
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

If you've ever used packages such as `ivy' or `magit', you've probably
benefited from each's custom combination keybinding cheatsheet and
launcher: `hydra' in the case of `ivy', and `transient' for `magit'. The
attached package `key-assist' attempts to offer a generic and very
simple alternative requiring only the `completing-read' function
commonly used in core vanilla emacs. `key-assist' is trivial to
implement "on-the-fly" interactively for any buffer, and
programmatically much simpler to customize that either `hydra' or
`transient'. And did I mention that it only requires `completing-read'?

=2D-
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0

--6mzweytivy3davt4
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: attachment; filename="key-assist.el"
Content-Transfer-Encoding: quoted-printable

;;; key-assist.el --- minibuffer keybinding cheatsheet and launcher -*- le=
xical-binding: t -*-

;; Copyright =A9 2020, Boruch Baum <boruch_baum@HIDDEN>
;; Available for assignment to the Free Software Foundation, Inc.

;; Author: Boruch Baum <boruch_baum@HIDDEN>
;; Maintainer: Boruch Baum <boruch_baum@HIDDEN>
;; Keywords: minibuffer keybindings
;; Package: key-assist

;; This file is NOT part of GNU Emacs.

;; This is free software: you can redistribute it and/or modify it
;; under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; This software is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with this software.  If not, see <https://www.gnu.org/licenses/>.

;;
;;; Commentary:

;;   If you've ever used packages such as `ivy' or `magit', you've
;;   probably benefited from each's custom combination keybinding
;;   cheatsheet and launcher: `hydra' in the case of `ivy', and
;;   `transient' for `magit'. The current package `key-assist'
;;   attempts to offer a generic and very simple alternative requiring
;;   only the `completing-read' function commonly used in core vanilla
;;   emacs. `key-assist' is trivial to implement "on-the-fly"
;;   interactively for any buffer, and programmatically much simpler
;;   to customize that either `hydra' or `transient'. And did I
;;   mention that it only requires `completing-read'?

;;
;;; Dependencies:

;; `cl-seq' - For `cl-position', but `cl-lib' is long part of all
;;            modern emcasen.

;;
;;; Installation:

;; 1) Evaluate or load this file.

;;
;;; Interactive operation:

;;   Run M-x key-assist from the buffer of interest. Specify a
;;   selection (or don't), press <TAB> to view the presentation, and
;;   then either exit with your new-found knowledge of the command
;;   keybindings, or use standard emacs tab completion to select an
;;   option, and press <RETURN> to perform the action.
;;
;;   If you choose not to respond to the initial prompt, a list of
;;   keybindings and command descriptions will be generated based upon
;;   the first word of the buffer's major mode. For, example, in a
;;   `w3m' buffer, the list will be of all interactive functions
;;   beginning `w3m-'. This works out to be great as a default, but
;;   isn't always useful. For example, in an `emacs-lisp-mode' buffer,
;;   what would you expect it to usefully produce? At the other
;;   extreme might be a case of a buffer too many obscure keybindings
;;   of little use.

;;   You can also respond to the prompt with your own regexp of
;;   commands to show, or with the name of a keymap of your choice.
;;   For the purposes of `key-assist', a regexp can be just a
;;   substring, without REQUIRING any leading or trailing globs.

;;   In all cases, note that the package can only present keybindings
;;   currently active in the current buffer, so if a sub-package
;;   hasn't been loaded yet, that package's keybindings would not be
;;   presented. Also note that the commands are presented sorted by
;;   keybinding length, alphabetically.

;;
;;; Programmatic operation:

;;   See the docstrings for functions `key-assist' and
;;   `key-assist--get-cmds'.

;;
;;; Configuration:

;;   Two variables are available to exclude items from the
;;   presentation list: `key-assist-exclude-cmds' and
;;   `key-assist-exclude-regexps'. See there for further information.

;;
;;; Compatability

;; Tested with emacs 26.1 in debian.

;;  TODO:
;;
;;   * In a vanilla emacs environment, the sorting appears wrong
;;     seemingly partially because of how the completion buffer is
;;     constructed, bottom-up. This isn't an issue when using one of
;;     the supplemental minibuffer completion packages.

=0C
;;
;;; Code

(require 'cl-seq) ;; cl-member, cl-position

;;
;;; Variables

(defvar key-assist-exclude-cmds
  '(ignore
    self-insert-command
    digit-argument
    negative-argument
    describe-mode)
  "List of commands to always exclude from `key-assist' output.")

(defvar key-assist-exclude-regexps '("-mouse-")
  "List of regexps of commands to exclude from `key-assist' output.")
;; TODO: Don't depend upon a mouse command having the word '-mouse-' in it=
.


;;
;;; Internal functions

(defun key-assist--get-keybinding (cmd &optional key-map)
  "Return a string with CMD's shortest keybinding."
  (let (shortest)
    (dolist (key (mapcar 'key-description
                         (where-is-internal
                           cmd key-map nil t)))
      (when (or (not shortest)
                (> (length shortest) (length key)))
        (setq shortest key)))
    shortest))

(defun key-assist--get-description (cmd)
  "Return a string with CMD's description.
CMD is a symbol of an interactive command."
;; TODO: Change hard-coded length to an ARG.
  (let ((doc (documentation cmd t)))
    (format "\t%s"
      (if (or (not doc)
              (not (string-match "\n" doc))
              (zerop (match-beginning 0)))
        (concat (symbol-name cmd) " (not documented)")
       (substring doc 0 (match-beginning 0))))))

(defun key-assist--vet-cmd (cmd result-list)
  "Check whether CMD should be on a `key-assist' list.

See `key-assist-exclude-cmds' and `key-assist-exclude-regexps'."
  (and
    (symbolp cmd)
    (commandp cmd)
    (not (cl-member cmd result-list
                    :test (lambda (cmd l) (equal cmd (nth 1 l))))) ; (assq=
 cmd result-list))
    (not (memq cmd key-assist-exclude-cmds))
    (let ((not-found t))
      (mapc (lambda (x)
              (when (string-match x (format "%s" cmd))
                (setq not-found nil)))
            key-assist-exclude-regexps)
      not-found)))

(defun key-assist--parse-cmd (cmd result-list &optional key-map)
  "Extract commands and shortest keybindings from a keymap.

This is an internal function used by `key-assist'. Returns a list
whose elements are a keybinding string, a command symbol, and a
description string."
  (when (key-assist--vet-cmd cmd result-list)
    (let* ((key-map (when (keymapp key-map) key-map))
           (shortest (key-assist--get-keybinding cmd key-map)))
      (when shortest
        (list shortest cmd (concat shortest (key-assist--get-description c=
md)))))))

(defun key-assist--get-cmds (&optional spec nosort nofinish)
  "Return a list of commands, keybindings, and descriptions.

Returns a list of CONS, whose CAR is the command, and whose CDR
is a string of the form \"shortest-keybinding tab-character
command-description\".

Optional arg SPEC may be a regexp string of desired commands. If
NIL, a regexp is generated based upon the first word of the
buffer's major mode. SPEC may also be a keymap of desired
commands. In both of these cases, the resulting list is sorted
alphabetically by keybinding length.

SPEC has additional options of being either a list of commands,
or a list of CONS whose CAR is a command, and whose CDR is either a
description-string or a function which returns a description
string. A final programmatic option is for SPEC to be any
combination of the above options. For that most complex case, the
first list element of SPEC must be the symbol 'collection. For
none of these additional options is sorting performed.

Optional arg NOSORT can be a function to replace the default sort
algorithm with the programmer's desired post-processing, or some
other non-nil value for no sorting at all. If a function, it
should accept a single list of elements (keybinding-string
commandp description-string) and should return a list of
elements (anything commandp description-string).

Optional arg NOFINSH return a list in `key-assist--parse-cmd'
format instead of the list of CONS described above. It is used
internally for processing 'collection lists."
  (setq spec
    (cond
     ((or (not spec)
          (and (stringp spec)
               (zerop (length spec))))
       (let ((str (symbol-name major-mode)))
         (substring str 0 (1+ (string-match "-" str)))))
     ((and (stringp spec)
           (boundp (intern spec))
           (keymapp (symbol-value (intern spec))))
       (symbol-value (intern spec)))
     (t spec)))
  (let (name result-elem (result-list '()))
    (cond
     ((keymapp spec)
       (let (cmd)
         (dolist (elem spec)
           (cond
            ((atom elem)) ;; eg. 'keymap
            ((listp (setq cmd (cdr elem)))) ;; TODO: possibly also embedde=
d keymap?
            ((commandp cmd) ;; this excludes 'menubar
              (when (setq result-elem (key-assist--parse-cmd cmd result-li=
st))
                (push result-elem result-list)))))))
     ((stringp spec)
       (mapatoms
         (lambda (x)
            (and (commandp x)
                 (string-match spec (setq name (symbol-name x)))
                 (when (setq result-elem
                         (key-assist--parse-cmd x result-list))
                   (push result-elem result-list))))))
     ((listp spec)
       (cond
        ((eq (car spec) 'collection)
          (dolist (collection-element (cdr spec))
            ;; Maybe it's more efficient to sort each collection element?
            (let ((temp-list (key-assist--get-cmds collection-element 'nos=
ort 'nofinish)))
              (dolist (elem temp-list)
                (push elem result-list)))))
        ((commandp (car spec))
          (dolist (cmd spec)
            (when (setq result-elem (key-assist--parse-cmd cmd result-list=
))
              (push result-elem result-list))))
        (t ; spec is a list of CONS (cmd . (or string function))
          (dolist (elem spec)
            (when (key-assist--vet-cmd (car elem) result-list)
              (let ((shortest (key-assist--get-keybinding (car elem))))
                (when shortest
                  (push (list shortest
                              (car elem)
                              (if (stringp (cadr elem))
                                (cadr elem)
                               (funcall (cadr elem))))
                        result-list))))))))
     (t (error "Improper SPEC format.")))
    (when (not nosort)
      (setq result-list
        (if (functionp nosort)
          (funcall nosort result-list)
         (sort result-list
               (lambda (a b) (cond
                              ((=3D (length (car a)) (length (car b)))
                                 (string< (car a) (car b)))
                              ((< (length (car a)) (length (car b))))
                              (t nil)))))))
    (if nofinish
      result-list
     (mapcar (lambda (x) (cons (nth 1 x) (nth 2 x)))
             result-list))))

;;
;;; Interactive functions

(defun key-assist (&optional spec prompt nosort)
  "Prompt to eval a locally relevant function, with hints and keybindings.
Press TAB to see the hints.

Interactively, the optional arg SPEC is either a regexp string
for candidate commands to match, or a keymap from which to
prepare the hints. If NIL, a regexp is generated based upon the
first word of the buffer's major mode. Results are presented
sorted alphabetically by keybinding length.

Programmatically, optional arg PROMPT can be used to customize
the prompt. For the further programmatic options of SPEC and for
a description of arg NOSORT, see function `key-assist--get-cmds'.

See also variables `key-assist-exclude-regexps' and
`key-assist-exclude-cmds'."
  (interactive "MOptional: Enter command regexp or keymap name: ")
  (let* ((prompt   (or prompt "Select: "))
         (commands (key-assist--get-cmds spec nosort))
         (choices  (mapcar 'cdr commands))
         choice minibuffer-history)
    (if (not choices)
      (user-error "No choices found.")
     (while (not (setq choice
                   (cl-position
                     (substring-no-properties ; Is -no-properties necessar=
y?
                       (completing-read prompt choices nil t))
                     choices :test 'equal))))
     (funcall (car (nth choice commands))))))

=0C
;;
;;; Conclusion

(provide 'key-assist)

;;; key-assist.el ends here

--6mzweytivy3davt4--




Acknowledgement sent to Boruch Baum <boruch_baum@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#43709; 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: Thu, 1 Oct 2020 18:30:02 UTC

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