Marius Vollmer <[email protected]> writes: > Check out process filters: > > > http://www.gnu.org/software/emacs/manual/html_node/elisp/Output-from-Processes.html#Output-from-Processes
Yeah, I've been messing with this back and forth, along the following lines: (defun nokia-n900-send-output-keep (process output) (setq nokia-n900-send-output-kept (cons output nokia-n900-send-output-kept))) (defun testos () (start-process "n900-sms-dispatch" "*n900-sms-dispatch*" "pnatd") (setq nokia-n900-send-output-kept nil) (set-process-filter (get-process "n900-sms-dispatch") 'nokia-n900-send-output-keep) (process-send-string "n900-sms-dispatch" "at\r") (accept-process-output (get-process "n900-sms-dispatch")) (process-send-string "n900-sms-dispatch" "AT+CSCS=\"HEX\"\r") (accept-process-output (get-process "n900-sms-dispatch")) (process-send-string "n900-sms-dispatch" "AT+CSMP=17,167,0,8\r") (accept-process-output (get-process "n900-sms-dispatch")) (process-send-string "n900-sms-dispatch" "at+cmgf=1\r") (accept-process-output (get-process "n900-sms-dispatch"))) But running (testos), it doesn't even get to sending the first `at\r'. I think the reason is, as the page says: When a subprocess terminates, Emacs reads any pending output, then stops reading output from that subprocess. Therefore, if the subprocess has children that are still live and still producing output, Emacs won't receive that output. And this is the case here, when you start the pnatd process, it runs and then you're supposed to send the AT commands and wait for their output, however the process doesn't terminate, so no output is received by Emacs. How around this? -- C уважением / 宜しく御願い致します / Best regards / S pozdravem / Z poważaniem / Mit freundlichen Grüßen 白い熊 _______________________________________________ maemo-developers mailing list [email protected] https://lists.maemo.org/mailman/listinfo/maemo-developers
