diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index b105cbaa0e..45ba9fff07 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -293,6 +293,12 @@ gud-tool-bar-map (tool-bar-local-item-from-menu (car x) (cdr x) map gud-minor-mode-map)))) +(defvar gud-step-repeat-map + (let ((map (make-sparse-keymap))) + map) + "Keymap to repeat gud stepping instructions `C-x C-a C-n n n'. +Used in `repeat-mode'.") + (defun gud-file-name (f) "Transform a relative file name to an absolute file name. Uses `gud--directories' to find the source files." @@ -784,6 +790,17 @@ gud-gdb (gud-def gud-until "until %l" "\C-u" "Continue to current line.") (gud-def gud-run "run" nil "Run the program.") + (dolist (cmd '(("n" . gud-next) + ("s" . gud-step) + ("i" . gud-stepi) + ("c" . gud-cont) + ("l" . gud-refresh) + ("f" . gud-finish) + ("<" . gud-up) + (">" . gud-down))) + (define-key gud-step-repeat-map (car cmd) (cdr cmd)) + (put (cdr cmd) 'repeat-map 'gud-step-repeat-map)) + (add-hook 'completion-at-point-functions #'gud-gdb-completion-at-point nil 'local) (setq-local gud-gdb-completion-function 'gud-gdb-completions)