Emacs 24.3 for windows,Tramp byte-code:找不到合适的`ls'命令

Car*_*age 15 windows emacs tramp

24.2运行良好,但24.3 bounded tramp在打开远程Linux系统文件或目录时出现以下错误:

"byte-code: Couldn't find a proper `ls' command"
Run Code Online (Sandbox Code Playgroud)

我打开tramp trace并发现,所有远程搜索路径和文件路径都是通过某种东西扩展,在开头添加一个额外的"c:".结果是tramp既没有找到我要打开的命令也没有找到文件.

16:04:51.768000 tramp-get-connection-property (7) # process-buffer nil
16:04:51.769000 tramp-set-file-property (8) # c:/bin file-directory-p nil 
16:04:51.770000 tramp-get-file-property (8) # c:/usr/bin file-directory-p undef 
... 
16:04:59.531000 tramp-sh-handle-file-truename (5) # Check /c: 
16:04:59.532000 tramp-get-file-property (8) # c:/c: file-attributes-integer undef 
... 
16:04:51.773000 tramp-get-connection-property (7) # process-name nil 
16:04:51.773000 tramp-get-connection-property (7) # chunksize 0 
16:04:51.773000 tramp-set-connection-property (7) # last-cmd-time (20809 28067 773000 0) 
16:04:51.774000 tramp-send-string (10) # test -d c\:/usr/bin 2>/dev/null; echo tramp_exit_status $? 
Run Code Online (Sandbox Code Playgroud)

有人知道这个吗?提前致谢.

fek*_*lee 18

合并@AlanThird答案和@uscjeremy的评论,这对我有用(2013-03-17的GNU Emacs 24.3.1(i386-mingw-nt5.1.2600),关于MARVIN,Windows XP/SP3/32) :

  1. 字节编译tramp-sh.el(相应地调整路径):

    (byte-compile-file "C:/Program Files (X86)/emacs/lisp/net/tramp-sh.el")
    
    Run Code Online (Sandbox Code Playgroud)
  2. 退出Emacs.

  3. 删除Tramp缓存: ~/.emacs.d/tramp

  4. 启动Emacs.

另请参阅gnu.org上的错误报告#14030.

  • 根据http://stackoverflow.com/questions/22381061/emacs-tramp-mode-under-windows-7-using-plink-method上的评论做"Mx tramp-cleanup-all-connections"可能会省去麻烦重新启动emacs并删除该文件. (2认同)

Ala*_*ird 6

看来这是tramp中的一个bug,但是你不需要升级tramp,所有你需要做的就是在Windows机器上重新编译tramp-sh.el.有关详细信息,请参阅此处的错误报告.

在暂存缓冲区中输入:

(byte-compile-file "C:/Program Files/emacs/lisp/net/tramp-sh.el")
Run Code Online (Sandbox Code Playgroud)

调整路径以匹配您的安装,然后键入Ctrl-Meta-x以重新编译该文件.如果它抱怨权限,您可能需要使用Windows中的"以管理员身份运行"选项重新启动emacs.

重新编译文件后,键入M-x tramp-cleanup-all-connections以重置tramp连接缓存.这将关闭您打开的所有tramp连接.

  • 在这里不起作用*(2013-03-17的GNU Emacs 24.3.1(i386-mingw-nt5.1.2600)关于MARVIN*,*Windows XP/SP3/32).*我成功编译了字符串`tramp-sh .el`,然后重新启动Emacs,仍然有错误消息:`byte-code:找不到合适的`ls'命令` (2认同)

Ale*_*iev 3

切换到 Emacs 24.3 后我遇到了同样的问题。解决方案是升级到最新的 TRAMP 2.2.7。这是我所做的:

  1. 下载http://ftp.gnu.org/gnu/tramp/tramp-2.2.7.ta​​r.gz
  2. 将存档解压到我的 ~/.emacs.d/src。我正在使用 emacs-starter-kit ,它将这个目录及其所有子目录添加到加载路径中。否则,请按照 TRAMP 的安装文件中的说明进行操作。
  3. 使用 Cygwin bash 来配置和编译文件。我通常不使用 Cygwin 的 Emacs,但在这种情况下使用它很方便。
  4. 为了安全起见,删除了我的 emacs/lisp/net 中旧流浪汉的 el 和 elc 文件。
  5. 当然重新启动了 Emacs。

执行 Mx ranp-version 以确保其安装正确。现在,tramp 可以在任何地方使用(dired、eshell、shell 等)。