]> git.donarmstrong.com Git - bin.git/blob - eval_r
add eval_r command
[bin.git] / eval_r
1 #!/bin/sh
2
3 TMP="$(mktemp -d)"
4
5 trap "rm -f '$TMP'/file; rmdir '$TMP'" EXIT
6
7 cat - > "$TMP"/file;
8
9 ( emacsclient -s R --eval "(with-temp-buffer (insert-file-contents \"$TMP/file\")
10 (setq ess-eval-visibly t)
11 (setq ess-eval-visibly-p t)
12 (setq ess-language \"R\")
13 (setq ess-dialect \"R\")
14 (ess-eval-region (point-min) (point-max) nil))" >/dev/null 2>&1 & );
15
16 trap - EXIT;
17 ( sleep 2s;
18   rm -f "$TMP/file";
19   rmdir "$TMP";
20 ) &
21
22