From 26a89e95442abdba79454458728802ad728b54fc Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Sat, 4 Oct 2014 18:54:51 -0700 Subject: [PATCH] add eval_r command --- eval_r | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 eval_r 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"; +) & + + -- 2.39.2