emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 94586ba 2/2: * lisp/progmodes/gud.el (gud-repeat-map): New variab


From: Juri Linkov
Subject: master 94586ba 2/2: * lisp/progmodes/gud.el (gud-repeat-map): New variable (bug#47688).
Date: Wed, 14 Apr 2021 14:12:13 -0400 (EDT)

branch: master
commit 94586ba26f8a50441349bf129362afa96b4cd5fe
Author: Juri Linkov <juri@linkov.net>
Commit: Juri Linkov <juri@linkov.net>

    * lisp/progmodes/gud.el (gud-repeat-map): New variable (bug#47688).
    
    (gud-gdb): Populate gud-repeat-map with repeating keys.
---
 lisp/progmodes/gud.el | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index b105cba..a37477d 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -293,6 +293,10 @@ Used to gray out relevant toolbar icons.")
       (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'.
+Used in `repeat-mode'.")
+
 (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."
@@ -784,6 +788,17 @@ the buffer in which this command was invoked."
   (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))
+
   (add-hook 'completion-at-point-functions #'gud-gdb-completion-at-point
             nil 'local)
   (setq-local gud-gdb-completion-function 'gud-gdb-completions)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]