--- /dev/null
+#!/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";
+) &
+
+