WinXP emacs上远程R的双重提示和乱码R帮助

WinXP emacs上远程R的双重提示和乱码R帮助,emacs,r,ess,Emacs,R,Ess,我已经从Vincent Goulet安装了一个用于Windows XP的,我想使用ess remote运行和编辑远程Unix服务器上包含的R脚本。经过大量搜索后,我能够通过以下方式连接到远程R会话: 使用M-x shell打开shell提示符 输入以下命令:plink-X-Cusername@server 输入密码后,我用一个简单的命令R在shell中启动R 使用命令M-x ess remote将此分配为远程进程 虽然我能够成功地与R进行交互,但我总是会得到双重提示,更糟糕的是,如果打开函数的帮

我已经从Vincent Goulet安装了一个用于Windows XP的,我想使用ess remote运行和编辑远程Unix服务器上包含的R脚本。经过大量搜索后,我能够通过以下方式连接到远程R会话:

使用M-x shell打开shell提示符 输入以下命令:plink-X-Cusername@server 输入密码后,我用一个简单的命令R在shell中启动R 使用命令M-x ess remote将此分配为远程进程 虽然我能够成功地与R进行交互,但我总是会得到双重提示,更糟糕的是,如果打开函数的帮助文件,我会在同一个R进程缓冲区中得到乱码文本,而不是用易读的R帮助文本打开新的缓冲区。如何让任何帮助缓冲区像通常的emacs和R交互一样在单独的窗口中打开,以及如何在执行shell时消除双重提示

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

c:\Documents and Settings\username>plink -X -C username@remoteserver
plink -X -C username@remoteserver
username@remoteserver's password: 

[username@remoteserver ~]$ R
R

R version 2.11.0 (2010-04-22)
Copyright (C) 2010 The R Foundation for Statistical Computing
ISBN 3-900051-07-0

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.


Welcome at Sat Jul 24 11:50:45 2010 
> 
> options(STERM='iESS')
options(STERM='iESS')
> 
> x <- c(1,2,3)
> 
> x
[1] 1 2 3
> 
> ?mean(x)
  [?1049h[?1h=[24;1H[Kmean                   package:base                    R        Documentation

Arithmetic Mean

Description:

 Generic function for the (trimmed) arithmetic mean.

Usage:

 mean(x, ...)

 ## Default S3 method:
 mean(x, trim = 0, na.rm = FALSE, ...)

Arguments:

   x: An R object.  Currently there are methods for numeric/logical
      vectors and date, date-time and time interval objects, and
      for data frames all of whose columns have a method.  Complex
      vectors are allowed for 'trim = 0', only.

trim: the fraction (0 to 0.5) of observations to be trimmed from

对于颜色代码问题,您需要在shell模式下启用ansi颜色支持:

;; Shell mode
(add-hook
 'shell-mode-hook
 (function (lambda ()
             (ansi-color-for-comint-mode-on))))
我在您的示例中没有看到双重提示,但您可以创建一个自定义shell autoexec文件来设置自定义提示:

编辑:啊,你的意思是R内的双>提示。我不知道,对不起。我会在下面留下评论,以防对某人有用

使用的程序来自变量“explicit shell file name”, 或者如果ESHELL环境变量的值为零, 或者如果“shell文件名”中的值为零。 如果存在文件“~/.emacs\u SHELLNAME”或“~/.emacs.d/init\u SHELLNAME.sh”,则会将其作为初始输入 e、 对于一个简单的非彩色提示符,g.init_bash.sh可能包含export PS1=\n\u@\h\w$


有关更多信息,请参阅C-h f shell RET。

您可能需要将此信息转到ESS列表以获取帮助。在某些情况下,可能无法解释某些shell颜色代码,而重复输出不仅仅是Windows的问题。我用Emacs 23运行Arch。我不在家,所以无法提供准确的版本。。。尽管如此,我仍然无法复制错误,但它只有在运行C-u M-x R-Vanilla之后才会发生。不幸的是,即使您建议将其添加到shell模式,每当我在远程R过程中访问帮助时,我仍然会收到乱码。我想这些毕竟不是ansi颜色代码:/抱歉,方向错误。我唯一能提出的另一个建议是看看你是否能要求R不要给它的输出上色?在手册页中搜索“颜色”
(require 'tramp)
;(setq tramp-chunksize "500")
(setq tramp-default-method "plink")

(setq exec-path
      (cons
   (expand-file-name "C:/putty_shortcut/")
        exec-path)) 
;; Shell mode
(add-hook
 'shell-mode-hook
 (function (lambda ()
             (ansi-color-for-comint-mode-on))))