简体   繁体   中英

org-babel new language

I'd like to run some code through a binary via stdin and paste the output. The language is foma , is there a fast way for that or do I have to write my own definition? I've tried http://sprunge.us/DjOV , but that gives me a if: Wrong type argument: stringp, (:colname-names) .

If foma could be run an a file (rather than STDIN), then simply evaluating the following function definition should work. This will write body to a temporary file, call foma on that file and return the output (collected from STDOUT).

(defun org-babel-execute:foma (body params)
  "Execute a block of Foma code with org-babel."
  (message "executing Foma source code block")
  (org-babel-eval "foma" body))

If foma insists on taking input through STDIN, then you could replace foma above with something like foma-helper where foma-helper is a shell script holding something like

#!/bin/sh
cat $1|foma

Hope this helps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM