unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* minibuffer keybinding cheatsheet and launcher
@ 2020-10-01 12:23 Boruch Baum
  2020-10-01 12:58 ` Ergus
  0 siblings, 1 reply; 6+ messages in thread
From: Boruch Baum @ 2020-10-01 12:23 UTC (permalink / raw)
  To: emacs-devel

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



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: minibuffer keybinding cheatsheet and launcher
  2020-10-01 12:23 minibuffer keybinding cheatsheet and launcher Boruch Baum
@ 2020-10-01 12:58 ` Ergus
  2020-10-01 14:27   ` Boruch Baum
  2020-10-01 14:41   ` Caio Henrique
  0 siblings, 2 replies; 6+ messages in thread
From: Ergus @ 2020-10-01 12:58 UTC (permalink / raw)
  To: Boruch Baum; +Cc: emacs-devel

Hi Boruch:

I am trying to test the package (because I don't really understand what
it does) but I can't make it work

I evaluated the code and then

M-x key-assist

and I got a prompt but after that what should I do? 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.

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

+++
** When 'suggest-key-bindings' is non-nil, the completion list of 'M-x'
shows equivalent key bindings for all commands that have them.
---

Does this functionality overlap somehow with your package?

Best,
Ergus

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
>



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: minibuffer keybinding cheatsheet and launcher
  2020-10-01 12:58 ` Ergus
@ 2020-10-01 14:27   ` Boruch Baum
  2020-10-01 14:41   ` Caio Henrique
  1 sibling, 0 replies; 6+ messages in thread
From: Boruch Baum @ 2020-10-01 14:27 UTC (permalink / raw)
  To: Ergus; +Cc: emacs-devel

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



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: minibuffer keybinding cheatsheet and launcher
  2020-10-01 12:58 ` Ergus
  2020-10-01 14:27   ` Boruch Baum
@ 2020-10-01 14:41   ` Caio Henrique
  2020-10-01 15:39     ` Boruch Baum
  1 sibling, 1 reply; 6+ messages in thread
From: Caio Henrique @ 2020-10-01 14:41 UTC (permalink / raw)
  To: Ergus; +Cc: Boruch Baum, emacs-devel

Ergus <spacibba@aol.com> writes:

> BTW: Emacs 28 already has a new variable 'suggest-key-bindings'
>
> +++
> ** When 'suggest-key-bindings' is non-nil, the completion list of 'M-x'
> shows equivalent key bindings for all commands that have them.
> ---

I have a question, why "M-x scroll-up TAB" shows the keybinding C-v:

Click on a completion to select it.
In this buffer, type RET to select the completion near point.

Possible completions are:
scroll-up
scroll-up-command (C-v)
scroll-up-line

But "M-x scroll-down TAB" doesn't show M-v?

Click on a completion to select it.
In this buffer, type RET to select the completion near point.

Possible completions are:
scroll-down
scroll-down-command
scroll-down-line




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: minibuffer keybinding cheatsheet and launcher
  2020-10-01 14:41   ` Caio Henrique
@ 2020-10-01 15:39     ` Boruch Baum
  2020-10-01 16:16       ` Caio Henrique
  0 siblings, 1 reply; 6+ messages in thread
From: Boruch Baum @ 2020-10-01 15:39 UTC (permalink / raw)
  To: Caio Henrique; +Cc: Ergus, emacs-devel

On 2020-10-01 11:41, Caio Henrique wrote:
> I have a question, why "M-x scroll-up TAB" shows the keybinding C-v:

I'm guessing what you're asking is that what you did was 'M-x
key-assist' and responded to the first prompt by typing 'scroll-',
followed by RET, followed by TAB. Is that correct?

In that case, when I perform that, I get a list of nine entries, and
does include both keybindings?

But honestly, I'm not even sure that you're discussing my package, or
the default behavior of M-x..

>
> Click on a completion to select it.
> In this buffer, type RET to select the completion near point.
>
> Possible completions are:
> scroll-up
> scroll-up-command (C-v)
> scroll-up-line
>
> But "M-x scroll-down TAB" doesn't show M-v?
>
> Click on a completion to select it.
> In this buffer, type RET to select the completion near point.
>
> Possible completions are:
> scroll-down
> scroll-down-command
> scroll-down-line
>

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



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: minibuffer keybinding cheatsheet and launcher
  2020-10-01 15:39     ` Boruch Baum
@ 2020-10-01 16:16       ` Caio Henrique
  0 siblings, 0 replies; 6+ messages in thread
From: Caio Henrique @ 2020-10-01 16:16 UTC (permalink / raw)
  To: Boruch Baum; +Cc: Ergus, Caio Henrique, emacs-devel

Boruch Baum <boruch_baum@gmx.com> writes:

> But honestly, I'm not even sure that you're discussing my package, or
> the default behavior of M-x..
I'm sorry, I got offtopic. I was replying to what Ergus said about using
suggest-key-bindings.

I tested your package, this is what I got with "M-x key-assist" and then
'scroll-': 

Click on a completion to select it.
In this buffer, type RET to select the completion near point.

Possible completions are:
<Scroll_Lock>	Buffer-local minor mode for pager-like scrolling.
<horizontal-scroll-bar> <mouse-1>	scroll-bar-toolkit-horizontal-scroll (not documented)
<vertical-scroll-bar> <mouse-1>	scroll-bar-toolkit-scroll (not documented)
C-M-S-v	Scroll next window downward ARG lines; or near full screen if no ARG.
C-M-v	Scroll next window upward ARG lines; or near full screen if no ARG.
C-v	Scroll text of selected window upward ARG lines; or near full screen if no ARG.
C-x <	Scroll selected window display ARG columns left. 	C-x >	Scroll selected window display ARG columns right.
M-v	Scroll text of selected window down ARG lines; or near fullscreen if no ARG.


Unlike the default behavior, your package shows M-v to scroll down, so
it looks good to me. :) 



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-10-01 16:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-01 12:23 minibuffer keybinding cheatsheet and launcher Boruch Baum
2020-10-01 12:58 ` Ergus
2020-10-01 14:27   ` Boruch Baum
2020-10-01 14:41   ` Caio Henrique
2020-10-01 15:39     ` Boruch Baum
2020-10-01 16:16       ` Caio Henrique

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).