GNU bug report logs - #49632
[PATCH] Ensure that M-x gdb populates gud-repeat-map

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Brian Leung <leungbk@HIDDEN>; Keywords: fixed patch; Done: Juri Linkov <juri@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
bug marked as fixed in version 28.0.50, send any further explanations to 49632 <at> debbugs.gnu.org and Brian Leung <leungbk@HIDDEN> Request was from Juri Linkov <juri@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Added tag(s) fixed. Request was from Juri Linkov <juri@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 49632 <at> debbugs.gnu.org:


Received: (at 49632) by debbugs.gnu.org; 27 Jul 2021 21:16:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 27 17:16:36 2021
Received: from localhost ([127.0.0.1]:54101 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1m8URI-0004bk-DA
	for submit <at> debbugs.gnu.org; Tue, 27 Jul 2021 17:16:36 -0400
Received: from relay3-d.mail.gandi.net ([217.70.183.195]:36039)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>)
 id 1m8URG-0004bE-Si; Tue, 27 Jul 2021 17:16:35 -0400
Received: (Authenticated sender: juri@HIDDEN)
 by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 3E50C60003;
 Tue, 27 Jul 2021 21:16:26 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Brian Leung <leungbk@HIDDEN>
Subject: Re: bug#49632: [PATCH] Ensure that M-x gdb populates gud-repeat-map
Organization: LINKOV.NET
References: <89178870.2006793.1626665845848@HIDDEN>
 <87eebupi5k.fsf@HIDDEN>
 <343742107.2068902.1626706305280@HIDDEN>
 <87k0lml3wt.fsf@HIDDEN> <874kcql2r8.fsf@HIDDEN>
 <2097190220.304800.1627097630028@HIDDEN>
 <87sg02zz65.fsf@HIDDEN> <8735s2ru7o.fsf@HIDDEN>
 <2138242899.459686.1627248504532@HIDDEN>
 <875ywwbth7.fsf@HIDDEN>
 <1340188632.606225.1627358954291@HIDDEN>
 <1323685923.615297.1627368394536@HIDDEN>
Date: Wed, 28 Jul 2021 00:15:46 +0300
In-Reply-To: <1323685923.615297.1627368394536@HIDDEN> (Brian Leung's
 message of "Tue, 27 Jul 2021 08:46:34 +0200 (CEST)")
Message-ID: <87fsvzmpa5.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 49632
Cc: Lars Ingebrigtsen <larsi@HIDDEN>, 49632 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

tags 49632 fixed
close 49632 28.0.50
thanks

> I found a way to make gud-set-repeat-map-property a function without
> having to change repeat.el. See attached for an updated patch.

Thanks, using a symbol is the correct way to implement this indeed.
So now pushed to master.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#49632; Package emacs. Full text available.

Message received at 49632 <at> debbugs.gnu.org:


Received: (at 49632) by debbugs.gnu.org; 27 Jul 2021 06:46:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 27 02:46:49 2021
Received: from localhost ([127.0.0.1]:52270 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1m8GrY-0005qR-GB
	for submit <at> debbugs.gnu.org; Tue, 27 Jul 2021 02:46:49 -0400
Received: from wilbur.contactoffice.com ([212.3.242.68]:50994)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <leungbk@HIDDEN>) id 1m8GrV-0005qB-6u
 for 49632 <at> debbugs.gnu.org; Tue, 27 Jul 2021 02:46:47 -0400
Received: from ichabod.co-bxl (ichabod.co-bxl [10.2.0.36])
 by wilbur.contactoffice.com (Postfix) with ESMTP id 65CB5AAE;
 Tue, 27 Jul 2021 08:46:38 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1627368398; 
 s=20210208-e7xh; d=mailfence.com; i=leungbk@HIDDEN;
 h=Date:From:Reply-To:Cc:Message-ID:In-Reply-To:References:MIME-Version:Content-Type;
 l=16281; bh=O96uAZsn4gZvKKaJvolo0daXsCwqpvfwvwT7jGrrPmw=;
 b=dxjNHiAr/iu92HXsUc2+zqTvhI1m2Rvs6fZwvmj2RJmRepecuD1mYDJ6gB9HElG0
 h581nr4YZ1wDsPunoK6HBbTzGXkj/kz46p0PGyu7AFGLpYw6UXfKJYoKvbscY+iJoqk
 Emzxcj27xHu8jHjNPZjoA/ojOkwbVzFWPv8NNABxfhtPn3+q4YavNlt8+xT0cQep8CH
 VUpxypCKpxKioNurxb+gqG4/oLphdn7aedtfWaXAh/ukRu7QgIJWQqi1T5WUwHuoOh4
 br+O01+swnBr/05CKYketKNN5zuC6dBjd6NCkv3ZeuBlKVlpzdx1pRBHUbJIPrPPVVm
 Xc2UKXL/UQ==
Date: Tue, 27 Jul 2021 08:46:34 +0200 (CEST)
From: Brian Leung <leungbk@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Message-ID: <1323685923.615297.1627368394536@HIDDEN>
In-Reply-To: <1340188632.606225.1627358954291@HIDDEN>
References: <89178870.2006793.1626665845848@HIDDEN>
 <87eebupi5k.fsf@HIDDEN> <343742107.2068902.1626706305280@HIDDEN>
 <87k0lml3wt.fsf@HIDDEN> <874kcql2r8.fsf@HIDDEN>
 <2097190220.304800.1627097630028@HIDDEN> <87sg02zz65.fsf@HIDDEN>
 <8735s2ru7o.fsf@HIDDEN>
 <2138242899.459686.1627248504532@HIDDEN>
 <875ywwbth7.fsf@HIDDEN>
 <1340188632.606225.1627358954291@HIDDEN>
Subject: Re: bug#49632: [PATCH] Ensure that M-x gdb populates gud-repeat-map
MIME-Version: 1.0
Content-Type: multipart/mixed; 
 boundary="----=_Part_615291_1778393584.1627368390899"
X-Priority: 3
X-Mailer: ContactOffice Mail
X-ContactOffice-Account: com:225491745
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 49632
Cc: Lars Ingebrigtsen <larsi@HIDDEN>, 49632 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Brian Leung <leungbk@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

------=_Part_615291_1778393584.1627368390899
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

I found a way to make gud-set-repeat-map-property a function without having=
 to change repeat.el. See attached for an updated patch.

> ----------------------------------------
> From: Brian Leung <leungbk@HIDDEN>
> Sent: Tue Jul 27 06:09:14 CEST 2021
> To: Juri Linkov <juri@HIDDEN>
> Cc: Lars Ingebrigtsen <larsi@HIDDEN>, <49632 <at> debbugs.gnu.org>
> Subject: Re: bug#49632: [PATCH] Ensure that M-x gdb populates gud-repeat-=
map
>=20
>=20
> > Is there a reason why gud-set-repeat-map-property should be a macro,
> > but not a function?  When it's a macro, there are problems such that
> > when the user modifies the map, then the function that uses the macro
> > needs to be recompiled.
>=20
> When I wrote initially wrote gud-set-repeat-map-property, I couldn't figu=
re out how to make gud-set-repeat-map-property work as a function since the=
 repeat-map property needed to be a symbol corresponding to a keymap, and n=
ot an evaluated keymap.
>=20
> I've updated the patch with a change to the repeat-post-hook function in =
repeat.el to accept an evaluated keymap, which permits a function version o=
f gud-set-repeat-map-property.
>=20
> > ----------------------------------------
> > From: Juri Linkov <juri@HIDDEN>
> > Sent: Tue Jul 27 00:48:20 CEST 2021
> > To: Brian Leung <leungbk@HIDDEN>
> > Cc: Lars Ingebrigtsen <larsi@HIDDEN>, <49632 <at> debbugs.gnu.org>
> > Subject: Re: bug#49632: [PATCH] Ensure that M-x gdb populates gud-repea=
t-map
> >=20
> >=20
> > >> There is one thing that I don't understand: is the
> > >> helper function gud-set-repeat-map-property really needed?
> > >>
> > >> If e.g. the defvar gud-gdb-repeat-map uses such symbols as 'gud-next=
',
> > >> could it put the 'repeat-map' property on the same symbols
> > >> with reference to the variable 'map' directly in these defvars?
> > >> Then only defvars will be needed, and no changes in gud-gdb, gdb.
> > >
> > > If we assign the repeat-map property within the defvars and avoid doi=
ng so
> > > in the M-x gdb commands, then after gud.el gets loaded, the repeat-ma=
p
> > > property on (say) gud-next will be 'jdb, since jdb-repeat-map is the =
last
> > > such foo-repeat-map defvar appearing in gud.el. In that case, calling=
 M-x
> > > perldb and then running gud-next when repeat-mode is on will bring up=
 the
> > > jdb-repeat-map, which contains some commands that aren't defined for
> > > perldb. So I think the gud-set-repeat-map-property macro (or somethin=
g like
> > > it) is necessary.
> >=20
> > You are right.  Then I have only minor comments:
> >=20
> > 1. I thought that you want to create two separate maps for gud-gdb and =
gdb.
> > This is the reason why I suggested to rename gud-repeat-map to gud-gdb-=
repeat-map.
> > But since you use only one map for gbd and gud-gdb, then the name
> > gud-repeat-map is fine.
> >=20
> > 2. Is there a reason why gud-set-repeat-map-property should be a macro,
> > but not a function?  When it's a macro, there are problems such that
> > when the user modifies the map, then the function that uses the macro
> > needs to be recompiled.
>=20
>=20
> --=C2=A0
> Sent with https://mailfence.com
> Secure and private email
>=20
> --=20
> Mailfence.com
> Private and secure email


--=C2=A0
Sent with https://mailfence.com
Secure and private email

--=20
Mailfence.com
Private and secure email

------=_Part_615291_1778393584.1627368390899
Content-Type: text/x-diff; charset=us-ascii; 
	name=0001-Ensure-that-gud-commands-for-M-x-gdb-are-handled-by-.patch
Content-Transfer-Encoding: 7bit
Content-Description: File Attachment:
 0001-Ensure-that-gud-commands-for-M-x-gdb-are-handled-by-.patch
Content-Disposition: attachment; 
	filename=0001-Ensure-that-gud-commands-for-M-x-gdb-are-handled-by-.patch

From ed94f68fb2eb675a8f470f811cca838aacea0c59 Mon Sep 17 00:00:00 2001
From: Brian Leung <leungbk@HIDDEN>
Date: Mon, 19 Jul 2021 23:41:01 -0700
Subject: [PATCH 1/2] Ensure that gud commands for M-x gdb are handled by
 repeat-mode

* lisp/progmodes/gud.el (gud-gdb-repeat-map): Rename from
gud-repeat-map, and populate at the top-level.
(gud-set-repeat-map-property): Introduce this helper function for
setting the repeat-map property.
(gud-gdb): Use the gud-set-repeat-map-property function to assign the
repeat-map property.

* lisp/progmodes/gdb-mi.el (gdb): Use the gud-set-repeat-map-property
function to assign the repeat-map property.

Because different debugging tools may not support all of the gud-foo
functions, we reassign the repeat-map property within the respective
commands, as opposed to the top level of the files, to ensure that the
repeat-map property is reassigned each time to a symbol corresponding
to the active debugging tool.
---
 lisp/progmodes/gdb-mi.el |  2 ++
 lisp/progmodes/gud.el    | 37 +++++++++++++++++++++++++------------
 2 files changed, 27 insertions(+), 12 deletions(-)

diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index 57c99abec6..b9c8305bed 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -996,6 +996,8 @@ gdb
   (define-key gud-minor-mode-map [left-margin C-mouse-3]
     'gdb-mouse-jump)
 
+  (gud-set-repeat-map-property 'gud-gdb-repeat-map)
+
   (setq-local gud-gdb-completion-function 'gud-gdbmi-completions)
 
   (add-hook 'completion-at-point-functions #'gud-gdb-completion-at-point
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 740a6e2581..c4413b104b 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -320,10 +320,32 @@ gud-tool-bar-map
       (tool-bar-local-item-from-menu
        (car x) (cdr x) map gud-minor-mode-map))))
 
-(defvar gud-repeat-map (make-sparse-keymap)
-  "Keymap to repeat gud stepping instructions `C-x C-a C-n n n'.
+(defvar gud-gdb-repeat-map
+  (let ((map (make-sparse-keymap)))
+    (pcase-dolist (`(,key . ,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 map key cmd))
+    map)
+  "Keymap to repeat `gud-gdb' stepping instructions `C-x C-a C-n n n'.
 Used in `repeat-mode'.")
 
+(defun gud-set-repeat-map-property (keymap-symbol)
+  "Set the `repeat-map' property of relevant gud commands to KEYMAP-SYMBOL.
+
+KEYMAP-SYMBOL is a symbol corresponding to some
+`<FOO>-repeat-map', a keymap containing gud commands that may be
+repeated when `repeat-mode' is on."
+  (map-keymap-internal (lambda (_ cmd)
+                         (put cmd 'repeat-map keymap-symbol))
+                       (symbol-value keymap-symbol)))
+
+
 (defun gud-file-name (f)
   "Transform a relative file name to an absolute file name.
 Uses `gud-<MINOR-MODE>-directories' to find the source files."
@@ -814,16 +836,7 @@ 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-repeat-map (car cmd) (cdr cmd))
-    (put (cdr cmd) 'repeat-map 'gud-repeat-map))
+  (gud-set-repeat-map-property 'gud-gdb-repeat-map)
 
   (add-hook 'completion-at-point-functions #'gud-gdb-completion-at-point
             nil 'local)
-- 
2.32.0


------=_Part_615291_1778393584.1627368390899
Content-Type: text/x-diff; charset=us-ascii; 
	name=0002-Ensure-that-gud-commands-for-non-GDB-debuggers-are-h.patch
Content-Transfer-Encoding: 7bit
Content-Description: File Attachment:
 0002-Ensure-that-gud-commands-for-non-GDB-debuggers-are-h.patch
Content-Disposition: attachment; 
	filename=0002-Ensure-that-gud-commands-for-non-GDB-debuggers-are-h.patch

From 05b59031397f577589bc7cfe66a6ba5abc2d621c Mon Sep 17 00:00:00 2001
From: Brian Leung <leungbk@HIDDEN>
Date: Tue, 20 Jul 2021 00:32:34 -0700
Subject: [PATCH 2/2] Ensure that gud commands for non-GDB debuggers are
 handled by repeat-mode

* lisp/progmodes/gud.el (sdb-repeat-map): Define.
(sdb): Set repeat-mode property to the symbol corresponding to the
repeat map.
(dbx-repeat-map): Define.
(dbx): Set repeat-mode property to the symbol corresponding to the
repeat map.
(xdb-repeat-map): Define.
(xdb): Set repeat-mode property to the symbol corresponding to the
repeat map.
(perldb-repeat-map): Define.
(perldb): Set repeat-mode property to the symbol corresponding to the
repeat map.
(pdb-repeat-map): Define.
(pdb): Set repeat-mode property to the symbol corresponding to the
repeat map.
(guiler-repeat-map): Define.
(guiler): Set repeat-mode property to the symbol corresponding to the
repeat map.
(jdb-repeat-map): Define.
(jdb): Set repeat-mode property to the symbol corresponding to the
repeat map.
---
 lisp/progmodes/gud.el | 110 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 110 insertions(+)

diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index c4413b104b..ba438d651b 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -1037,6 +1037,18 @@ gud-sdb-needs-tags
 
 (defvar gud-sdb-lastfile nil)
 
+(defvar sdb-repeat-map
+  (let ((map (make-sparse-keymap)))
+    (pcase-dolist (`(,key . ,cmd) '(("n" . gud-next)
+                                    ("s" . gud-step)
+                                    ("i" . gud-stepi)
+                                    ("c" . gud-cont)
+                                    ("l" . gud-refresh)))
+      (define-key map key cmd))
+    map)
+  "Keymap to repeat `sdb' stepping instructions `C-x C-a C-n n n'.
+Used in `repeat-mode'.")
+
 (defun gud-sdb-marker-filter (string)
   (setq gud-marker-acc
 	(if gud-marker-acc (concat gud-marker-acc string) string))
@@ -1107,6 +1119,8 @@ sdb
   (gud-def gud-cont   "c"    "\C-r"   "Continue with display.")
   (gud-def gud-print  "%e/"  "\C-p"   "Evaluate C expression at point.")
 
+  (gud-set-repeat-map-property 'sdb-repeat-map)
+
   (setq comint-prompt-regexp  "\\(^\\|\n\\)\\*")
   (setq paragraph-start comint-prompt-regexp)
   (run-hooks 'sdb-mode-hook)
@@ -1265,6 +1279,23 @@ gud-dbx-use-stopformat-p
 ;; whereby `set $stopformat=1' reportedly produces output compatible
 ;; with `gud-dbx-marker-filter', which we prefer.
 
+(defvar dbx-repeat-map
+  (let ((map (make-sparse-keymap)))
+    (pcase-dolist (`(,key . ,cmd) '(("n" . gud-next)
+                                    ("s" . gud-step)
+                                    ("i" . gud-stepi)
+                                    ("c" . gud-cont)
+                                    ("l" . gud-refresh)
+                                    ("<" . gud-up)
+                                    (">" . gud-down)))
+      (define-key map key cmd))
+    (when (or gud-mips-p
+              gud-irix-p)
+      (define-key map "f" 'gud-finish))
+    map)
+  "Keymap to repeat `dbx' stepping instructions `C-x C-a C-n n n'.
+Used in `repeat-mode'.")
+
 ;; The process filter is also somewhat
 ;; unreliable, sometimes not spotting the markers; I don't know
 ;; whether there's anything that can be done about that.]
@@ -1412,6 +1443,8 @@ dbx
   (gud-def gud-print  "print %e"  "\C-p" "Evaluate C expression at point.")
   (gud-def gud-run    "run"	     nil    "Run the program.")
 
+  (gud-set-repeat-map-property 'dbx-repeat-map)
+
   (setq comint-prompt-regexp  "^[^)\n]*dbx) *")
   (setq paragraph-start comint-prompt-regexp)
   (run-hooks 'dbx-mode-hook)
@@ -1423,6 +1456,21 @@ dbx
 ;; History of argument lists passed to xdb.
 (defvar gud-xdb-history nil)
 
+(defvar xdb-repeat-map
+  (let ((map (make-sparse-keymap)))
+    (pcase-dolist (`(,key . ,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 map key cmd))
+    map)
+  "Keymap to repeat `xdb' stepping instructions `C-x C-a C-n n n'.
+Used in `repeat-mode'.")
+
 (defcustom gud-xdb-directories nil
   "A list of directories that xdb should search for source code.
 If nil, only source files in the program directory
@@ -1488,6 +1536,8 @@ xdb
   (gud-def gud-finish "bu\\t"      "\C-f" "Finish executing current function.")
   (gud-def gud-print  "p %e"       "\C-p" "Evaluate C expression at point.")
 
+  (gud-set-repeat-map-property 'xdb-repeat-map)
+
   (setq comint-prompt-regexp  "^>")
   (setq paragraph-start comint-prompt-regexp)
   (run-hooks 'xdb-mode-hook))
@@ -1498,6 +1548,17 @@ xdb
 ;; History of argument lists passed to perldb.
 (defvar gud-perldb-history nil)
 
+(defvar perldb-repeat-map
+  (let ((map (make-sparse-keymap)))
+    (pcase-dolist (`(,key . ,cmd) '(("n" . gud-next)
+                                    ("s" . gud-step)
+                                    ("c" . gud-cont)
+                                    ("l" . gud-refresh)))
+      (define-key map key cmd))
+    map)
+  "Keymap to repeat `perldb' stepping instructions `C-x C-a C-n n n'.
+Used in `repeat-mode'.")
+
 (defun gud-perldb-massage-args (_file args)
   "Convert a command line as would be typed normally to run perldb
 into one that invokes an Emacs-enabled debugging session.
@@ -1640,6 +1701,7 @@ perldb
   (gud-def gud-print  "p %e"          "\C-p" "Evaluate perl expression at point.")
   (gud-def gud-until  "c %l"          "\C-u" "Continue to current line.")
 
+  (gud-set-repeat-map-property 'perldb-repeat-map)
 
   (setq comint-prompt-regexp "^  DB<+[0-9]+>+ ")
   (setq paragraph-start comint-prompt-regexp)
@@ -1668,6 +1730,20 @@ gud-pdb-marker-regexp-fnname-group
 
 (defvar gud-pdb-marker-regexp-start "^> ")
 
+(defvar pdb-repeat-map
+  (let ((map (make-sparse-keymap)))
+    (pcase-dolist (`(,key . ,cmd) '(("n" . gud-next)
+                                    ("s" . gud-step)
+                                    ("c" . gud-cont)
+                                    ("l" . gud-refresh)
+                                    ("f" . gud-finish)
+                                    ("<" . gud-up)
+                                    (">" . gud-down)))
+      (define-key map key cmd))
+    map)
+  "Keymap to repeat `pdb' stepping instructions `C-x C-a C-n n n'.
+Used in `repeat-mode'.")
+
 ;; There's no guarantee that Emacs will hand the filter the entire
 ;; marker at once; it could be broken up across several strings.  We
 ;; might even receive a big chunk with several markers in it.  If we
@@ -1757,6 +1833,8 @@ pdb
   (gud-def gud-print  "p %e"         "\C-p" "Evaluate Python expression at point.")
   (gud-def gud-statement "!%e"      "\C-e" "Execute Python statement at point.")
 
+  (gud-set-repeat-map-property 'pdb-repeat-map)
+
   ;; (setq comint-prompt-regexp "^(.*pdb[+]?) *")
   (setq comint-prompt-regexp "^(Pdb) *")
   (setq paragraph-start comint-prompt-regexp)
@@ -1770,6 +1848,19 @@ gud-guiler-history
 
 (defvar gud-guiler-lastfile nil)
 
+(defvar guiler-repeat-map
+  (let ((map (make-sparse-keymap)))
+    (pcase-dolist (`(,key . ,cmd) '(("n" . gud-next)
+                                    ("s" . gud-step)
+                                    ("l" . gud-refresh)
+                                    ("f" . gud-finish)
+                                    ("<" . gud-up)
+                                    (">" . gud-down)))
+      (define-key map key cmd))
+    map)
+  "Keymap to repeat `guiler' stepping instructions `C-x C-a C-n n n'.
+Used in `repeat-mode'.")
+
 (defun gud-guiler-marker-filter (string)
   (setq gud-marker-acc (if gud-marker-acc (concat gud-marker-acc string) string))
 
@@ -1835,6 +1926,8 @@ guiler
   (gud-def gud-down   ",down"         ">" "Down one stack frame.")
   (gud-def gud-print  "%e"            "\C-p" "Evaluate Guile expression at point.")
 
+  (gud-set-repeat-map-property 'guiler-repeat-map)
+
   (setq comint-prompt-regexp "^scheme@([^>]+> ")
   (setq paragraph-start comint-prompt-regexp)
   (run-hooks 'guiler-mode-hook))
@@ -2280,6 +2373,21 @@ gud-jdb-find-source-file
 ;; Note: Reset to this value every time a prompt is seen
 (defvar gud-jdb-lowest-stack-level 999)
 
+(defvar jdb-repeat-map
+  (let ((map (make-sparse-keymap)))
+    (pcase-dolist (`(,key . ,cmd) '(("n" . gud-next)
+                                    ("s" . gud-step)
+                                    ("i" . gud-stepi)
+                                    ("c" . gud-cont)
+                                    ("f" . gud-finish)
+                                    ("<" . gud-up)
+                                    (">" . gud-down)
+                                    ("l" . gud-refresh)))
+      (define-key map key cmd))
+    map)
+  "Keymap to repeat `jdb' stepping instructions `C-x C-a C-n n n'.
+Used in `repeat-mode'.")
+
 (defun gud-jdb-find-source-using-classpath (p)
   "Find source file corresponding to fully qualified class P.
 Convert P from jdb's output, converted to a pathname
@@ -2488,6 +2596,8 @@ jdb
   (gud-def gud-print  "print %e"  "\C-p" "Print value of expression at point.")
   (gud-def gud-pstar  "dump %e"  nil "Print all object information at point.")
 
+  (gud-set-repeat-map-property 'jdb-repeat-map)
+
   (setq comint-prompt-regexp "^> \\|^[^ ]+\\[[0-9]+\\] ")
   (setq paragraph-start comint-prompt-regexp)
   (run-hooks 'jdb-mode-hook)
-- 
2.32.0


------=_Part_615291_1778393584.1627368390899--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#49632; Package emacs. Full text available.

Message received at 49632 <at> debbugs.gnu.org:


Received: (at 49632) by debbugs.gnu.org; 27 Jul 2021 04:09:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 27 00:09:30 2021
Received: from localhost ([127.0.0.1]:52027 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1m8EPJ-0001nF-5d
	for submit <at> debbugs.gnu.org; Tue, 27 Jul 2021 00:09:29 -0400
Received: from wilbur.contactoffice.com ([212.3.242.68]:45268)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <leungbk@HIDDEN>) id 1m8EPF-0001n0-Q1
 for 49632 <at> debbugs.gnu.org; Tue, 27 Jul 2021 00:09:27 -0400
Received: from ichabod.co-bxl (ichabod.co-bxl [10.2.0.36])
 by wilbur.contactoffice.com (Postfix) with ESMTP id 85724762;
 Tue, 27 Jul 2021 06:09:18 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1627358958; 
 s=20210208-e7xh; d=mailfence.com; i=leungbk@HIDDEN;
 h=Date:From:Reply-To:Cc:Message-ID:In-Reply-To:References:MIME-Version:Content-Type;
 l=15901; bh=roYWANgGEpGRxFzlZe6tkicFyNPsZrhf327J2PN3dWE=;
 b=BWxMIALJzLUJVj4eqj5Ih0BMuwf0oPE1sG6j5wpH2zgaR3p66vUsFombBTATt+Fa
 Tpms5qj3EVIK4VkGqJeVwZcuG+9PMejnyuQnbVLOFczwKt1qbJ3MSuGaVTHa6745iXo
 UTQcW/bd/meAwiGo5ge43KmScWJpO5dJEP5bLFTcgOFUQWQu9Sff+PRBpqd4JNIqV6z
 PQuMLOZfvSU+2SBFsxjspuklBIgaV1bhcfkOwWZXY5MuTZfZEI0Et+DLcJXTXftx4Mw
 OkHfHmg0E76/GtsquODfOkhXASAUg33AMkdeDocghz2zPM3uAiYgvJqmOJpI+l7Z1Sn
 /uLkiGVo+A==
Date: Tue, 27 Jul 2021 06:09:14 +0200 (CEST)
From: Brian Leung <leungbk@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Message-ID: <1340188632.606225.1627358954291@HIDDEN>
In-Reply-To: <875ywwbth7.fsf@HIDDEN>
References: <89178870.2006793.1626665845848@HIDDEN>
 <87eebupi5k.fsf@HIDDEN> <343742107.2068902.1626706305280@HIDDEN>
 <87k0lml3wt.fsf@HIDDEN> <874kcql2r8.fsf@HIDDEN>
 <2097190220.304800.1627097630028@HIDDEN> <87sg02zz65.fsf@HIDDEN>
 <8735s2ru7o.fsf@HIDDEN>
 <2138242899.459686.1627248504532@HIDDEN>
 <875ywwbth7.fsf@HIDDEN>
Subject: Re: bug#49632: [PATCH] Ensure that M-x gdb populates gud-repeat-map
MIME-Version: 1.0
Content-Type: multipart/mixed; 
 boundary="----=_Part_606212_1733669272.1627358949190"
X-Priority: 3
X-Mailer: ContactOffice Mail
X-ContactOffice-Account: com:225491745
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 49632
Cc: Lars Ingebrigtsen <larsi@HIDDEN>, 49632 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Brian Leung <leungbk@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

------=_Part_606212_1733669272.1627358949190
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

> Is there a reason why gud-set-repeat-map-property should be a macro,
> but not a function?  When it's a macro, there are problems such that
> when the user modifies the map, then the function that uses the macro
> needs to be recompiled.

When I wrote initially wrote gud-set-repeat-map-property, I couldn't figure=
 out how to make gud-set-repeat-map-property work as a function since the r=
epeat-map property needed to be a symbol corresponding to a keymap, and not=
 an evaluated keymap.

I've updated the patch with a change to the repeat-post-hook function in re=
peat.el to accept an evaluated keymap, which permits a function version of =
gud-set-repeat-map-property.

> ----------------------------------------
> From: Juri Linkov <juri@HIDDEN>
> Sent: Tue Jul 27 00:48:20 CEST 2021
> To: Brian Leung <leungbk@HIDDEN>
> Cc: Lars Ingebrigtsen <larsi@HIDDEN>, <49632 <at> debbugs.gnu.org>
> Subject: Re: bug#49632: [PATCH] Ensure that M-x gdb populates gud-repeat-=
map
>=20
>=20
> >> There is one thing that I don't understand: is the
> >> helper function gud-set-repeat-map-property really needed?
> >>
> >> If e.g. the defvar gud-gdb-repeat-map uses such symbols as 'gud-next',
> >> could it put the 'repeat-map' property on the same symbols
> >> with reference to the variable 'map' directly in these defvars?
> >> Then only defvars will be needed, and no changes in gud-gdb, gdb.
> >
> > If we assign the repeat-map property within the defvars and avoid doing=
 so
> > in the M-x gdb commands, then after gud.el gets loaded, the repeat-map
> > property on (say) gud-next will be 'jdb, since jdb-repeat-map is the la=
st
> > such foo-repeat-map defvar appearing in gud.el. In that case, calling M=
-x
> > perldb and then running gud-next when repeat-mode is on will bring up t=
he
> > jdb-repeat-map, which contains some commands that aren't defined for
> > perldb. So I think the gud-set-repeat-map-property macro (or something =
like
> > it) is necessary.
>=20
> You are right.  Then I have only minor comments:
>=20
> 1. I thought that you want to create two separate maps for gud-gdb and gd=
b.
> This is the reason why I suggested to rename gud-repeat-map to gud-gdb-re=
peat-map.
> But since you use only one map for gbd and gud-gdb, then the name
> gud-repeat-map is fine.
>=20
> 2. Is there a reason why gud-set-repeat-map-property should be a macro,
> but not a function?  When it's a macro, there are problems such that
> when the user modifies the map, then the function that uses the macro
> needs to be recompiled.


--=C2=A0
Sent with https://mailfence.com
Secure and private email

--=20
Mailfence.com
Private and secure email

------=_Part_606212_1733669272.1627358949190
Content-Type: text/x-diff; charset=us-ascii; 
	name=0001-Ensure-that-gud-commands-for-M-x-gdb-are-handled-by-.patch
Content-Transfer-Encoding: 7bit
Content-Description: File Attachment:
 0001-Ensure-that-gud-commands-for-M-x-gdb-are-handled-by-.patch
Content-Disposition: attachment; 
	filename=0001-Ensure-that-gud-commands-for-M-x-gdb-are-handled-by-.patch

From d12a32b225c364aa75708c766370e8f27a08995a Mon Sep 17 00:00:00 2001
From: Brian Leung <leungbk@HIDDEN>
Date: Mon, 19 Jul 2021 23:41:01 -0700
Subject: [PATCH 1/2] Ensure that gud commands for M-x gdb are handled by
 repeat-mode

* lisp/progmodes/gud.el (gud-gdb-repeat-map): Rename from
gud-repeat-map, and populate at the top-level.
(gud-set-repeat-map-property): Introduce this helper function for
setting the repeat-map property.
(gud-gdb): Use the gud-set-repeat-map-property function to assign the
repeat-map property.

* lisp/progmodes/gdb-mi.el (gdb): Use the gud-set-repeat-map-property
function to assign the repeat-map property.

Because different debugging tools may not support all of the gud-foo
functions, we reassign the repeat-map property within the respective
commands, as opposed to the top level of the files, to ensure that the
repeat-map property is reassigned each time to a symbol corresponding
to the active debugging tool.

* lisp/repeat.el (repeat-post-hook): Allow the repeat-map property to
be an evaluated keymap.
---
 lisp/progmodes/gdb-mi.el |  2 ++
 lisp/progmodes/gud.el    | 33 +++++++++++++++++++++------------
 lisp/repeat.el           |  3 ++-
 3 files changed, 25 insertions(+), 13 deletions(-)

diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index 57c99abec6..ad579eb89f 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -996,6 +996,8 @@ gdb
   (define-key gud-minor-mode-map [left-margin C-mouse-3]
     'gdb-mouse-jump)
 
+  (gud-set-repeat-map-property gud-gdb-repeat-map)
+
   (setq-local gud-gdb-completion-function 'gud-gdbmi-completions)
 
   (add-hook 'completion-at-point-functions #'gud-gdb-completion-at-point
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 740a6e2581..3ffae7f2e0 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -320,10 +320,28 @@ gud-tool-bar-map
       (tool-bar-local-item-from-menu
        (car x) (cdr x) map gud-minor-mode-map))))
 
-(defvar gud-repeat-map (make-sparse-keymap)
-  "Keymap to repeat gud stepping instructions `C-x C-a C-n n n'.
+(defvar gud-gdb-repeat-map
+  (let ((map (make-sparse-keymap)))
+    (pcase-dolist (`(,key . ,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 map key cmd))
+    map)
+  "Keymap to repeat `gud-gdb' stepping instructions `C-x C-a C-n n n'.
 Used in `repeat-mode'.")
 
+(defun gud-set-repeat-map-property (keymap)
+  "Set the `repeat-map' property of each command in KEYMAP to KEYMAP."
+  (map-keymap-internal (lambda (_ cmd)
+                          (put cmd 'repeat-map keymap))
+                        keymap))
+
+
 (defun gud-file-name (f)
   "Transform a relative file name to an absolute file name.
 Uses `gud-<MINOR-MODE>-directories' to find the source files."
@@ -814,16 +832,7 @@ 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-repeat-map (car cmd) (cdr cmd))
-    (put (cdr cmd) 'repeat-map 'gud-repeat-map))
+  (gud-set-repeat-map-property gud-gdb-repeat-map)
 
   (add-hook 'completion-at-point-functions #'gud-gdb-completion-at-point
             nil 'local)
diff --git a/lisp/repeat.el b/lisp/repeat.el
index cec3cb643a..aa2c3a0779 100644
--- a/lisp/repeat.el
+++ b/lisp/repeat.el
@@ -410,7 +410,8 @@ repeat-post-hook
                          (and (symbolp real-this-command)
                               (get real-this-command 'repeat-map)))))
         (when rep-map
-          (when (boundp rep-map)
+          (when (and (boundp rep-map)
+                     (not (keymapp rep-map)))
             (setq rep-map (symbol-value rep-map)))
           (let ((map (copy-keymap rep-map)))
 
-- 
2.32.0


------=_Part_606212_1733669272.1627358949190
Content-Type: text/x-diff; charset=us-ascii; 
	name=0002-Ensure-that-gud-commands-for-non-GDB-debuggers-are-h.patch
Content-Transfer-Encoding: 7bit
Content-Description: File Attachment:
 0002-Ensure-that-gud-commands-for-non-GDB-debuggers-are-h.patch
Content-Disposition: attachment; 
	filename=0002-Ensure-that-gud-commands-for-non-GDB-debuggers-are-h.patch

From 1bc33064c86a7dbeb0330f9aedaa23dfc35495bb Mon Sep 17 00:00:00 2001
From: Brian Leung <leungbk@HIDDEN>
Date: Tue, 20 Jul 2021 00:32:34 -0700
Subject: [PATCH 2/2] Ensure that gud commands for non-GDB debuggers are
 handled by repeat-mode

* lisp/progmodes/gud.el (sdb-repeat-map): Define.
(sdb): Set repeat-mode property to the symbol corresponding to the
repeat map.
(dbx-repeat-map): Define.
(dbx): Set repeat-mode property to the symbol corresponding to the
repeat map.
(xdb-repeat-map): Define.
(xdb): Set repeat-mode property to the symbol corresponding to the
repeat map.
(perldb-repeat-map): Define.
(perldb): Set repeat-mode property to the symbol corresponding to the
repeat map.
(pdb-repeat-map): Define.
(pdb): Set repeat-mode property to the symbol corresponding to the
repeat map.
(guiler-repeat-map): Define.
(guiler): Set repeat-mode property to the symbol corresponding to the
repeat map.
(jdb-repeat-map): Define.
(jdb): Set repeat-mode property to the symbol corresponding to the
repeat map.
---
 lisp/progmodes/gud.el | 110 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 110 insertions(+)

diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 3ffae7f2e0..950ee356f4 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -1033,6 +1033,18 @@ gud-sdb-needs-tags
 
 (defvar gud-sdb-lastfile nil)
 
+(defvar sdb-repeat-map
+  (let ((map (make-sparse-keymap)))
+    (pcase-dolist (`(,key . ,cmd) '(("n" . gud-next)
+                                    ("s" . gud-step)
+                                    ("i" . gud-stepi)
+                                    ("c" . gud-cont)
+                                    ("l" . gud-refresh)))
+      (define-key map key cmd))
+    map)
+  "Keymap to repeat `sdb' stepping instructions `C-x C-a C-n n n'.
+Used in `repeat-mode'.")
+
 (defun gud-sdb-marker-filter (string)
   (setq gud-marker-acc
 	(if gud-marker-acc (concat gud-marker-acc string) string))
@@ -1103,6 +1115,8 @@ sdb
   (gud-def gud-cont   "c"    "\C-r"   "Continue with display.")
   (gud-def gud-print  "%e/"  "\C-p"   "Evaluate C expression at point.")
 
+  (gud-set-repeat-map-property sdb-repeat-map)
+
   (setq comint-prompt-regexp  "\\(^\\|\n\\)\\*")
   (setq paragraph-start comint-prompt-regexp)
   (run-hooks 'sdb-mode-hook)
@@ -1261,6 +1275,23 @@ gud-dbx-use-stopformat-p
 ;; whereby `set $stopformat=1' reportedly produces output compatible
 ;; with `gud-dbx-marker-filter', which we prefer.
 
+(defvar dbx-repeat-map
+  (let ((map (make-sparse-keymap)))
+    (pcase-dolist (`(,key . ,cmd) '(("n" . gud-next)
+                                    ("s" . gud-step)
+                                    ("i" . gud-stepi)
+                                    ("c" . gud-cont)
+                                    ("l" . gud-refresh)
+                                    ("<" . gud-up)
+                                    (">" . gud-down)))
+      (define-key map key cmd))
+    (when (or gud-mips-p
+              gud-irix-p)
+      (define-key map "f" 'gud-finish))
+    map)
+  "Keymap to repeat `dbx' stepping instructions `C-x C-a C-n n n'.
+Used in `repeat-mode'.")
+
 ;; The process filter is also somewhat
 ;; unreliable, sometimes not spotting the markers; I don't know
 ;; whether there's anything that can be done about that.]
@@ -1408,6 +1439,8 @@ dbx
   (gud-def gud-print  "print %e"  "\C-p" "Evaluate C expression at point.")
   (gud-def gud-run    "run"	     nil    "Run the program.")
 
+  (gud-set-repeat-map-property dbx-repeat-map)
+
   (setq comint-prompt-regexp  "^[^)\n]*dbx) *")
   (setq paragraph-start comint-prompt-regexp)
   (run-hooks 'dbx-mode-hook)
@@ -1419,6 +1452,21 @@ dbx
 ;; History of argument lists passed to xdb.
 (defvar gud-xdb-history nil)
 
+(defvar xdb-repeat-map
+  (let ((map (make-sparse-keymap)))
+    (pcase-dolist (`(,key . ,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 map key cmd))
+    map)
+  "Keymap to repeat `xdb' stepping instructions `C-x C-a C-n n n'.
+Used in `repeat-mode'.")
+
 (defcustom gud-xdb-directories nil
   "A list of directories that xdb should search for source code.
 If nil, only source files in the program directory
@@ -1484,6 +1532,8 @@ xdb
   (gud-def gud-finish "bu\\t"      "\C-f" "Finish executing current function.")
   (gud-def gud-print  "p %e"       "\C-p" "Evaluate C expression at point.")
 
+  (gud-set-repeat-map-property xdb-repeat-map)
+
   (setq comint-prompt-regexp  "^>")
   (setq paragraph-start comint-prompt-regexp)
   (run-hooks 'xdb-mode-hook))
@@ -1494,6 +1544,17 @@ xdb
 ;; History of argument lists passed to perldb.
 (defvar gud-perldb-history nil)
 
+(defvar perldb-repeat-map
+  (let ((map (make-sparse-keymap)))
+    (pcase-dolist (`(,key . ,cmd) '(("n" . gud-next)
+                                    ("s" . gud-step)
+                                    ("c" . gud-cont)
+                                    ("l" . gud-refresh)))
+      (define-key map key cmd))
+    map)
+  "Keymap to repeat `perldb' stepping instructions `C-x C-a C-n n n'.
+Used in `repeat-mode'.")
+
 (defun gud-perldb-massage-args (_file args)
   "Convert a command line as would be typed normally to run perldb
 into one that invokes an Emacs-enabled debugging session.
@@ -1636,6 +1697,7 @@ perldb
   (gud-def gud-print  "p %e"          "\C-p" "Evaluate perl expression at point.")
   (gud-def gud-until  "c %l"          "\C-u" "Continue to current line.")
 
+  (gud-set-repeat-map-property perldb-repeat-map)
 
   (setq comint-prompt-regexp "^  DB<+[0-9]+>+ ")
   (setq paragraph-start comint-prompt-regexp)
@@ -1664,6 +1726,20 @@ gud-pdb-marker-regexp-fnname-group
 
 (defvar gud-pdb-marker-regexp-start "^> ")
 
+(defvar pdb-repeat-map
+  (let ((map (make-sparse-keymap)))
+    (pcase-dolist (`(,key . ,cmd) '(("n" . gud-next)
+                                    ("s" . gud-step)
+                                    ("c" . gud-cont)
+                                    ("l" . gud-refresh)
+                                    ("f" . gud-finish)
+                                    ("<" . gud-up)
+                                    (">" . gud-down)))
+      (define-key map key cmd))
+    map)
+  "Keymap to repeat `pdb' stepping instructions `C-x C-a C-n n n'.
+Used in `repeat-mode'.")
+
 ;; There's no guarantee that Emacs will hand the filter the entire
 ;; marker at once; it could be broken up across several strings.  We
 ;; might even receive a big chunk with several markers in it.  If we
@@ -1753,6 +1829,8 @@ pdb
   (gud-def gud-print  "p %e"         "\C-p" "Evaluate Python expression at point.")
   (gud-def gud-statement "!%e"      "\C-e" "Execute Python statement at point.")
 
+  (gud-set-repeat-map-property pdb-repeat-map)
+
   ;; (setq comint-prompt-regexp "^(.*pdb[+]?) *")
   (setq comint-prompt-regexp "^(Pdb) *")
   (setq paragraph-start comint-prompt-regexp)
@@ -1766,6 +1844,19 @@ gud-guiler-history
 
 (defvar gud-guiler-lastfile nil)
 
+(defvar guiler-repeat-map
+  (let ((map (make-sparse-keymap)))
+    (pcase-dolist (`(,key . ,cmd) '(("n" . gud-next)
+                                    ("s" . gud-step)
+                                    ("l" . gud-refresh)
+                                    ("f" . gud-finish)
+                                    ("<" . gud-up)
+                                    (">" . gud-down)))
+      (define-key map key cmd))
+    map)
+  "Keymap to repeat `guiler' stepping instructions `C-x C-a C-n n n'.
+Used in `repeat-mode'.")
+
 (defun gud-guiler-marker-filter (string)
   (setq gud-marker-acc (if gud-marker-acc (concat gud-marker-acc string) string))
 
@@ -1831,6 +1922,8 @@ guiler
   (gud-def gud-down   ",down"         ">" "Down one stack frame.")
   (gud-def gud-print  "%e"            "\C-p" "Evaluate Guile expression at point.")
 
+  (gud-set-repeat-map-property guiler-repeat-map)
+
   (setq comint-prompt-regexp "^scheme@([^>]+> ")
   (setq paragraph-start comint-prompt-regexp)
   (run-hooks 'guiler-mode-hook))
@@ -2276,6 +2369,21 @@ gud-jdb-find-source-file
 ;; Note: Reset to this value every time a prompt is seen
 (defvar gud-jdb-lowest-stack-level 999)
 
+(defvar jdb-repeat-map
+  (let ((map (make-sparse-keymap)))
+    (pcase-dolist (`(,key . ,cmd) '(("n" . gud-next)
+                                    ("s" . gud-step)
+                                    ("i" . gud-stepi)
+                                    ("c" . gud-cont)
+                                    ("f" . gud-finish)
+                                    ("<" . gud-up)
+                                    (">" . gud-down)
+                                    ("l" . gud-refresh)))
+      (define-key map key cmd))
+    map)
+  "Keymap to repeat `jdb' stepping instructions `C-x C-a C-n n n'.
+Used in `repeat-mode'.")
+
 (defun gud-jdb-find-source-using-classpath (p)
   "Find source file corresponding to fully qualified class P.
 Convert P from jdb's output, converted to a pathname
@@ -2484,6 +2592,8 @@ jdb
   (gud-def gud-print  "print %e"  "\C-p" "Print value of expression at point.")
   (gud-def gud-pstar  "dump %e"  nil "Print all object information at point.")
 
+  (gud-set-repeat-map-property jdb-repeat-map)
+
   (setq comint-prompt-regexp "^> \\|^[^ ]+\\[[0-9]+\\] ")
   (setq paragraph-start comint-prompt-regexp)
   (run-hooks 'jdb-mode-hook)
-- 
2.32.0


------=_Part_606212_1733669272.1627358949190--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#49632; Package emacs. Full text available.

Message received at 49632 <at> debbugs.gnu.org:


Received: (at 49632) by debbugs.gnu.org; 26 Jul 2021 23:00:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 26 19:00:38 2021
Received: from localhost ([127.0.0.1]:51703 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1m89aQ-0002t5-EM
	for submit <at> debbugs.gnu.org; Mon, 26 Jul 2021 19:00:38 -0400
Received: from relay5-d.mail.gandi.net ([217.70.183.197]:51191)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1m89aN-0002sn-CH
 for 49632 <at> debbugs.gnu.org; Mon, 26 Jul 2021 19:00:36 -0400
Received: (Authenticated sender: juri@HIDDEN)
 by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id ABFA11C0004;
 Mon, 26 Jul 2021 23:00:27 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Brian Leung <leungbk@HIDDEN>
Subject: Re: bug#49632: [PATCH] Ensure that M-x gdb populates gud-repeat-map
Organization: LINKOV.NET
References: <89178870.2006793.1626665845848@HIDDEN>
 <87eebupi5k.fsf@HIDDEN>
 <343742107.2068902.1626706305280@HIDDEN>
 <87k0lml3wt.fsf@HIDDEN> <874kcql2r8.fsf@HIDDEN>
 <2097190220.304800.1627097630028@HIDDEN>
 <87sg02zz65.fsf@HIDDEN> <8735s2ru7o.fsf@HIDDEN>
 <2138242899.459686.1627248504532@HIDDEN>
Date: Tue, 27 Jul 2021 01:48:20 +0300
In-Reply-To: <2138242899.459686.1627248504532@HIDDEN> (Brian Leung's
 message of "Sun, 25 Jul 2021 23:28:24 +0200 (CEST)")
Message-ID: <875ywwbth7.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 49632
Cc: Lars Ingebrigtsen <larsi@HIDDEN>, 49632 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>> There is one thing that I don't understand: is the
>> helper function gud-set-repeat-map-property really needed?
>>
>> If e.g. the defvar gud-gdb-repeat-map uses such symbols as 'gud-next',
>> could it put the 'repeat-map' property on the same symbols
>> with reference to the variable 'map' directly in these defvars?
>> Then only defvars will be needed, and no changes in gud-gdb, gdb.
>
> If we assign the repeat-map property within the defvars and avoid doing so
> in the M-x gdb commands, then after gud.el gets loaded, the repeat-map
> property on (say) gud-next will be 'jdb, since jdb-repeat-map is the last
> such foo-repeat-map defvar appearing in gud.el. In that case, calling M-x
> perldb and then running gud-next when repeat-mode is on will bring up the
> jdb-repeat-map, which contains some commands that aren't defined for
> perldb. So I think the gud-set-repeat-map-property macro (or something like
> it) is necessary.

You are right.  Then I have only minor comments:

1. I thought that you want to create two separate maps for gud-gdb and gdb.
This is the reason why I suggested to rename gud-repeat-map to gud-gdb-repeat-map.
But since you use only one map for gbd and gud-gdb, then the name
gud-repeat-map is fine.

2. Is there a reason why gud-set-repeat-map-property should be a macro,
but not a function?  When it's a macro, there are problems such that
when the user modifies the map, then the function that uses the macro
needs to be recompiled.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#49632; Package emacs. Full text available.

Message received at 49632 <at> debbugs.gnu.org:


Received: (at 49632) by debbugs.gnu.org; 25 Jul 2021 21:28:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jul 25 17:28:39 2021
Received: from localhost ([127.0.0.1]:49514 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1m7lfr-0001a8-Ll
	for submit <at> debbugs.gnu.org; Sun, 25 Jul 2021 17:28:39 -0400
Received: from wilbur.contactoffice.com ([212.3.242.68]:51360)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <leungbk@HIDDEN>) id 1m7lfn-0001Zp-0a
 for 49632 <at> debbugs.gnu.org; Sun, 25 Jul 2021 17:28:38 -0400
Received: from ichabod.co-bxl (ichabod.co-bxl [10.2.0.36])
 by wilbur.contactoffice.com (Postfix) with ESMTP id 4C89D879;
 Sun, 25 Jul 2021 23:28:28 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1627248508; 
 s=20210208-e7xh; d=mailfence.com; i=leungbk@HIDDEN;
 h=Date:From:Reply-To:Cc:Message-ID:In-Reply-To:References:MIME-Version:Content-Type:Content-Transfer-Encoding;
 l=1952; bh=krzbb/Jg3ijbdyOYMs9fLa9YRGeqEkGWiwVv0oktALY=;
 b=IDmLIyGr9tWqaS2v6zUV+KJpTCNXV6+C7XutQ/z+SSrdgK8JhKwLumBbxn0NMSV1
 vJkAih6G2kYn0d+XDEw4L8TvOyAZvpiiZH55Q7tibhq1Rf5nvqLcXmNFnDRxyKFIteL
 p+7mD7OQQ7zBrWIi+dwaDwcd/neyLoHJjroD4fmXQNi3dQs6MTkhu9GufQrc+pZM1ec
 OXuaLoMJ89WWRMPPk33oAM96Sc4ATFw+QkLuxirWw0RadjCYK+8GHF2DT8zKEQW0zJN
 qXnXfNGNt7/vlOSs3LHZfPvC1nIkA2e8n6xIpNwsOBceQmTkPTkrvrK7KTzQN5VcqTb
 smIyiZ2hQw==
Date: Sun, 25 Jul 2021 23:28:24 +0200 (CEST)
From: Brian Leung <leungbk@HIDDEN>
To: Juri Linkov <juri@HIDDEN>, Lars Ingebrigtsen <larsi@HIDDEN>
Message-ID: <2138242899.459686.1627248504532@HIDDEN>
In-Reply-To: <8735s2ru7o.fsf@HIDDEN>
References: <89178870.2006793.1626665845848@HIDDEN>
 <87eebupi5k.fsf@HIDDEN> <343742107.2068902.1626706305280@HIDDEN>
 <87k0lml3wt.fsf@HIDDEN> <874kcql2r8.fsf@HIDDEN>
 <2097190220.304800.1627097630028@HIDDEN> <87sg02zz65.fsf@HIDDEN>
 <8735s2ru7o.fsf@HIDDEN>
Subject: Re: bug#49632: [PATCH] Ensure that M-x gdb populates gud-repeat-map
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Priority: 3
X-Mailer: ContactOffice Mail
X-ContactOffice-Account: com:225491745
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 49632
Cc: 49632 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Brian Leung <leungbk@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

> There is one thing that I don't understand: is the
> helper function gud-set-repeat-map-property really needed?
>=20
> If e.g. the defvar gud-gdb-repeat-map uses such symbols as 'gud-next',
> could it put the 'repeat-map' property on the same symbols
> with reference to the variable 'map' directly in these defvars?
> Then only defvars will be needed, and no changes in gud-gdb, gdb.

If we assign the repeat-map property within the defvars and avoid doing so =
in the M-x gdb commands, then after gud.el gets loaded, the repeat-map prop=
erty on (say) gud-next will be 'jdb, since jdb-repeat-map is the last such =
foo-repeat-map defvar appearing in gud.el. In that case, calling M-x perldb=
 and then running gud-next when repeat-mode is on will bring up the jdb-rep=
eat-map, which contains some commands that aren't defined for perldb. So I =
think the gud-set-repeat-map-property macro (or something like it) is neces=
sary.

> ----------------------------------------
> From: Juri Linkov <juri@HIDDEN>
> Sent: Sun Jul 25 22:53:31 CEST 2021
> To: Lars Ingebrigtsen <larsi@HIDDEN>
> Cc: Brian Leung <leungbk@HIDDEN>, <49632 <at> debbugs.gnu.org>
> Subject: Re: bug#49632: [PATCH] Ensure that M-x gdb populates gud-repeat-=
map
>=20
>=20
> >> OK, I've updated the patch following Juri's suggestions.
> >
> > Skimming the patch, it looks good to me.  Juri, do you have any
> > comments?
>=20
> There is one thing that I don't understand: is the
> helper function gud-set-repeat-map-property really needed?
>=20
> If e.g. the defvar gud-gdb-repeat-map uses such symbols as 'gud-next',
> could it put the 'repeat-map' property on the same symbols
> with reference to the variable 'map' directly in these defvars?
> Then only defvars will be needed, and no changes in gud-gdb, gdb.


--=C2=A0
Sent with https://mailfence.com
Secure and private email

--=20
Mailfence.com
Private and secure email




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#49632; Package emacs. Full text available.

Message received at 49632 <at> debbugs.gnu.org:


Received: (at 49632) by debbugs.gnu.org; 25 Jul 2021 20:58:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jul 25 16:58:27 2021
Received: from localhost ([127.0.0.1]:49493 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1m7lCd-0000rT-EF
	for submit <at> debbugs.gnu.org; Sun, 25 Jul 2021 16:58:27 -0400
Received: from relay3-d.mail.gandi.net ([217.70.183.195]:58781)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1m7lCa-0000qu-9d
 for 49632 <at> debbugs.gnu.org; Sun, 25 Jul 2021 16:58:24 -0400
Received: (Authenticated sender: juri@HIDDEN)
 by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id BBFBE60003;
 Sun, 25 Jul 2021 20:58:16 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#49632: [PATCH] Ensure that M-x gdb populates gud-repeat-map
Organization: LINKOV.NET
References: <89178870.2006793.1626665845848@HIDDEN>
 <87eebupi5k.fsf@HIDDEN>
 <343742107.2068902.1626706305280@HIDDEN>
 <87k0lml3wt.fsf@HIDDEN> <874kcql2r8.fsf@HIDDEN>
 <2097190220.304800.1627097630028@HIDDEN>
 <87sg02zz65.fsf@HIDDEN>
Date: Sun, 25 Jul 2021 23:53:31 +0300
In-Reply-To: <87sg02zz65.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Sun,
 25 Jul 2021 08:26:58 +0200")
Message-ID: <8735s2ru7o.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 49632
Cc: 49632 <at> debbugs.gnu.org, Brian Leung <leungbk@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>> OK, I've updated the patch following Juri's suggestions.
>
> Skimming the patch, it looks good to me.  Juri, do you have any
> comments?

There is one thing that I don't understand: is the
helper function gud-set-repeat-map-property really needed?

If e.g. the defvar gud-gdb-repeat-map uses such symbols as 'gud-next',
could it put the 'repeat-map' property on the same symbols
with reference to the variable 'map' directly in these defvars?
Then only defvars will be needed, and no changes in gud-gdb, gdb.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#49632; Package emacs. Full text available.

Message received at 49632 <at> debbugs.gnu.org:


Received: (at 49632) by debbugs.gnu.org; 25 Jul 2021 06:27:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jul 25 02:27:11 2021
Received: from localhost ([127.0.0.1]:47387 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1m7XbT-0007uE-Bd
	for submit <at> debbugs.gnu.org; Sun, 25 Jul 2021 02:27:11 -0400
Received: from quimby.gnus.org ([95.216.78.240]:41226)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1m7XbQ-0007ty-CZ
 for 49632 <at> debbugs.gnu.org; Sun, 25 Jul 2021 02:27:10 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=YBVqPiEseDeFmVlqntBv+0pUVu+ZvnginnsNbmtId4Q=; b=cvf6DttEUXouT1og9LUxUHhFHz
 k/ZY0WLRR/8Ivh4g6eRUXVLgxHyVmwHLYhjQfAk5DlbgiRhIgVDJCaA77fN+7SC7KuOYml9j/a3cw
 K4rQ3eIqaoRrkd2q4HiNDBvFpKe77RD21MHhWsxcNa+7CMlNTVbcF+LtaayhR9loQIkM=;
Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=elva)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1m7XbH-00065j-2A; Sun, 25 Jul 2021 08:27:01 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Brian Leung <leungbk@HIDDEN>
Subject: Re: bug#49632: [PATCH] Ensure that M-x gdb populates gud-repeat-map
References: <89178870.2006793.1626665845848@HIDDEN>
 <87eebupi5k.fsf@HIDDEN>
 <343742107.2068902.1626706305280@HIDDEN>
 <87k0lml3wt.fsf@HIDDEN> <874kcql2r8.fsf@HIDDEN>
 <2097190220.304800.1627097630028@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAD1BMVEWpYhtZLB7pohnu
 0aH///80edrZAAAAAWJLR0QEj2jZUQAAAAd0SU1FB+UHGQYaHcLKDiQAAAGVSURBVDjLVVOBkcMw
 CAN+AfwT8M4Gzf67vQQ2tX29pkWRABlE6ujAEZk8eIjKqCNis04gHgB4EJ+z4/mtQAMydsT5OxmU
 tx3GD+MT2jEaqDwqBhExda3csfIjCBUK4eOdhMDAu6hI9awKefl/rD4kmmIqTu0CXL6cBEYSL6mp
 JkvKbwAyXl6xhiu5/CagN8PwWjKUzZwmoiCfDkDY4bwQj18qjsPdQozeKqo642Vmmu4ScgEBH7Jc
 i5uCu0hLPC/nRhLA9ZJ/SMEvISEmtNTim4N+7ZLwTisRkMzEptL5FC2AHg7ebwGBEIZhVlnrezti
 4cHb0hW3LlUScBrs3tOb9iaD+kOOsY5hkSKunFXfhiHYgJ/e0/fY+1GWNdIAOZ0jb36Pj+49Y+u5
 IQkIut8eRt1O7pmWI6tBkJ7P3DnYUiE27ZkHIH/LEyi9JNJbmMKWZHb6txiSyyY7O4Sedw31SIZJ
 ZSclh4EgWvUCsKbTXuEgYnH9u+3ZxlszSrT3CsCDHD+i69ZHlcu7TUaNg/aCcint+fwD5Chalzzb
 s+IAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjEtMDctMjVUMDY6MjY6MjkrMDA6MDDdxZBdAAAAJXRF
 WHRkYXRlOm1vZGlmeQAyMDIxLTA3LTI1VDA2OjI2OjI5KzAwOjAwrJgo4QAAAABJRU5ErkJggg==
X-Now-Playing: Prince's _Sign 'O' the Times (2)_: "I Could Never Take The
 Place Of Your Man"
Date: Sun, 25 Jul 2021 08:26:58 +0200
In-Reply-To: <2097190220.304800.1627097630028@HIDDEN> (Brian Leung's
 message of "Sat, 24 Jul 2021 05:33:50 +0200 (CEST)")
Message-ID: <87sg02zz65.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Brian Leung <leungbk@HIDDEN> writes: > OK,
 I've updated
 the patch following Juri's suggestions. Skimming the patch, it looks good
 to me. Juri, do you have any comments? 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 49632
Cc: 49632 <at> debbugs.gnu.org, Juri Linkov <juri@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Brian Leung <leungbk@HIDDEN> writes:

> OK, I've updated the patch following Juri's suggestions.

Skimming the patch, it looks good to me.  Juri, do you have any
comments?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#49632; Package emacs. Full text available.

Message received at 49632 <at> debbugs.gnu.org:


Received: (at 49632) by debbugs.gnu.org; 24 Jul 2021 03:34:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 23 23:34:08 2021
Received: from localhost ([127.0.0.1]:44984 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1m78QR-000589-A8
	for submit <at> debbugs.gnu.org; Fri, 23 Jul 2021 23:34:08 -0400
Received: from wilbur.contactoffice.com ([212.3.242.68]:58810)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <leungbk@HIDDEN>) id 1m78QL-00057a-FV
 for 49632 <at> debbugs.gnu.org; Fri, 23 Jul 2021 23:34:05 -0400
Received: from ichabod.co-bxl (ichabod.co-bxl [10.2.0.36])
 by wilbur.contactoffice.com (Postfix) with ESMTP id C6FCD9CA;
 Sat, 24 Jul 2021 05:33:53 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1627097633; 
 s=20210208-e7xh; d=mailfence.com; i=leungbk@HIDDEN;
 h=Date:From:Reply-To:Cc:Message-ID:In-Reply-To:References:MIME-Version:Content-Type;
 l=13901; bh=xhOohRdIcS+XppNJsU9uaJ03brnr46+RIHwSGTCTG1I=;
 b=aQqd1DGAQ6155LUltFpMvk96v+HBehb9axX4YUZmmkGVLz7jrqYrXk7vJecQZx99
 h4IflLUIVRnVjldBMd24HKziiTTxoTDNYS3V0FakM1nsR0gJzEWSt1iDAf/Ny9p8ry1
 IrYnuqMdFqx2MpMOuTEdL/B10xD/PZOlpYiRPrDJWejCWGTQUVwdIWDeOuhJfYTLEx0
 aJjbIj2G6gcLnyuIIYeMTK6vvv14tbpGYmTdDyj3fGoFKFsEy41Xf1r1hkxjh+vXL8d
 FhUI9c72K1Dk16D+JHJShqbixz46OXxMx0lNynfCniJxldhzc59EynC2VAMhlrfHwUZ
 863bm4P8Sw==
Date: Sat, 24 Jul 2021 05:33:50 +0200 (CEST)
From: Brian Leung <leungbk@HIDDEN>
To: Juri Linkov <juri@HIDDEN>, Lars Ingebrigtsen <larsi@HIDDEN>
Message-ID: <2097190220.304800.1627097630028@HIDDEN>
In-Reply-To: <874kcql2r8.fsf@HIDDEN>
References: <89178870.2006793.1626665845848@HIDDEN>
 <87eebupi5k.fsf@HIDDEN> <343742107.2068902.1626706305280@HIDDEN>
 <87k0lml3wt.fsf@HIDDEN> <874kcql2r8.fsf@HIDDEN>
Subject: Re: bug#49632: [PATCH] Ensure that M-x gdb populates gud-repeat-map
MIME-Version: 1.0
Content-Type: multipart/mixed; 
 boundary="----=_Part_304747_1485939163.1627097577379"
X-Priority: 3
X-Mailer: ContactOffice Mail
X-ContactOffice-Account: com:225491745
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 49632
Cc: 49632 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Brian Leung <leungbk@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

------=_Part_304747_1485939163.1627097577379
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

OK, I've updated the patch following Juri's suggestions.

> ----------------------------------------
> From: Lars Ingebrigtsen <larsi@HIDDEN>
> Sent: Mon Jul 19 17:52:43 CEST 2021
> To: Juri Linkov <juri@HIDDEN>
> Cc: Brian Leung <leungbk@HIDDEN>, <49632 <at> debbugs.gnu.org>
> Subject: Re: bug#49632: [PATCH] Ensure that M-x gdb populates gud-repeat-=
map
>=20
>=20
> Juri Linkov <juri@HIDDEN> writes:
>=20
> > Exactly.  But this means that you need to populate a new separate map
> > 'gdb-repeat-map' specific to 'gdb' commands.  Also I noticed that the
> > current name of 'gud-repeat-map' is wrong.  It should be renamed to
> > 'gud-gdb-repeat-map'.  So other debuggers could populate own repeat-map=
s
> > named e.g. 'sdb-repeat-map', 'jdb-repeat-map', 'perldb-repeat-map', etc=
.
>=20
> I see.  Then Brian's patch is functionally correct, but it shouldn't be
> copy-and-pasted -- instead separating it out into a helper function and
> using it both places seems like the correct thing to do.
>=20
> --=20
> (domestic pets only, the antidote for overdose, milk.)
>    bloggy blog: http://lars.ingebrigtsen.no


--=C2=A0
Sent with https://mailfence.com
Secure and private email

--=20
Mailfence.com
Private and secure email

------=_Part_304747_1485939163.1627097577379
Content-Type: text/x-diff; charset=us-ascii; 
	name=0001-Ensure-that-gud-commands-for-M-x-gdb-are-handled-by-.patch
Content-Transfer-Encoding: 7bit
Content-Description: File Attachment:
 0001-Ensure-that-gud-commands-for-M-x-gdb-are-handled-by-.patch
Content-Disposition: attachment; 
	filename=0001-Ensure-that-gud-commands-for-M-x-gdb-are-handled-by-.patch

From 14d770b2f1df8ec9cdb7b1ef60e7870b3e3f849d Mon Sep 17 00:00:00 2001
From: Brian Leung <leungbk@HIDDEN>
Date: Mon, 19 Jul 2021 23:41:01 -0700
Subject: [PATCH 1/2] Ensure that gud commands for M-x gdb are handled by
 repeat-mode

* lisp/progmodes/gud.el (gud-gdb-repeat-map): Rename from
gud-repeat-map, and populate at the top-level.
(gud-set-repeat-map-property): Introduce this helper function for
setting the repeat-map property.
(gud-gdb): Use the gud-set-repeat-map-property function to assign the
repeat-map property.

* lisp/progmodes/gdb-mi.el (gdb): Use the gud-set-repeat-map-property
function to assign the repeat-map property.

Because different debugging tools may not support all of the gud-foo
functions, we reassign the repeat-map property within the respective
commands, as opposed to the top level of the files, to ensure that the
repeat-map property is reassigned each time to a symbol corresponding
to the active debugging tool.
---
 lisp/progmodes/gdb-mi.el |  2 ++
 lisp/progmodes/gud.el    | 32 ++++++++++++++++++++------------
 2 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index aa3365278c..28892f9c96 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -979,6 +979,8 @@ gdb
   (define-key gud-minor-mode-map [left-margin C-mouse-3]
     'gdb-mouse-jump)
 
+  (gud-set-repeat-map-property gud-gdb-repeat-map)
+
   (setq-local gud-gdb-completion-function 'gud-gdbmi-completions)
 
   (add-hook 'completion-at-point-functions #'gud-gdb-completion-at-point
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 740a6e2581..402833025f 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -320,10 +320,27 @@ gud-tool-bar-map
       (tool-bar-local-item-from-menu
        (car x) (cdr x) map gud-minor-mode-map))))
 
-(defvar gud-repeat-map (make-sparse-keymap)
-  "Keymap to repeat gud stepping instructions `C-x C-a C-n n n'.
+(defvar gud-gdb-repeat-map
+  (let ((map (make-sparse-keymap)))
+    (pcase-dolist (`(,key . ,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 map key cmd))
+    map)
+  "Keymap to repeat `gud-gdb' stepping instructions `C-x C-a C-n n n'.
 Used in `repeat-mode'.")
 
+(defmacro gud-set-repeat-map-property (keymap)
+  "Set the `repeat-map' property of each command in KEYMAP to KEYMAP."
+  `(map-keymap-internal (lambda (_ cmd)
+                          (put cmd 'repeat-map ',keymap))
+                        ,keymap))
+
 (defun gud-file-name (f)
   "Transform a relative file name to an absolute file name.
 Uses `gud-<MINOR-MODE>-directories' to find the source files."
@@ -814,16 +831,7 @@ 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-repeat-map (car cmd) (cdr cmd))
-    (put (cdr cmd) 'repeat-map 'gud-repeat-map))
+  (gud-set-repeat-map-property gud-gdb-repeat-map)
 
   (add-hook 'completion-at-point-functions #'gud-gdb-completion-at-point
             nil 'local)
-- 
2.32.0


------=_Part_304747_1485939163.1627097577379
Content-Type: text/x-diff; charset=us-ascii; 
	name=0002-Ensure-that-gud-commands-for-non-GDB-debuggers-are-h.patch
Content-Transfer-Encoding: 7bit
Content-Description: File Attachment:
 0002-Ensure-that-gud-commands-for-non-GDB-debuggers-are-h.patch
Content-Disposition: attachment; 
	filename=0002-Ensure-that-gud-commands-for-non-GDB-debuggers-are-h.patch

From fa6428ff8995b864c8b65aa218d1085372bd3994 Mon Sep 17 00:00:00 2001
From: Brian Leung <leungbk@HIDDEN>
Date: Tue, 20 Jul 2021 00:32:34 -0700
Subject: [PATCH 2/2] Ensure that gud commands for non-GDB debuggers are
 handled by repeat-mode

* lisp/progmodes/gud.el (sdb-repeat-map): Define.
(sdb): Set repeat-mode property to the symbol corresponding to the
repeat map.
(dbx-repeat-map): Define.
(dbx): Set repeat-mode property to the symbol corresponding to the
repeat map.
(xdb-repeat-map): Define.
(xdb): Set repeat-mode property to the symbol corresponding to the
repeat map.
(perldb-repeat-map): Define.
(perldb): Set repeat-mode property to the symbol corresponding to the
repeat map.
(pdb-repeat-map): Define.
(pdb): Set repeat-mode property to the symbol corresponding to the
repeat map.
(guiler-repeat-map): Define.
(guiler): Set repeat-mode property to the symbol corresponding to the
repeat map.
(jdb-repeat-map): Define.
(jdb): Set repeat-mode property to the symbol corresponding to the
repeat map.
---
 lisp/progmodes/gud.el | 110 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 110 insertions(+)

diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 402833025f..eefaddc01b 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -1032,6 +1032,18 @@ gud-sdb-needs-tags
 
 (defvar gud-sdb-lastfile nil)
 
+(defvar sdb-repeat-map
+  (let ((map (make-sparse-keymap)))
+    (pcase-dolist (`(,key . ,cmd) '(("n" . gud-next)
+                                    ("s" . gud-step)
+                                    ("i" . gud-stepi)
+                                    ("c" . gud-cont)
+                                    ("l" . gud-refresh)))
+      (define-key map key cmd))
+    map)
+  "Keymap to repeat `sdb' stepping instructions `C-x C-a C-n n n'.
+Used in `repeat-mode'.")
+
 (defun gud-sdb-marker-filter (string)
   (setq gud-marker-acc
 	(if gud-marker-acc (concat gud-marker-acc string) string))
@@ -1102,6 +1114,8 @@ sdb
   (gud-def gud-cont   "c"    "\C-r"   "Continue with display.")
   (gud-def gud-print  "%e/"  "\C-p"   "Evaluate C expression at point.")
 
+  (gud-set-repeat-map-property sdb-repeat-map)
+
   (setq comint-prompt-regexp  "\\(^\\|\n\\)\\*")
   (setq paragraph-start comint-prompt-regexp)
   (run-hooks 'sdb-mode-hook)
@@ -1260,6 +1274,23 @@ gud-dbx-use-stopformat-p
 ;; whereby `set $stopformat=1' reportedly produces output compatible
 ;; with `gud-dbx-marker-filter', which we prefer.
 
+(defvar dbx-repeat-map
+  (let ((map (make-sparse-keymap)))
+    (pcase-dolist (`(,key . ,cmd) '(("n" . gud-next)
+                                    ("s" . gud-step)
+                                    ("i" . gud-stepi)
+                                    ("c" . gud-cont)
+                                    ("l" . gud-refresh)
+                                    ("<" . gud-up)
+                                    (">" . gud-down)))
+      (define-key map key cmd))
+    (when (or gud-mips-p
+              gud-irix-p)
+      (define-key map "f" 'gud-finish))
+    map)
+  "Keymap to repeat `dbx' stepping instructions `C-x C-a C-n n n'.
+Used in `repeat-mode'.")
+
 ;; The process filter is also somewhat
 ;; unreliable, sometimes not spotting the markers; I don't know
 ;; whether there's anything that can be done about that.]
@@ -1407,6 +1438,8 @@ dbx
   (gud-def gud-print  "print %e"  "\C-p" "Evaluate C expression at point.")
   (gud-def gud-run    "run"	     nil    "Run the program.")
 
+  (gud-set-repeat-map-property dbx-repeat-map)
+
   (setq comint-prompt-regexp  "^[^)\n]*dbx) *")
   (setq paragraph-start comint-prompt-regexp)
   (run-hooks 'dbx-mode-hook)
@@ -1418,6 +1451,21 @@ dbx
 ;; History of argument lists passed to xdb.
 (defvar gud-xdb-history nil)
 
+(defvar xdb-repeat-map
+  (let ((map (make-sparse-keymap)))
+    (pcase-dolist (`(,key . ,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 map key cmd))
+    map)
+  "Keymap to repeat `xdb' stepping instructions `C-x C-a C-n n n'.
+Used in `repeat-mode'.")
+
 (defcustom gud-xdb-directories nil
   "A list of directories that xdb should search for source code.
 If nil, only source files in the program directory
@@ -1483,6 +1531,8 @@ xdb
   (gud-def gud-finish "bu\\t"      "\C-f" "Finish executing current function.")
   (gud-def gud-print  "p %e"       "\C-p" "Evaluate C expression at point.")
 
+  (gud-set-repeat-map-property xdb-repeat-map)
+
   (setq comint-prompt-regexp  "^>")
   (setq paragraph-start comint-prompt-regexp)
   (run-hooks 'xdb-mode-hook))
@@ -1493,6 +1543,17 @@ xdb
 ;; History of argument lists passed to perldb.
 (defvar gud-perldb-history nil)
 
+(defvar perldb-repeat-map
+  (let ((map (make-sparse-keymap)))
+    (pcase-dolist (`(,key . ,cmd) '(("n" . gud-next)
+                                    ("s" . gud-step)
+                                    ("c" . gud-cont)
+                                    ("l" . gud-refresh)))
+      (define-key map key cmd))
+    map)
+  "Keymap to repeat `perldb' stepping instructions `C-x C-a C-n n n'.
+Used in `repeat-mode'.")
+
 (defun gud-perldb-massage-args (_file args)
   "Convert a command line as would be typed normally to run perldb
 into one that invokes an Emacs-enabled debugging session.
@@ -1635,6 +1696,7 @@ perldb
   (gud-def gud-print  "p %e"          "\C-p" "Evaluate perl expression at point.")
   (gud-def gud-until  "c %l"          "\C-u" "Continue to current line.")
 
+  (gud-set-repeat-map-property perldb-repeat-map)
 
   (setq comint-prompt-regexp "^  DB<+[0-9]+>+ ")
   (setq paragraph-start comint-prompt-regexp)
@@ -1663,6 +1725,20 @@ gud-pdb-marker-regexp-fnname-group
 
 (defvar gud-pdb-marker-regexp-start "^> ")
 
+(defvar pdb-repeat-map
+  (let ((map (make-sparse-keymap)))
+    (pcase-dolist (`(,key . ,cmd) '(("n" . gud-next)
+                                    ("s" . gud-step)
+                                    ("c" . gud-cont)
+                                    ("l" . gud-refresh)
+                                    ("f" . gud-finish)
+                                    ("<" . gud-up)
+                                    (">" . gud-down)))
+      (define-key map key cmd))
+    map)
+  "Keymap to repeat `pdb' stepping instructions `C-x C-a C-n n n'.
+Used in `repeat-mode'.")
+
 ;; There's no guarantee that Emacs will hand the filter the entire
 ;; marker at once; it could be broken up across several strings.  We
 ;; might even receive a big chunk with several markers in it.  If we
@@ -1752,6 +1828,8 @@ pdb
   (gud-def gud-print  "p %e"         "\C-p" "Evaluate Python expression at point.")
   (gud-def gud-statement "!%e"      "\C-e" "Execute Python statement at point.")
 
+  (gud-set-repeat-map-property pdb-repeat-map)
+
   ;; (setq comint-prompt-regexp "^(.*pdb[+]?) *")
   (setq comint-prompt-regexp "^(Pdb) *")
   (setq paragraph-start comint-prompt-regexp)
@@ -1765,6 +1843,19 @@ gud-guiler-history
 
 (defvar gud-guiler-lastfile nil)
 
+(defvar guiler-repeat-map
+  (let ((map (make-sparse-keymap)))
+    (pcase-dolist (`(,key . ,cmd) '(("n" . gud-next)
+                                    ("s" . gud-step)
+                                    ("l" . gud-refresh)
+                                    ("f" . gud-finish)
+                                    ("<" . gud-up)
+                                    (">" . gud-down)))
+      (define-key map key cmd))
+    map)
+  "Keymap to repeat `guiler' stepping instructions `C-x C-a C-n n n'.
+Used in `repeat-mode'.")
+
 (defun gud-guiler-marker-filter (string)
   (setq gud-marker-acc (if gud-marker-acc (concat gud-marker-acc string) string))
 
@@ -1830,6 +1921,8 @@ guiler
   (gud-def gud-down   ",down"         ">" "Down one stack frame.")
   (gud-def gud-print  "%e"            "\C-p" "Evaluate Guile expression at point.")
 
+  (gud-set-repeat-map-property guiler-repeat-map)
+
   (setq comint-prompt-regexp "^scheme@([^>]+> ")
   (setq paragraph-start comint-prompt-regexp)
   (run-hooks 'guiler-mode-hook))
@@ -2275,6 +2368,21 @@ gud-jdb-find-source-file
 ;; Note: Reset to this value every time a prompt is seen
 (defvar gud-jdb-lowest-stack-level 999)
 
+(defvar jdb-repeat-map
+  (let ((map (make-sparse-keymap)))
+    (pcase-dolist (`(,key . ,cmd) '(("n" . gud-next)
+                                    ("s" . gud-step)
+                                    ("i" . gud-stepi)
+                                    ("c" . gud-cont)
+                                    ("f" . gud-finish)
+                                    ("<" . gud-up)
+                                    (">" . gud-down)
+                                    ("l" . gud-refresh)))
+      (define-key map key cmd))
+    map)
+  "Keymap to repeat `jdb' stepping instructions `C-x C-a C-n n n'.
+Used in `repeat-mode'.")
+
 (defun gud-jdb-find-source-using-classpath (p)
   "Find source file corresponding to fully qualified class P.
 Convert P from jdb's output, converted to a pathname
@@ -2483,6 +2591,8 @@ jdb
   (gud-def gud-print  "print %e"  "\C-p" "Print value of expression at point.")
   (gud-def gud-pstar  "dump %e"  nil "Print all object information at point.")
 
+  (gud-set-repeat-map-property jdb-repeat-map)
+
   (setq comint-prompt-regexp "^> \\|^[^ ]+\\[[0-9]+\\] ")
   (setq paragraph-start comint-prompt-regexp)
   (run-hooks 'jdb-mode-hook)
-- 
2.32.0


------=_Part_304747_1485939163.1627097577379--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#49632; Package emacs. Full text available.

Message received at 49632 <at> debbugs.gnu.org:


Received: (at 49632) by debbugs.gnu.org; 19 Jul 2021 22:01:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 19 18:01:58 2021
Received: from localhost ([127.0.0.1]:60542 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1m5bKo-0002if-Em
	for submit <at> debbugs.gnu.org; Mon, 19 Jul 2021 18:01:58 -0400
Received: from relay2-d.mail.gandi.net ([217.70.183.194]:40901)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1m5bKn-0002iR-32
 for 49632 <at> debbugs.gnu.org; Mon, 19 Jul 2021 18:01:57 -0400
Received: (Authenticated sender: juri@HIDDEN)
 by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id DAB6540002;
 Mon, 19 Jul 2021 22:01:49 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#49632: [PATCH] Ensure that M-x gdb populates gud-repeat-map
Organization: LINKOV.NET
References: <89178870.2006793.1626665845848@HIDDEN>
 <87eebupi5k.fsf@HIDDEN> <835yx678fj.fsf@HIDDEN>
 <1533263297.2069981.1626706630967@HIDDEN>
 <831r7u70hw.fsf@HIDDEN>
Date: Tue, 20 Jul 2021 00:53:18 +0300
In-Reply-To: <831r7u70hw.fsf@HIDDEN> (Eli Zaretskii's message of "Mon, 19 Jul
 2021 19:05:15 +0300")
Message-ID: <87eebuvult.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 49632
Cc: larsi@HIDDEN, 49632 <at> debbugs.gnu.org, Brian Leung <leungbk@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>> RET can repeat only the last command (afaik). If instead I want to run, in order:
>> 
>> 1. continue
>> 2. next
>> 3. next
>> 4. stepi
>> 
>> then without this patch, I would need to press
>> 
>> 1. C-x C-a C-r
>> 2. C-x C-a C-n
>> 3. C-x C-a C-n
>> 4. C-x C-a C-i
>> 
>> if using M-x gdb.
>
> I would instead use M-p (one or more times), then RET.  Isn't it
> better, especially since it works when using GDB's own CLI prompt?
>
> Or did you mean you want to invoke these commands in the program
> source buffer, not in the GUD interaction buffer?  But in that case,
> how do I exit the repeat-mode, to be able to edit the sources?

'repeat-mode' provides several ways to exit it:

1. type a non-repeatable key (like a non-isearch key exits isearch-mode);
2. customize repeat-exit-key e.g. to RET (then RET exits like in isearch-mode);
3. customize repeat-exit-timeout to exit after a timeout.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#49632; Package emacs. Full text available.

Message received at 49632 <at> debbugs.gnu.org:


Received: (at 49632) by debbugs.gnu.org; 19 Jul 2021 16:05:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 19 12:05:34 2021
Received: from localhost ([127.0.0.1]:60056 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1m5Vlu-0002Ag-Jr
	for submit <at> debbugs.gnu.org; Mon, 19 Jul 2021 12:05:34 -0400
Received: from eggs.gnu.org ([209.51.188.92]:58644)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1m5Vls-0002AN-CP
 for 49632 <at> debbugs.gnu.org; Mon, 19 Jul 2021 12:05:32 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:47586)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1m5Vll-0007ev-5I; Mon, 19 Jul 2021 12:05:25 -0400
Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3111
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1m5Vlk-0002yl-Pv; Mon, 19 Jul 2021 12:05:25 -0400
Date: Mon, 19 Jul 2021 19:05:15 +0300
Message-Id: <831r7u70hw.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Brian Leung <leungbk@HIDDEN>
In-Reply-To: <1533263297.2069981.1626706630967@HIDDEN> (message from
 Brian Leung on Mon, 19 Jul 2021 16:57:11 +0200 (CEST))
Subject: Re: bug#49632: [PATCH] Ensure that M-x gdb populates gud-repeat-map
References: <89178870.2006793.1626665845848@HIDDEN>
 <87eebupi5k.fsf@HIDDEN> <835yx678fj.fsf@HIDDEN>
 <1533263297.2069981.1626706630967@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 49632
Cc: larsi@HIDDEN, 49632 <at> debbugs.gnu.org, juri@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Mon, 19 Jul 2021 16:57:11 +0200 (CEST)
> From: Brian Leung <leungbk@HIDDEN>
> Cc: 49632 <at> debbugs.gnu.org, juri@HIDDEN
> 
> RET can repeat only the last command (afaik). If instead I want to run, in order:
> 
> 1. continue
> 2. next
> 3. next
> 4. stepi
> 
> then without this patch, I would need to press
> 
> 1. C-x C-a C-r
> 2. C-x C-a C-n
> 3. C-x C-a C-n
> 4. C-x C-a C-i
> 
> if using M-x gdb.

I would instead use M-p (one or more times), then RET.  Isn't it
better, especially since it works when using GDB's own CLI prompt?

Or did you mean you want to invoke these commands in the program
source buffer, not in the GUD interaction buffer?  But in that case,
how do I exit the repeat-mode, to be able to edit the sources?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#49632; Package emacs. Full text available.

Message received at 49632 <at> debbugs.gnu.org:


Received: (at 49632) by debbugs.gnu.org; 19 Jul 2021 15:52:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 19 11:52:53 2021
Received: from localhost ([127.0.0.1]:59995 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1m5VZd-00081b-Ll
	for submit <at> debbugs.gnu.org; Mon, 19 Jul 2021 11:52:53 -0400
Received: from quimby.gnus.org ([95.216.78.240]:46768)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1m5VZc-00081O-8h
 for 49632 <at> debbugs.gnu.org; Mon, 19 Jul 2021 11:52:52 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=oqAm8KYa1xeEzd6YR7dO1yoz/y/YBzhYC5Y6fNhHkCc=; b=Kfrk+TneTeSDiEUu8ChJWiphYj
 YP+BM4UVDd/SEIol3PkKCS7KkaVcybQw+HI2vethWPAMMA1UbtgeR+oH6CexOonw6W9g0n7QWGEIU
 q78gEucVXAjls5VUCPVUwHFnuuQ9ERSVJyjv04thUwxUzZ5fM8kM8fKn8nHNGHdv/G90=;
Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=elva)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1m5VZU-0008TB-13; Mon, 19 Jul 2021 17:52:46 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#49632: [PATCH] Ensure that M-x gdb populates gud-repeat-map
References: <89178870.2006793.1626665845848@HIDDEN>
 <87eebupi5k.fsf@HIDDEN>
 <343742107.2068902.1626706305280@HIDDEN>
 <87k0lml3wt.fsf@HIDDEN>
X-Now-Playing: Chuck Person's _Chuck Person's Eccojams Vol. 1_: "B1"
Date: Mon, 19 Jul 2021 17:52:43 +0200
In-Reply-To: <87k0lml3wt.fsf@HIDDEN> (Juri Linkov's message of "Mon, 
 19 Jul 2021 18:37:46 +0300")
Message-ID: <874kcql2r8.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Juri Linkov <juri@HIDDEN> writes: > Exactly. But this
 means that you need to populate a new separate map > 'gdb-repeat-map' specific
 to 'gdb' commands. Also I noticed that the > current name of 'gud-repeat-map'
 is wrong. It should be [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 49632
Cc: 49632 <at> debbugs.gnu.org, Brian Leung <leungbk@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Juri Linkov <juri@HIDDEN> writes:

> Exactly.  But this means that you need to populate a new separate map
> 'gdb-repeat-map' specific to 'gdb' commands.  Also I noticed that the
> current name of 'gud-repeat-map' is wrong.  It should be renamed to
> 'gud-gdb-repeat-map'.  So other debuggers could populate own repeat-maps
> named e.g. 'sdb-repeat-map', 'jdb-repeat-map', 'perldb-repeat-map', etc.

I see.  Then Brian's patch is functionally correct, but it shouldn't be
copy-and-pasted -- instead separating it out into a helper function and
using it both places seems like the correct thing to do.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#49632; Package emacs. Full text available.

Message received at 49632 <at> debbugs.gnu.org:


Received: (at 49632) by debbugs.gnu.org; 19 Jul 2021 15:44:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 19 11:44:08 2021
Received: from localhost ([127.0.0.1]:59961 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1m5VRA-0005Zo-LB
	for submit <at> debbugs.gnu.org; Mon, 19 Jul 2021 11:44:08 -0400
Received: from relay8-d.mail.gandi.net ([217.70.183.201]:60569)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1m5VR9-0005YS-HJ
 for 49632 <at> debbugs.gnu.org; Mon, 19 Jul 2021 11:44:08 -0400
Received: (Authenticated sender: juri@HIDDEN)
 by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 0E5AC1BF204;
 Mon, 19 Jul 2021 15:43:59 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Brian Leung <leungbk@HIDDEN>
Subject: Re: bug#49632: [PATCH] Ensure that M-x gdb populates gud-repeat-map
Organization: LINKOV.NET
References: <89178870.2006793.1626665845848@HIDDEN>
 <87eebupi5k.fsf@HIDDEN>
 <343742107.2068902.1626706305280@HIDDEN>
Date: Mon, 19 Jul 2021 18:37:46 +0300
In-Reply-To: <343742107.2068902.1626706305280@HIDDEN> (Brian Leung's
 message of "Mon, 19 Jul 2021 16:51:45 +0200 (CEST)")
Message-ID: <87k0lml3wt.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 49632
Cc: Lars Ingebrigtsen <larsi@HIDDEN>, 49632 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>> But I don't quite understand why gud-repeat-map is populated in the
>> normal way -- i.e., in `gud-repeat-map' so that users can
>> redefine/override entries as usual.
>
> I think it is presently done this way because things like M-x gdb, M-x pdb,
> etc. all use their own debugger commands, so we need to re-bind exactly the
> right ones each time. For example, in M-x perldb, gud-finish, gud-up, and
> gud-down are all commented out even though gdb clearly supports
> those functions.

Exactly.  But this means that you need to populate a new separate map
'gdb-repeat-map' specific to 'gdb' commands.  Also I noticed that the
current name of 'gud-repeat-map' is wrong.  It should be renamed to
'gud-gdb-repeat-map'.  So other debuggers could populate own repeat-maps
named e.g. 'sdb-repeat-map', 'jdb-repeat-map', 'perldb-repeat-map', etc.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#49632; Package emacs. Full text available.

Message received at 49632 <at> debbugs.gnu.org:


Received: (at 49632) by debbugs.gnu.org; 19 Jul 2021 14:57:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 19 10:57:22 2021
Received: from localhost ([127.0.0.1]:59760 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1m5Uhu-00064O-2d
	for submit <at> debbugs.gnu.org; Mon, 19 Jul 2021 10:57:22 -0400
Received: from wilbur.contactoffice.com ([212.3.242.68]:47094)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <leungbk@HIDDEN>) id 1m5Uhs-00064B-Hd
 for 49632 <at> debbugs.gnu.org; Mon, 19 Jul 2021 10:57:20 -0400
Received: from ichabod.co-bxl (ichabod.co-bxl [10.2.0.36])
 by wilbur.contactoffice.com (Postfix) with ESMTP id CA59BCBC;
 Mon, 19 Jul 2021 16:57:14 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1626706634; 
 s=20210208-e7xh; d=mailfence.com; i=leungbk@HIDDEN;
 h=Date:From:Reply-To:Cc:Message-ID:In-Reply-To:References:MIME-Version:Content-Type:Content-Transfer-Encoding;
 l=1991; bh=4zQY8wpeJYLkbR59uYiXnVr5bEwUH9pmda65AF3Tnq0=;
 b=VgRK3Q84YPeBLhAczk/qPeUCkmuUlgAnL8SWdi+qQYaf1HC2O4rVnk9iH5mu3PK/
 QQNdUgvLJllACyViTRGozuvFqTC1/WB/5lq6udqv/XkYxT/hqT39QfsJDnleOjFAww4
 w+gWkDR4j/Bb5n0Fc6dqsp0fOyGYmxqe7jexhfWha3BPwLz8T1szFAxb6hT8dUBBIKQ
 ChlRKjEbayg+LBOkBBKT0qarwxZIuuhl7NuwVdnab0MqXRgqm3socp5QRXXr9Xa8TP6
 7ZBST+uWSVUPnydJIwPA2Igz+PdOFXXzCI6fDJvGeBObqDzi+FKm5IPhEqSAAaGqb34
 IoYCAI35PA==
Date: Mon, 19 Jul 2021 16:57:11 +0200 (CEST)
From: Brian Leung <leungbk@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>, Lars Ingebrigtsen <larsi@HIDDEN>
Message-ID: <1533263297.2069981.1626706630967@HIDDEN>
In-Reply-To: <835yx678fj.fsf@HIDDEN>
References: <89178870.2006793.1626665845848@HIDDEN>
 <87eebupi5k.fsf@HIDDEN> <835yx678fj.fsf@HIDDEN>
Subject: Re: bug#49632: [PATCH] Ensure that M-x gdb populates gud-repeat-map
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Priority: 3
X-Mailer: ContactOffice Mail
X-ContactOffice-Account: com:225491745
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 49632
Cc: 49632 <at> debbugs.gnu.org, juri@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Brian Leung <leungbk@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

> I admit I don't understand the rationale for the patch at all.
> "M-x gdb" already repeats these commands when you type just RET
> into the interaction buffer, so what exactly does this change
> do, and how can I see its effect?

RET can repeat only the last command (afaik). If instead I want to run, in =
order:

1. continue
2. next
3. next
4. stepi

then without this patch, I would need to press

1. C-x C-a C-r
2. C-x C-a C-n
3. C-x C-a C-n
4. C-x C-a C-i

if using M-x gdb.

With the patch, I can press:

1. C-x C-a C-r
2. n
3. n
4. i

since the new repeat-mode defines the appropriate repeat map.

> ----------------------------------------
> From: Eli Zaretskii <eliz@HIDDEN>
> Sent: Mon Jul 19 15:13:52 CEST 2021
> To: Lars Ingebrigtsen <larsi@HIDDEN>
> Cc: <leungbk@HIDDEN>, <49632 <at> debbugs.gnu.org>, <juri@HIDDEN>
> Subject: Re: bug#49632: [PATCH] Ensure that M-x gdb populates gud-repeat-=
map
>=20
>=20
> > From: Lars Ingebrigtsen <larsi@HIDDEN>
> > Date: Mon, 19 Jul 2021 15:06:31 +0200
> > Cc: 49632 <at> debbugs.gnu.org, Juri Linkov <juri@HIDDEN>
> >=20
> > Brian Leung <leungbk@HIDDEN> writes:
> >=20
> > > * lisp/progmodes/gdb-mi.el (gdb): Populate gud-repeat-map. This is
> > > copied from the gud-gdb command.
> >=20
> > Instead of copying the code, perhaps it should be separated out into it=
s
> > own function and then called from both places?
> >=20
> > But I don't quite understand why gud-repeat-map is populated in the
> > normal way -- i.e., in `gud-repeat-map' so that users can
> > redefine/override entries as usual.
>=20
> I admit I don't understand the rationale for the patch at all.
> "M-x gdb" already repeats these commands when you type just RET
> into the interaction buffer, so what exactly does this change
> do, and how can I see its effect?


--=C2=A0
Sent with https://mailfence.com
Secure and private email

--=20
Mailfence.com
Private and secure email




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#49632; Package emacs. Full text available.

Message received at 49632 <at> debbugs.gnu.org:


Received: (at 49632) by debbugs.gnu.org; 19 Jul 2021 14:51:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 19 10:51:58 2021
Received: from localhost ([127.0.0.1]:59738 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1m5Ucg-0005v4-CV
	for submit <at> debbugs.gnu.org; Mon, 19 Jul 2021 10:51:58 -0400
Received: from wilbur.contactoffice.com ([212.3.242.68]:46592)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <leungbk@HIDDEN>) id 1m5Ucd-0005up-Uf
 for 49632 <at> debbugs.gnu.org; Mon, 19 Jul 2021 10:51:57 -0400
Received: from ichabod.co-bxl (ichabod.co-bxl [10.2.0.36])
 by wilbur.contactoffice.com (Postfix) with ESMTP id 378A5AF2;
 Mon, 19 Jul 2021 16:51:49 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1626706309; 
 s=20210208-e7xh; d=mailfence.com; i=leungbk@HIDDEN;
 h=Date:From:Reply-To:Cc:Message-ID:In-Reply-To:References:MIME-Version:Content-Type:Content-Transfer-Encoding;
 l=1549; bh=q0icfcct23IH5cahT+6PW5ZDY2Ufkg62jJQBBwLKWh4=;
 b=gIX4OL3TWqZHE6esE5VtoYz44T8l5GTmwoMrInPNlu6ljjwns2Drg0b+FpGA9GQx
 FSE+YUk857QGVF7uhWMCnAFdUXqAT5lTsMSGyfXD380ShQT1n6gf8laK0qM0hHmrU7M
 PgC9zUwx/MCO+3t33l/p42C2CaP6ZJ6/gEkCtcOmI99xoEqe6UeUAC1Hsri6sUDslSY
 KG6DPPaFHOK921ccHbw03wzEbmUfE+Yl/aSOBaviB73a1WQDYY8qoxe8IlO7HErUKBk
 uxBj7eLV5Sr69KtHwj37tMv0/fFgDRhtnuu3VahyrYihqc47sHbg/Wxx8tdQzFcz/Rb
 pvu/CpB7Zg==
Date: Mon, 19 Jul 2021 16:51:45 +0200 (CEST)
From: Brian Leung <leungbk@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Message-ID: <343742107.2068902.1626706305280@HIDDEN>
In-Reply-To: <87eebupi5k.fsf@HIDDEN>
References: <89178870.2006793.1626665845848@HIDDEN>
 <87eebupi5k.fsf@HIDDEN>
Subject: Re: bug#49632: [PATCH] Ensure that M-x gdb populates gud-repeat-map
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Priority: 3
X-Mailer: ContactOffice Mail
X-ContactOffice-Account: com:225491745
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 49632
Cc: 49632 <at> debbugs.gnu.org, Juri Linkov <juri@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Brian Leung <leungbk@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

> But I don't quite understand why gud-repeat-map is populated in the
> normal way -- i.e., in `gud-repeat-map' so that users can
> redefine/override entries as usual.

I think it is presently done this way because things like M-x gdb, M-x pdb,=
 etc. all use their own debugger commands, so we need to re-bind exactly th=
e right ones each time. For example, in M-x perldb, gud-finish, gud-up, and=
 gud-down are all commented out even though gdb clearly supports those func=
tions.

> ----------------------------------------
> From: Lars Ingebrigtsen <larsi@HIDDEN>
> Sent: Mon Jul 19 15:06:31 CEST 2021
> To: Brian Leung <leungbk@HIDDEN>
> Cc: <49632 <at> debbugs.gnu.org>, Juri Linkov <juri@HIDDEN>
> Subject: Re: bug#49632: [PATCH] Ensure that M-x gdb populates gud-repeat-=
map
>=20
>=20
> Brian Leung <leungbk@HIDDEN> writes:
>=20
> > * lisp/progmodes/gdb-mi.el (gdb): Populate gud-repeat-map. This is
> > copied from the gud-gdb command.
>=20
> Instead of copying the code, perhaps it should be separated out into its
> own function and then called from both places?
>=20
> But I don't quite understand why gud-repeat-map is populated in the
> normal way -- i.e., in `gud-repeat-map' so that users can
> redefine/override entries as usual.
>=20
> Juri?
>=20
> --=20
> (domestic pets only, the antidote for overdose, milk.)
>    bloggy blog: http://lars.ingebrigtsen.no


--=C2=A0
Sent with https://mailfence.com
Secure and private email

--=20
Mailfence.com
Private and secure email




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#49632; Package emacs. Full text available.

Message received at 49632 <at> debbugs.gnu.org:


Received: (at 49632) by debbugs.gnu.org; 19 Jul 2021 13:14:28 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 19 09:14:28 2021
Received: from localhost ([127.0.0.1]:58329 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1m5T6J-0002x7-UN
	for submit <at> debbugs.gnu.org; Mon, 19 Jul 2021 09:14:28 -0400
Received: from eggs.gnu.org ([209.51.188.92]:48388)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1m5T6H-0002wr-Oe
 for 49632 <at> debbugs.gnu.org; Mon, 19 Jul 2021 09:14:26 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:40418)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1m5T6A-0001N3-OH; Mon, 19 Jul 2021 09:14:18 -0400
Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4521
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1m5T68-0006VH-9f; Mon, 19 Jul 2021 09:14:18 -0400
Date: Mon, 19 Jul 2021 16:13:52 +0300
Message-Id: <835yx678fj.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
In-Reply-To: <87eebupi5k.fsf@HIDDEN> (message from Lars Ingebrigtsen on Mon, 
 19 Jul 2021 15:06:31 +0200)
Subject: Re: bug#49632: [PATCH] Ensure that M-x gdb populates gud-repeat-map
References: <89178870.2006793.1626665845848@HIDDEN>
 <87eebupi5k.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 49632
Cc: 49632 <at> debbugs.gnu.org, leungbk@HIDDEN, juri@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Lars Ingebrigtsen <larsi@HIDDEN>
> Date: Mon, 19 Jul 2021 15:06:31 +0200
> Cc: 49632 <at> debbugs.gnu.org, Juri Linkov <juri@HIDDEN>
> 
> Brian Leung <leungbk@HIDDEN> writes:
> 
> > * lisp/progmodes/gdb-mi.el (gdb): Populate gud-repeat-map. This is
> > copied from the gud-gdb command.
> 
> Instead of copying the code, perhaps it should be separated out into its
> own function and then called from both places?
> 
> But I don't quite understand why gud-repeat-map is populated in the
> normal way -- i.e., in `gud-repeat-map' so that users can
> redefine/override entries as usual.

I admit I don't understand the rationale for the patch at all.
"M-x gdb" already repeats these commands when you type just RET
into the interaction buffer, so what exactly does this change
do, and how can I see its effect?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#49632; Package emacs. Full text available.

Message received at 49632 <at> debbugs.gnu.org:


Received: (at 49632) by debbugs.gnu.org; 19 Jul 2021 13:06:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 19 09:06:42 2021
Received: from localhost ([127.0.0.1]:58323 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1m5Syo-0002li-5H
	for submit <at> debbugs.gnu.org; Mon, 19 Jul 2021 09:06:42 -0400
Received: from quimby.gnus.org ([95.216.78.240]:44724)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1m5Sym-0002lU-IG
 for 49632 <at> debbugs.gnu.org; Mon, 19 Jul 2021 09:06:41 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=QwTgY1pmJ/nKWIK0PX1KXYQ+K0pE2ISbDHDKL7/Bv2A=; b=jELRZS+DjsqRvfcQmD1KbFDx/P
 Lz2LDsVqOCuxye26nWjVAp2kx8uR+bTCcmxQ6hTIQj+CABjIGJpPKxBwg8rjUY55eCo+OHsLDqyzl
 E3TtqjdP368Gd7kkxqHA43kq7fqldkaGpiEDl1Lg98KOUwPQm5tQmM41KHW+vpPplAd8=;
Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=elva)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1m5Sye-00071n-0h; Mon, 19 Jul 2021 15:06:34 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Brian Leung <leungbk@HIDDEN>
Subject: Re: bug#49632: [PATCH] Ensure that M-x gdb populates gud-repeat-map
References: <89178870.2006793.1626665845848@HIDDEN>
X-Now-Playing: Team Dresch's _Choices, Chances, Changes: Singles &
 Comptracks 1994-2000_: "Fake Fight"
Date: Mon, 19 Jul 2021 15:06:31 +0200
In-Reply-To: <89178870.2006793.1626665845848@HIDDEN> (Brian Leung's
 message of "Mon, 19 Jul 2021 05:37:25 +0200 (CEST)")
Message-ID: <87eebupi5k.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Brian Leung <leungbk@HIDDEN> writes: > *
 lisp/progmodes/gdb-mi.el
 (gdb): Populate gud-repeat-map. This is > copied from the gud-gdb command.
 Instead of copying the code, perhaps it should be separated out into its
 own function and then called from both places? 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 49632
Cc: 49632 <at> debbugs.gnu.org, Juri Linkov <juri@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Brian Leung <leungbk@HIDDEN> writes:

> * lisp/progmodes/gdb-mi.el (gdb): Populate gud-repeat-map. This is
> copied from the gud-gdb command.

Instead of copying the code, perhaps it should be separated out into its
own function and then called from both places?

But I don't quite understand why gud-repeat-map is populated in the
normal way -- i.e., in `gud-repeat-map' so that users can
redefine/override entries as usual.

Juri?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#49632; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 19 Jul 2021 03:37:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jul 18 23:37:38 2021
Received: from localhost ([127.0.0.1]:57774 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1m5K65-0001JY-Pr
	for submit <at> debbugs.gnu.org; Sun, 18 Jul 2021 23:37:37 -0400
Received: from lists.gnu.org ([209.51.188.17]:57024)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <leungbk@HIDDEN>) id 1m5K63-0001JR-Rh
 for submit <at> debbugs.gnu.org; Sun, 18 Jul 2021 23:37:36 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:44140)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <leungbk@HIDDEN>)
 id 1m5K63-00015D-KQ
 for bug-gnu-emacs@HIDDEN; Sun, 18 Jul 2021 23:37:35 -0400
Received: from mailout-l3b-97.contactoffice.com ([212.3.242.97]:47856)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <leungbk@HIDDEN>)
 id 1m5K61-0002eQ-4G
 for bug-gnu-emacs@HIDDEN; Sun, 18 Jul 2021 23:37:35 -0400
Received: from ichabod.co-bxl (ichabod.co-bxl [10.2.0.36])
 by mailout-l3b-97.contactoffice.com (Postfix) with ESMTP id 2B06F6E6
 for <bug-gnu-emacs@HIDDEN>; Mon, 19 Jul 2021 05:37:28 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1626665848; 
 s=20210208-e7xh; d=mailfence.com; i=leungbk@HIDDEN;
 h=Date:Message-ID:MIME-Version:Content-Type:Reply-To:From; l=1739;
 bh=ILcFHZ1xG13iFOhJDXx+j9QkmJf81rqIp2pj5rDc8Rs=;
 b=rklHZg5EWfFk4JR548vZY5I+YC9wKueHIz6nTd33awjfi2YRlHbx4qcAlAGkKlRx
 dGh5XA5ynoUMLQkq9Q8cowUkGZ9oYEWqOzZ4Gsj69C+l7HDzw0CqS73/MZUKuD/zqDj
 iGCbDqPbYgi5AR2RKue60qWFeElvW3Vc3U1eF1LGHmaJcLtijTD5MWSl0AF+4a8ep54
 XokVGizFBl0NEdMWlpcgLSYAe5jMPm0ERomJoB4Gx5L2qYN3lpU7/SEV/o1aZIHgFFU
 PNwCi7FVVgeMQx2xJ+6Coa695o2yShkMath+RVw3IMMqXwaznbSd51eZvT8Nt6Ys8fb
 mz1JZCcKEA==
Date: Mon, 19 Jul 2021 05:37:25 +0200 (CEST)
Message-ID: <89178870.2006793.1626665845848@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; 
 boundary="----=_Part_2006651_246841991.1626665725906"
To: Bug Gnu Emacs <bug-gnu-emacs@HIDDEN>
Subject: [PATCH] Ensure that M-x gdb populates gud-repeat-map
X-Priority: 3
From: Brian Leung <leungbk@HIDDEN>
X-Mailer: ContactOffice Mail
X-ContactOffice-Account: com:225491745
Received-SPF: pass client-ip=212.3.242.97; envelope-from=leungbk@HIDDEN;
 helo=mailout-l3b-97.contactoffice.com
X-Spam_score_int: -27
X-Spam_score: -2.8
X-Spam_bar: --
X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.4 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Brian Leung <leungbk@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)

------=_Part_2006651_246841991.1626665725906
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

See attached.

-- 
Mailfence.com
Private and secure email

------=_Part_2006651_246841991.1626665725906
Content-Type: text/x-diff; charset=us-ascii; 
	name=0001-Ensure-that-M-x-gdb-populates-gud-repeat-map.patch
Content-Transfer-Encoding: 7bit
Content-Description: File Attachment:
 0001-Ensure-that-M-x-gdb-populates-gud-repeat-map.patch
Content-Disposition: attachment; 
	filename=0001-Ensure-that-M-x-gdb-populates-gud-repeat-map.patch

From c288290de6185e3b23f295b32843c2fc7d4a7049 Mon Sep 17 00:00:00 2001
From: Brian Leung <leungbk@HIDDEN>
Date: Sun, 18 Jul 2021 20:14:50 -0700
Subject: [PATCH] Ensure that M-x gdb populates gud-repeat-map

* lisp/progmodes/gdb-mi.el (gdb): Populate gud-repeat-map. This is
copied from the gud-gdb command.
---
 lisp/progmodes/gdb-mi.el | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index aa3365278c..d6a2bce334 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -979,6 +979,17 @@ gdb
   (define-key gud-minor-mode-map [left-margin C-mouse-3]
     'gdb-mouse-jump)
 
+  (pcase-dolist (`(,key . ,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-repeat-map key cmd)
+    (put cmd 'repeat-map 'gud-repeat-map))
+
   (setq-local gud-gdb-completion-function 'gud-gdbmi-completions)
 
   (add-hook 'completion-at-point-functions #'gud-gdb-completion-at-point
-- 
2.32.0


------=_Part_2006651_246841991.1626665725906--




Acknowledgement sent to Brian Leung <leungbk@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#49632; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 27 Jul 2021 21:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.