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))))