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: Tue, 13 Apr 2021 19:09:07 +0300 Organization: LINKOV.NET Message-ID: <87czuy9otg.fsf@mail.linkov.net> References: <87lf9nxyun.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21070"; 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 Tue Apr 13 18:32:35 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 1lWLxq-0005Ot-7Q for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 13 Apr 2021 18:32:34 +0200 Original-Received: from localhost ([::1]:46174 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lWLxp-0007jN-3N for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 13 Apr 2021 12:32:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44876) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lWLng-0006k7-Cp for bug-gnu-emacs@gnu.org; Tue, 13 Apr 2021 12:22:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49080) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lWLng-0005Nc-4V for bug-gnu-emacs@gnu.org; Tue, 13 Apr 2021 12:22:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lWLng-0002T5-0T for bug-gnu-emacs@gnu.org; Tue, 13 Apr 2021 12:22:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Apr 2021 16:22:03 +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.16183308689355 (code B ref 47688); Tue, 13 Apr 2021 16:22:03 +0000 Original-Received: (at 47688) by debbugs.gnu.org; 13 Apr 2021 16:21:08 +0000 Original-Received: from localhost ([127.0.0.1]:60614 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lWLmm-0002Qp-9G for submit@debbugs.gnu.org; Tue, 13 Apr 2021 12:21:08 -0400 Original-Received: from relay12.mail.gandi.net ([217.70.178.232]:54783) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lWLmk-0002Pw-1D for 47688@debbugs.gnu.org; Tue, 13 Apr 2021 12:21:07 -0400 Original-Received: from mail.gandi.net (m91-129-96-157.cust.tele2.ee [91.129.96.157]) (Authenticated sender: juri@linkov.net) by relay12.mail.gandi.net (Postfix) with ESMTPSA id A2D2220000D; Tue, 13 Apr 2021 16:20:58 +0000 (UTC) In-Reply-To: <87lf9nxyun.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 12 Apr 2021 19:16:16 +0300") 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:203972 Archived-At: --=-=-= Content-Type: text/plain > 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. An example where such repeating map is sorely missing is gdb. Until now, stepping through the program was a hassle that required typing such overly long key sequences: 'C-x C-a C-n C-x C-a C-n C-x C-a C-n C-x C-a C-n C-x C-a C-n ...' Now with the following patch, stepping is much easier: 'C-x C-a C-n n n n n ...' --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=gud-step-repeat-map.patch diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index b105cbaa0e..45ba9fff07 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -293,6 +293,12 @@ gud-tool-bar-map (tool-bar-local-item-from-menu (car x) (cdr x) map gud-minor-mode-map)))) +(defvar gud-step-repeat-map + (let ((map (make-sparse-keymap))) + map) + "Keymap to repeat gud stepping instructions `C-x C-a C-n n n'. +Used in `repeat-mode'.") + (defun gud-file-name (f) "Transform a relative file name to an absolute file name. Uses `gud--directories' to find the source files." @@ -784,6 +790,17 @@ gud-gdb (gud-def gud-until "until %l" "\C-u" "Continue to current line.") (gud-def gud-run "run" nil "Run the program.") + (dolist (cmd '(("n" . gud-next) + ("s" . gud-step) + ("i" . gud-stepi) + ("c" . gud-cont) + ("l" . gud-refresh) + ("f" . gud-finish) + ("<" . gud-up) + (">" . gud-down))) + (define-key gud-step-repeat-map (car cmd) (cdr cmd)) + (put (cdr cmd) 'repeat-map 'gud-step-repeat-map)) + (add-hook 'completion-at-point-functions #'gud-gdb-completion-at-point nil 'local) (setq-local gud-gdb-completion-function 'gud-gdb-completions) --=-=-= Content-Type: text/plain Also you can see that adding a convenience macro wouldn't much of help here, dolist is quite convenient as well. --=-=-=--