簡體   English   中英

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

[英]Emacs 24.3 for windows, Tramp byte-code: Couldn't find a proper `ls' command

24.2運行良好,但24.3 bounded tramp在打開遠程Linux系統文件或目錄時出現以下錯誤:

"byte-code: Couldn't find a proper `ls' command"

我打開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 $? 

有人知道這個嗎? 提前致謝。

合並@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") 
  2. 退出Emacs。

  3. 刪除Tramp緩存: ~/.emacs.d/tramp

  4. 啟動Emacs。

另請參閱gnu.org上的錯誤報告#14030

看來這是tramp中的一個bug,但是你不需要升級tramp,所有你需要做的就是在Windows機器上重新編譯tramp-sh.el。 有關詳細信息,請參閱此處的錯誤報告。

在暫存緩沖區中輸入:

(byte-compile-file "C:/Program Files/emacs/lisp/net/tramp-sh.el")

調整路徑以匹配您的安裝,然后鍵入Ctrl-Meta-x以重新編譯該文件。 如果它抱怨權限,您可能需要使用Windows中的“以管理員身份運行”選項重新啟動emacs。

重新編譯文件后,鍵入Mx tramp-cleanup-all-connections以重置tramp連接緩存。 這將關閉您打開的所有tramp連接。

切換到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,它將此目錄及其所有子目錄添加到load-path。 否則,請按照Tramp的INSTALL文件中的說明進行操作。
  3. 使用Cygwin bash配置和編譯文件。 我沒有正常使用Cygwin的Emacs,但在這樣的場合很方便。
  4. 為了安全起見,刪除了我的emacs / lisp / net中的舊tramp的el和elc文件。
  5. 當然重啟了Emacs。

執行Mx tramp-version以確保正確安裝。 現在tramp到處工作(dired,eshell,shell等)。

使用帶有(byte-compile-file ..) eval-expression對我來說不起作用,但是下面做了:

  1. 以管理員身份打開emacs(右鍵單擊任務欄上的emacs按鈕,右鍵單擊生成彈出窗口中的emacs圖標,單擊“以管理員身份運行”)
  2. 使用Alt-X進行編譯而不是eval-expression: Mx byte-compile-file :c:/ Program Files / emacs-24.3 / lisp / net / tramp-sh.el
  3. 在原始emacs窗口中輸入tramp-cleanup-all-connections ,然后再次嘗試打開遠程文件。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM