emacs tramp over an unreliable connection

后端 未结 2 1276
忘了有多久
忘了有多久 2021-01-31 06:07

I want to run R on a remote box under a local Emacs (I do not want to run Emacs on the remote box).

I can run R on a r

2条回答
  •  孤街浪徒
    2021-01-31 06:52

    Here is an alternative approach using dtach:

    (defvar R-remote-host "remote-server")
    (defvar R-remote-session "R")
    (defvar R-remote-directory "~")
    (defun R-remote (&optional remote-host session directory)
      "Connect to the remote-host's dtach session running R."
      (interactive (list
                    (read-from-minibuffer "R remote host: " R-remote-host)
                    (read-from-minibuffer "R remote session: " R-remote-session)
                    (read-from-minibuffer "R remote directory: " R-remote-directory)))
      (pop-to-buffer (make-comint (concat "remote-" session)
                                  "ssh" nil "-t" "-t" remote-host
                                  "cd" directory ";"
                                  "dtach" "-A" (concat ".dtach-" session)
                                  "-z" "-E" "-r" "none"
                                  inferior-R-program-name "--no-readline"
                                  inferior-R-args))
      (ess-remote (process-name (get-buffer-process (current-buffer))) "R")
      (setq comint-process-echoes t))
    

    Call M-x R-remote RET RET RET RET.

    It works for me.

    PS. The answer to the problem (as opposed to the question as asked) is to use ein with Jupyter.

提交回复
热议问题