]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/progmodes/gud.el (gud-repeat-map): New variable (bug#47688).
authorJuri Linkov <juri@linkov.net>
Wed, 14 Apr 2021 18:11:45 +0000 (21:11 +0300)
committerJuri Linkov <juri@linkov.net>
Wed, 14 Apr 2021 18:11:45 +0000 (21:11 +0300)
(gud-gdb): Populate gud-repeat-map with repeating keys.

lisp/progmodes/gud.el

index b105cbaa0efd7f6935da2e552d909c74b05cc718..a37477dfa1e7dd0d47508f548d5a1cb94c9a1101 100644 (file)
@@ -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)