Skip to content

Commit d71e328

Browse files
committed
Add sanitation to inf-clojure-send-string
The function did not have sanitation and therefore it has been added. Some more logging has been added so that .inf-clojure.log can show every interaction.
1 parent 51cc813 commit d71e328

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

inf-clojure.el

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,10 @@ always be preferred over `comint-send-string`. It delegates to
334334
the string for evaluation. Refer to `comint-simple-send` for
335335
customizations."
336336
(inf-clojure--set-repl-type proc)
337-
(comint-simple-send proc string))
337+
(let ((sanitized (inf-clojure--sanitize-command string)))
338+
(when (not (string-empty-p sanitized))
339+
(inf-clojure--log-string sanitized "----CMD->")
340+
(comint-simple-send proc sanitized))))
338341

339342
(defcustom inf-clojure-load-form "(clojure.core/load-file \"%s\")"
340343
"Format-string for building a Clojure expression to load a file.
@@ -555,6 +558,7 @@ to continue it."
555558

556559
(defun inf-clojure-preoutput-filter (str)
557560
"Preprocess the output STR from interactive commands."
561+
(inf-clojure--log-string str "<-RES----")
558562
(cond
559563
((string-prefix-p "inf-clojure-" (symbol-name (or this-command last-command)))
560564
;; Remove subprompts and prepend a newline to the output string
@@ -1173,7 +1177,7 @@ STRING if present."
11731177
(concat tag "\n")
11741178
(concat (prin1-to-string tag) "\n")))
11751179
(let ((print-escape-newlines t))
1176-
(prin1-to-string string)))
1180+
(prin1-to-string (substring-no-properties string))))
11771181
nil
11781182
(expand-file-name inf-clojure--log-file-name
11791183
(inf-clojure-project-root))

0 commit comments

Comments
 (0)