[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/realgud 2295d94 024/140: making eval print to the messa
From: |
Rocky Bernstein |
Subject: |
[elpa] externals/realgud 2295d94 024/140: making eval print to the message area |
Date: |
Sat, 25 May 2019 19:35:24 -0400 (EDT) |
branch: externals/realgud
commit 2295d94aa09e8be7e2e0e6985aa23fa531f73d60
Author: Jacob O'Donnell <address@hidden>
Commit: Jacob O'Donnell <address@hidden>
making eval print to the message area
---
realgud/common/track.el | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/realgud/common/track.el b/realgud/common/track.el
index f75efe9..c8a5d9a 100644
--- a/realgud/common/track.el
+++ b/realgud/common/track.el
@@ -168,6 +168,23 @@ message."
"Buffer %s is not a debugger command buffer" buf)
t))
+(defun realgud:get-output-command(text)
+ "Splits the TEXT by newline."
+ (car (split-string text "\n")))
+
+(defun realgud:get-eval-output(text)
+ "Gets the output stripping the command and debugger prompt from the TEXT."
+ (string-join (butlast (cdr (split-string text "\n"))) "\n"))
+
+(defun realgud:eval-command-p(text)
+ "Checks the TEXT if the command that was ran was an eval command."
+ (let ((eval-string (buffer-local-value 'realgud-eval-string
(current-buffer))))
+ (string-prefix-p eval-string (realgud:get-output-command text))))
+
+(defun realgud:message-eval-results(text)
+ "Output the TEXT to the message area."
+ (message (realgud:get-eval-output text)))
+
(defun realgud:track-from-region(from to &optional cmd-mark opt-cmdbuf
shortkey-on-tracing? no-warn-if-no-match?)
"Find and position a buffer at the location found in the marked region.
@@ -193,6 +210,9 @@ evaluating (realgud-cmdbuf-info-loc-regexp
realgud-cmdbuf-info)"
(cmdbuf (or opt-cmdbuf (current-buffer)))
)
(unless (realgud:track-complain-if-not-in-cmd-buffer cmdbuf t)
+ (if (realgud:eval-command-p text)
+ (realgud:message-eval-results text))
+
(if (not (equal "" text))
(with-current-buffer cmdbuf
(if (realgud-sget 'cmdbuf-info 'divert-output?)
@@ -740,6 +760,10 @@ find a location. non-nil if we can find a location.
nil))
))
)
+(defun realgud-set-eval-string-to-buffer-local (command-hash)
+ "Sets the eval string as a buffer local variable from the COMMAND-HASH."
+ (set (make-local-variable 'realgud-eval-string)
+ (replace-regexp-in-string "%s" "" (or (gethash "eval" command-hash) "No
Eval String"))))
(defun realgud:track-set-debugger (debugger-name)
"Set debugger name and information associated with that
@@ -761,6 +785,9 @@ we can't find a debugger with that information.`.
(setq regexp-hash (gethash base-variable-name realgud-pat-hash))
(setq command-hash (gethash base-variable-name realgud-command-hash))
)
+
+ (realgud-set-eval-string-to-buffer-local command-hash)
+
(if regexp-hash
(let* (
(mode-name (concat " " (capitalize base-variable-name) "-Track"))
- [elpa] externals/realgud 7c0d2c4 007/140: fixed unload; added ert-based tests for realgud, (continued)
- [elpa] externals/realgud 7c0d2c4 007/140: fixed unload; added ert-based tests for realgud, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 0647be7 015/140: Spelling typos, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 8beb4f5 009/140: Merge pull request #182 from roymath/master, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 211c01a 014/140: Fix misfeatures in install-from-git.sh..., Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 3f1b98f 010/140: (realgud:load-features) now features loaded, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 50dc7db 022/140: Info ..., Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud c7594f0 032/140: wrong 'let' syntax - caught thanks to the jodonnell's test!, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 37ba671 037/140: Comment better a track test, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud eeb4c2f 013/140: Bug in last commit., Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 811e7b9 036/140: < -> <=. See comment before, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 2295d94 024/140: making eval print to the message area,
Rocky Bernstein <=
- [elpa] externals/realgud 83d471f 008/140: return the set of features removed, in realgud:unload-features(), Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud f41b7a7 017/140: When a breakpoint is seen, add source..., Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 1f59502 021/140: Merge pull request #192 from dvzubarev/master, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud da2f39d 011/140: Improve Debugger Info org-mode buffer, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud ecc78f1 012/140: Fix up breakpoint display, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 4a7f6ef 019/140: Fix infinite loop in realgud:backtrace-init, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 081f7ed 018/140: Expand script path where appropriate, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 1180d9f 028/140: add eval at point and bind it to E in shortkey mode, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud f20f1e3 043/140: change E to put the thing at point in the eval buffer, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud e47abfb 044/140: Merge pull request #197 from jodonnell/eval-command, Rocky Bernstein, 2019/05/25