unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Ramesh Nedunchezian <rameshnedunchezian@outlook.com>
Cc: 47688@debbugs.gnu.org
Subject: bug#47688: 28.0.50; repeat-mode: Make rectangle commands repeatable. Also some misc. queries, comments
Date: Mon, 12 Apr 2021 19:16:16 +0300	[thread overview]
Message-ID: <87lf9nxyun.fsf@mail.linkov.net> (raw)
In-Reply-To: <TY2PR0101MB3693266D647E5AABAEC0AF0EDA729@TY2PR0101MB3693.apcprd01.prod.exchangelabs.com> (Ramesh Nedunchezian's message of "Sat, 10 Apr 2021 13:53:06 +0530")

> Could you please add rectangle commands to the repeatable set?

Could you please demonstrate an example of the real key sequences
where repeat-mode could help to greatly reduce the length of
such key sequences.

> This is what I have in my .emacs.  It works reasonably well, except
> for the `x' (- `rectangle-exchange-point-and-mark') key below:
>
> Issue 1:
> --------
>
> In Non-repeat mode,
>
> 1. Press C-x SPC and make a rectangel.
>
> 2. Press C-x C-x 4 or more times.  You will see the cursor jumping
>    between the corners.
>
> With below snippet installed, in repeat-mode, repeat the above
> operations with single key strokes. I am seeing that the 3rd press of
> x gets me out of the repeat loop and inserts the char "x" in the
> buffer.

Thanks for reporting the issue, this is fixed now.

> Issue 2:  A repeat map can provide a custom `:help'-er
> -----------------------------------------------------
>
> This is the message I see in the minibuffer.
>
>     Repeat with c, ESC, w, r, d, k, o, b, C-b, x, C-x, f, C-f, <left>,
>     SPC, <down>, C-n, N, <up>, C-p, <right>, t, y
>
> 1. `ESC' above correpsonds to `M-w' in the repeat map.  The single
>     character `ESC' confused me for some time.  I wonder if the help
>     text could be improved in this case.

I don't know if there is a function that extracts all key sequences
from the keymap.

There is describe-map-tree that prints the keybindings to the output buffer,
but what is needed is a function that just returns a list of key sequences
from the keymap.

> 2. The help text is really really big, and it clutters the echo area.
>
>    It seems that .... Repeatable keys are essentially a poor-man's
>    hydra,
>
>    So, a repeat-map, like the rectangle one below, which has lots of
>    keybindings can set a `:help' attribute on itself.
>    `repeat-post-hook' can then rely on this `:help'-er to provide a
>    help much similar to what the hydra package provides.

A new option is implemented now.

> Issue 3:  A repeat map can take `:keep-pred' (or a `:exit-key') and other properties.
> ----------------------------------------------------------------------------
>
> When looked askance, `repeat-post-hook' is essentially a wrapper
> around `transient-map'.
>
> So, a `repeat-map' can take a `:keep-pred' and `:on-exit' attributes,
> in addition to a `:help' attribute.

We already tried to change the values of set-transient-map arguments,
but such arguments break repeat-map.

> This will obviate the need for the global `repeat-exit-key' i.e., the
> choice of how the map exits should itself be delegated to the repeat
> map. `

The purpose of repeat-exit-key is to avoid the need to add an exit key
to every keymap.

> Suggestion 1:  Provide a macro(?) for creating repeatable commands.
> ------------------------------------------------------------------
>
> Suggestion 2:
> ------------
>
> Provide a defmacro for chained commands.  I am making the suggestion
> here. I will provide details in a separate bug report.

Such convenience macros are better suitable for a separate package like hydra.





  parent reply	other threads:[~2021-04-12 16:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-10  8:23 bug#47688: 28.0.50; repeat-mode: Make rectangle commands repeatable. Also some misc. queries, comments Ramesh Nedunchezian
2021-04-10 10:34 ` Dmitry Gutov
2021-04-10 13:04   ` Ramesh Nedunchezian
2021-04-10 14:54     ` Dmitry Gutov
2021-04-10 12:32 ` Ramesh Nedunchezian
2021-04-12 16:16 ` Juri Linkov [this message]
2021-04-13 16:09   ` Juri Linkov
2021-04-14 18:12 ` Juri Linkov
     [not found] ` <handler.47688.D47688.161842410719411.notifdone@debbugs.gnu.org>
2021-05-04  4:19   ` bug#47688: closed (Re: bug#47688: 28.0.50; repeat-mode: Make rectangle commands repeatable. Also some misc. queries, comments) Ramesh Nedunchezian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lf9nxyun.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=47688@debbugs.gnu.org \
    --cc=rameshnedunchezian@outlook.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).