2
我希望能够在R的REPL上执行语句,并且可以选择将其传递到缓冲区,以便稍后快速回顾它。Emacs ESS:从R REPL输出到缓冲区的管道输出
要运行shell命令并输出到*shell command buffer*
我可以使用M-!
根据this question。 R的REPL没有使用write.csv()
会有什么效果?
我希望能够在R的REPL上执行语句,并且可以选择将其传递到缓冲区,以便稍后快速回顾它。Emacs ESS:从R REPL输出到缓冲区的管道输出
要运行shell命令并输出到*shell command buffer*
我可以使用M-!
根据this question。 R的REPL没有使用write.csv()
会有什么效果?
您可以使用ess-inf
中的ess-command
将输出重定向到另一个缓冲区。一个例子可能如下所示:
(defun redirect-ess-output (command &optional buffer process)
(interactive (list (read-from-minibuffer "Command: ")))
(let ((buff (get-buffer-create (or buffer "*r-output*")))
;; 'ess-get-process' defaults to process local to current
;; buffer, so to call from anywhere default to "R"
(proc (ess-get-process (or process "R"))))
;; send a trailing newline to process
(unless (string-match-p "\n$" command)
(setq command (concat command "\n")))
(ess-command command buff 'sleep nil nil proc)
(with-current-buffer buff
;; process stuff
(pop-to-buffer buff))))