emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/forth-mode 44dd013096 059/153: Remove terminal escape sequ


From: ELPA Syncer
Subject: [nongnu] elpa/forth-mode 44dd013096 059/153: Remove terminal escape sequences from strings returned from Forth.
Date: Sat, 29 Jan 2022 08:02:16 -0500 (EST)

branch: elpa/forth-mode
commit 44dd0130963117b5e0388889a6cdd4a24db95679
Author: Lars Brinkhoff <lars@nocrew.org>
Commit: Lars Brinkhoff <lars@nocrew.org>

    Remove terminal escape sequences from strings returned from Forth.
---
 forth-interaction-mode.el | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/forth-interaction-mode.el b/forth-interaction-mode.el
index fad4ca04ab..0852900530 100644
--- a/forth-interaction-mode.el
+++ b/forth-interaction-mode.el
@@ -69,6 +69,14 @@
     (run-forth))
   (get-buffer-process forth-interaction-buffer))
 
+(defun forth-scrub (string)
+  "Remove terminal escape sequences from STRING."
+  (let ((n 0))
+    (while (setq n (string-match "[?[0-9;]*[a-z]" string n))
+      (message "n = %d" n)
+      (setq string (replace-match "" t t string))))
+  string)
+
 ;;;###autoload
 (defun forth-interaction-send (&rest strings)
   (let* ((proc (forth-ensure))
@@ -83,7 +91,7 @@
     (while (< (float-time) end-time)
       (accept-process-output proc 0.1))
     (setq forth-words-cache nil)
-    forth-result))
+    (forth-scrub forth-result)))
 
 ;;;###autoload
 (defun forth-words ()



reply via email to

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