My aim is to get the output from a process in Emacs.
For example, M-x run-python
gives me a python shell *Python*
that I can send python code to. If I send print "hello world"
to *Python*
, I hope Emacs can know the result once the execution is finished and echo it in the mini-buffer.
Is it possible to add something like a callback?
Thanks to the comments from @lawlist , I solved my problem by creating the following filter function and assigning it to the process (
*MozRepl*
in my case) with(set-process-filter (get-buffer-process "*MozRepl*") 'moz-controller-repl-filter)