emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: minibuffer keybinding cheatsheet and launcher


From: Boruch Baum
Subject: Re: minibuffer keybinding cheatsheet and launcher
Date: Thu, 1 Oct 2020 10:27:30 -0400
User-agent: NeoMutt/20180716

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=43709
> >
> >   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'?
> >

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]