(with-current-buffer (get-buffer-create "*test buffer*") (let* ((oldproc (get-buffer-process (current-buffer)))) (when oldproc (kill-process oldproc) (accept-process-output oldproc))) (erase-buffer) (display-buffer (current-buffer)) (let* ((print-level nil) (print-length nil) (proc (start-process "test proc" (current-buffer) (concat invocation-directory invocation-name) "-Q" "--batch" "--eval" (prin1-to-string '(let (s) (while (setq s (read-from-minibuffer "$ ")) (princ s) (princ "\n"))))))) (send-string proc "one\n") (sit-for 0.5) ; Read "one". (set-process-filter proc t) ; Stop reading from proc. (send-string proc "two\n") (sit-for 1) ; Can't read "two" yet. (set-process-filter proc ; Resume reading from proc. #'internal-default-process-filter) (sit-for 0.5) ; Read "two" from proc. ))