New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Figure out how to handle subprompts #7
Comments
I've been doing it like this: (defcustom inf-clojure-subprompt " *#_=> *"
"Regexp to recognize subprompts in the Inferior Clojure mode."
:type 'regexp
:group 'inf-clojure)
(defun inf-clojure-remove-subprompts (txt)
(replace-regexp-in-string inf-clojure-subprompt "" txt))
(add-hook 'comint-preoutput-filter-functions #'inf-clojure-remove-subprompts) Seems to work very well. Haven't had any problems with it. I tried converting multi-line strings to a single line by removing the newlines but then expressions like below will end up being evaluated incorrectly. (def some-string "this
is
a
multi-line
string") |
Looks reasonable. Guess you can convert this to a PR. :-) |
Damn, you're fast :) I'll create a PR as soon as I can. Have to head out for a while. |
Do you want to me to keep it as a separate filter or add it to the current filter? (defun inf-clojure-preoutput-filter (str)
"Preprocess the output STR from interactive commands."
(cond
((string-prefix-p "inf-clojure-" (symbol-name (or this-command last-command)))
;; prepend a newline to the output string
(inf-clojure-chomp (concat "\n" str)))
(t str))) |
Using the same filter is fine. |
When you pass a multi-line command to the REPL the output gets littered with
#_>
subprompts. Some possible ways to handle this include converting all REPL input to a single line before sending it to the REPL or adding to code to filter out the REPL subprompts.The text was updated successfully, but these errors were encountered: