From: Don Armstrong Date: Sun, 5 Oct 2014 01:54:51 +0000 (-0700) Subject: add eval_r command X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=26a89e95442abdba79454458728802ad728b54fc;p=bin.git add eval_r command --- diff --git a/eval_r b/eval_r new file mode 100755 index 0000000..ef0ad73 --- /dev/null +++ b/eval_r @@ -0,0 +1,22 @@ +#!/bin/sh + +TMP="$(mktemp -d)" + +trap "rm -f '$TMP'/file; rmdir '$TMP'" EXIT + +cat - > "$TMP"/file; + +( emacsclient -s R --eval "(with-temp-buffer (insert-file-contents \"$TMP/file\") +(setq ess-eval-visibly t) +(setq ess-eval-visibly-p t) +(setq ess-language \"R\") +(setq ess-dialect \"R\") +(ess-eval-region (point-min) (point-max) nil))" >/dev/null 2>&1 & ); + +trap - EXIT; +( sleep 2s; + rm -f "$TMP/file"; + rmdir "$TMP"; +) & + +