From def1c859b40d09e44c2b0e2bc95d0cf450ff60b4 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Sat, 18 Jan 2025 08:56:21 +1100 Subject: [emacs] eval expr in gud source and infobox value transform --- emacs/.emacs.d/lisp/my/my-prog.el | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'emacs/.emacs.d/lisp/my/my-prog.el') diff --git a/emacs/.emacs.d/lisp/my/my-prog.el b/emacs/.emacs.d/lisp/my/my-prog.el index d93c745..faf20b6 100644 --- a/emacs/.emacs.d/lisp/my/my-prog.el +++ b/emacs/.emacs.d/lisp/my/my-prog.el @@ -442,6 +442,17 @@ overlay arrow in source buffer." ;; (accept-process-output (get-buffer-process gud-comint-buffer) .1))) ;; (gud-gdb-completions-1 gud-gdb-fetched-lines))) +(defun my-gud-print-expr (expr) + (with-current-buffer gud-comint-buffer + (insert "p " expr) + (comint-send-input))) + +(defun my-gud-print-expr-region (b e) + (interactive "r") + (if (eq (gdb-get-source-buffer) (current-buffer)) + (my-gud-print-expr (buffer-substring b e)) + (error "Not in the source buffer"))) + ;;; which-func (defun my-copy-which-func () (interactive) -- cgit v1.2.3