From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Boruch Baum <boruch_baum@gmx.com>
Newsgroups: gmane.emacs.devel
Subject: Re: minibuffer keybinding cheatsheet and launcher
Date: Thu, 1 Oct 2020 10:27:30 -0400
Message-ID: <20201001142730.yzmja5xi5j3ltndr@E15-2016.optimum.net>
References: <20201001122322.2uhcq3lqqclzgsnc@E15-2016.optimum.net>
 <20201001125818.nnaqoeorkp4liavz@Ergus>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="29969"; mail-complaints-to="usenet@ciao.gmane.io"
User-Agent: NeoMutt/20180716
Cc: emacs-devel@gnu.org
To: Ergus <spacibba@aol.com>
Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Oct 01 16:32:57 2020
Return-path: <emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org>
Envelope-to: ged-emacs-devel@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 <emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org>)
	id 1kNzdd-0007WY-SZ
	for ged-emacs-devel@m.gmane-mx.org; Thu, 01 Oct 2020 16:32:53 +0200
Original-Received: from localhost ([::1]:60356 helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org>)
	id 1kNzdb-00022K-Ls
	for ged-emacs-devel@m.gmane-mx.org; Thu, 01 Oct 2020 10:32:51 -0400
Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36964)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <boruch_baum@gmx.com>)
 id 1kNzYm-0000Hf-6c
 for emacs-devel@gnu.org; Thu, 01 Oct 2020 10:27:52 -0400
Original-Received: from mout.gmx.net ([212.227.17.21]:41389)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <boruch_baum@gmx.com>)
 id 1kNzYX-0000Jh-In
 for emacs-devel@gnu.org; Thu, 01 Oct 2020 10:27:51 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;
 s=badeba3b8450; t=1601562453;
 bh=KQs13g5BMHc7BgIpde7joflQtVPMPRBlCM/4rm0iKmw=;
 h=X-UI-Sender-Class:Date:From:To:Cc:Subject:References:In-Reply-To;
 b=Mnso3Cj8hJ1rDVUD5/oORKccBnTBw5ju8g+8I3MIM9Z3es1SPXQj8JghXV6c6WEfJ
 HXj9AxpU7J2cMX74dmt9PvfdSL89NGAXcfZbZMaMqSXUJ2OdyaFnr+HsDN6XS1oCZb
 pftW8A7HZqKAOs6XkaQT8SsKB657AUuDfJ/vRrSE=
X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
Original-Received: from E15-2016.optimum.net ([72.89.170.172]) by mail.gmx.com
 (mrgmx105 [212.227.17.174]) with ESMTPSA (Nemesis) id
 1MOREc-1k3aqx0tIc-00PwI9; Thu, 01 Oct 2020 16:27:33 +0200
Content-Disposition: inline
In-Reply-To: <20201001125818.nnaqoeorkp4liavz@Ergus>
X-Provags-ID: V03:K1:eMCYfdeyKCj7ENqdZr2+30mv9mJHsNoNqRwti1u8rUAmvrIisOH
 dqGDbIaHBqF02IJpV6l6waqDSCWQ671G5u/trOC4/JLm6l/q6z2Npfjed3vpiI6Yp/SZicI
 2vdPgbwb6dViy7DlltTGZD1ANZyUhfY2VwRrjB4SrNei84SBPJyc5hWUHagHllIi8zF3MER
 TFwOaItu+lOYYKPSeUSyQ==
X-UI-Out-Filterresults: notjunk:1;V03:K0:GKAlDgHQltc=:4jCVQssn5AAd5rFR8n/tqJ
 Kl8ohP2jJ+1uVUUZQmQU39h2YgLpRkQf+fQCh+1p5mrewJo679KWUIicvCf9+j3tKDFad44j4
 aqACpp7byUmew3YScsuZ41v9C1xd1GNKb273p4ZIvS6NHLtkq+tSshN/IJ506NddIWvRk9RhZ
 p6BcUyiTxokNLClWmufIWXc0RsnWS4AGsWtfIV0UDP8Zt2dDAK5o+gBfkVQ2zq5yTMsoBytBo
 4KzDNOnhaUDcZFHtz8BRRdw+PdRxeGoaR7HQPF3Uh6rF9ObVtIJhBrHhh5NUhpqa7xQesE9Cb
 kdi6fXe4NCB5r/M7m2a65nlx37HkVgTHH0A8y2Uq+qpJZ4yrbl7dPra4PCWayeRWDuzAaZG1p
 lXsPt7v+qsVSPS8TtGdDi0qBrny70WEsWi+e1S88W5enTFRLR1Sz6inlb0LmHsF1A5ypVzdCX
 F+GQ5rawqojoKSKBYYML0WxedmL3BFr2d7SaaWvywIPC5I8zeVo9GJaufK2F3lj82CW2CSmF0
 x2ORelX7K6siYapEiKaqn4XprzzTEcYhYTo8t8nGS3GoTxPhN7KkZhJNwFZ/EufPMGA3Y+fNx
 joVYdiMSUbb9M6ziZtipqynsxm7G6Dfn1aLnx6RSiv+wAF0aNNf11W8uwatEhyfcH052dY3Cd
 VcZixYo5or+tv+QxDDQ2TKqHUnAY0reFLWh6bYeb3oUvtrlSgG3FJebJLym33v9lBJqh6vJME
 6DNS3ZrDZfTDQIM3+ry0a+UsgyuFqGjrvBANhYynMOoQlUhiTnt5F4r2C37Sa3Ow284QDchc 
Received-SPF: pass client-ip=212.227.17.21; envelope-from=boruch_baum@gmx.com;
 helo=mout.gmx.net
X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/01 10:27:35
X-ACL-Warn: Detected OS   = Linux 2.2.x-3.x [generic]
X-Spam_score_int: -25
X-Spam_score: -2.6
X-Spam_bar: --
X-Spam_report: (-2.6 / 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.001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-BeenThere: emacs-devel@gnu.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "Emacs development discussions." <emacs-devel.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-devel>,
 <mailto:emacs-devel-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/emacs-devel>
List-Post: <mailto:emacs-devel@gnu.org>
List-Help: <mailto:emacs-devel-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-devel>,
 <mailto:emacs-devel-request@gnu.org?subject=subscribe>
Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org
Original-Sender: "Emacs-devel"
 <emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org>
Xref: news.gmane.io gmane.emacs.devel:256850
Archived-At: <http://permalink.gmane.org/gmane.emacs.devel/256850>

On 2020-10-01 14:58, Ergus wrote:
> Hi Boruch:
>
> I am trying to test the package (because I don't really understand what
> it does)

Then I guess the description wasn't clear enough. Have you ever used
magit, or some package using hydra or transient? You included my
original email, so can you point to the exact part that isn't clear
enough?

> but I can't make it work

Let's see what's going on..

> I evaluated the code and then M-x key-assist and I got a prompt

There are two prompts: A first prompt, beginning with the word
'optional', and a second one with the word 'select'. At what point are
you asking?

If you responded to the first prompt ('optional') by pressing RET, the
result list will be composed by searching for commands based upon the
first word of variable 'major-mode', so if you performed M-x key-assist
from the same buffer that had the lisp code, that would probably mean a
major-mode of emacs-lisp-mode, which wouldn't be too helpful. For me,
the result is a set of help functions (ie. C-h ...).

   So, an initial question I have is: if you pressed RET to the first
   prompt, what was the 'major-mode' of the current-buffer?

*USING A VANILLA EMACS*, at the second prompt ("select"), you should be
able to use all the standard 'completing-read' features:
double-TAB for a list of option, up/down keys to scroll through them,
type characters and use tab completion - all the usual standard features
of completing-read.

If you are using a supplemental minibuffer completion program (eg. ido,
icicles, ivy, avy) the experience should be similar to the standard
features of those packages.

   So are you using a true vanilla emacs, or one with an additional
   minibuffer completion package? That might make a subtle difference,
   but it shouldn't be significant.

> but after that what should I do?

After responding to the 'Optional' prompt or the 'Select' prompt?

> Tab just inserts a tab (no autocompletion), RET says "No choices
> found", inserting a pattern and TAB shows the commands and the
> bindings but I can't select anything.

Here's an idea. Open an 'ibuffer' (C-x C-b), switch to it so it's your
current buffer, run M-x key-assist and respond to the first prompt with
RET, and to the second with TAB. What happens? What happens if you then
use the up or down arrow keys, or partially type some text from any of
the options, and then RET?

> BTW: Emacs 28 already has a new variable 'suggest-key-bindings'

Not a new variable at all. It's default has been set 't' for several
versions now.

> Does this functionality overlap somehow with your package?

Eh. Let's say 'not at all', but superficially I can see someone thinking
that it might.

>
> On Thu, Oct 01, 2020 at 08:23:22AM -0400, Boruch Baum wrote:
> > Two days ago, I posted to the emacs bug list (#43709) a proposed code
> > contribution that hasn't gotten much feedback, so here's a summary and=
 link:
> >
> >   bug#43709: minibuffer keybinding cheatsheet and launcher
> >   https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D43709
> >
> >   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'?
> >

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