From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs 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 Organization: LINKOV.NET Message-ID: <87lf9nxyun.fsf@mail.linkov.net> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4151"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: 47688@debbugs.gnu.org To: Ramesh Nedunchezian Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 12 18:19:18 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@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 ) id 1lVzHR-0000vF-J4 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 12 Apr 2021 18:19:17 +0200 Original-Received: from localhost ([::1]:47630 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lVzHQ-00057g-G4 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 12 Apr 2021 12:19:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44372) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lVzHD-00057K-Cj for bug-gnu-emacs@gnu.org; Mon, 12 Apr 2021 12:19:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46294) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lVzHD-0001IK-3J for bug-gnu-emacs@gnu.org; Mon, 12 Apr 2021 12:19:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lVzHC-0003XG-Va for bug-gnu-emacs@gnu.org; Mon, 12 Apr 2021 12:19:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 12 Apr 2021 16:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47688 X-GNU-PR-Package: emacs Original-Received: via spool by 47688-submit@debbugs.gnu.org id=B47688.161824431313501 (code B ref 47688); Mon, 12 Apr 2021 16:19:02 +0000 Original-Received: (at 47688) by debbugs.gnu.org; 12 Apr 2021 16:18:33 +0000 Original-Received: from localhost ([127.0.0.1]:57829 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lVzGj-0003Vg-Gn for submit@debbugs.gnu.org; Mon, 12 Apr 2021 12:18:33 -0400 Original-Received: from relay11.mail.gandi.net ([217.70.178.231]:38365) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lVzGh-0003VP-HA for 47688@debbugs.gnu.org; Mon, 12 Apr 2021 12:18:32 -0400 Original-Received: from mail.gandi.net (m91-129-96-157.cust.tele2.ee [91.129.96.157]) (Authenticated sender: juri@linkov.net) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 3BF5B100004; Mon, 12 Apr 2021 16:18:23 +0000 (UTC) In-Reply-To: (Ramesh Nedunchezian's message of "Sat, 10 Apr 2021 13:53:06 +0530") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:203917 Archived-At: > 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, , > SPC, , C-n, N, , C-p, , 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.