I’m trying to write emacs tools that require sending data to an external process, my example is a REPL as part of an inferior-lisp.
How do you get the output of the process to be returned as if it were an emacs function?
I would like something like:
(defun get-data ()
(process-send-string (get-process) "foo command")
(get-data-output-from-process (get-process)))
I’ve tried using process-send-string and accept-process-output-proc but the output always gets sent to the inferior-lisp. I would like something to return data to the function that was called so I can manipulate the data. Also if possible I would like to not copy the output to the inferior-lisp buffer.
The only way I could get this to work was to store the results in a global, then pass it back in the function.