branch: elpa/inf-clojure commit f420c8a4d27c7c2dfea2ebee230d4d1b632a4e3f Author: Andrea Richiardi <a.richiardi.w...@gmail.com> Commit: Bozhidar Batsov <bozhidar.bat...@gmail.com>
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. --- inf-clojure.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/inf-clojure.el b/inf-clojure.el index 61f7d73..c44694b 100644 --- a/inf-clojure.el +++ b/inf-clojure.el @@ -338,7 +338,10 @@ always be preferred over `comint-send-string`. It delegates to the string for evaluation. Refer to `comint-simple-send` for customizations." (inf-clojure--set-repl-type proc) - (comint-simple-send proc string)) + (let ((sanitized (inf-clojure--sanitize-command string))) + (when (not (string-empty-p sanitized)) + (inf-clojure--log-string sanitized "----CMD->") + (comint-simple-send proc sanitized)))) (defcustom inf-clojure-load-form "(clojure.core/load-file \"%s\")" "Format-string for building a Clojure expression to load a file. @@ -559,6 +562,7 @@ to continue it." (defun inf-clojure-preoutput-filter (str) "Preprocess the output STR from interactive commands." + (inf-clojure--log-string str "<-RES----") (cond ((string-prefix-p "inf-clojure-" (symbol-name (or this-command last-command))) ;; Remove subprompts and prepend a newline to the output string @@ -1177,7 +1181,7 @@ STRING if present." (concat tag "\n") (concat (prin1-to-string tag) "\n"))) (let ((print-escape-newlines t)) - (prin1-to-string string))) + (prin1-to-string (substring-no-properties string)))) nil (expand-file-name inf-clojure--log-file-name (inf-clojure-project-root))