开发者

Emacs tramp errors

开发者 https://www.devze.com 2023-01-16 13:17 出处:网络
When I try to open a file on another machine using tramp 2.1.9, it logs me into the machine and shows the file, but then this appears in the minibuffer:

When I try to open a file on another machine using tramp 2.1.9, it logs me into the machine and shows the file, but then this appears in the minibuffer:

File mode specification error: (wrong-number-of-arguments #[(filename) "\306^H!\205!^@\307^H!^Y\310  开发者_JAVA技巧   !^Z\311 !^[\312 !^\\313 !^]\314
^K^L\315$-\207" [filename v method user host localname tramp-tramp-file-p tramp-dissect-file-name tramp-file-name-method tramp-file-name-user tramp-file-name-host tramp-file-name-localname tramp-make-tramp-file-name ""] 5 ("/usr/local/share/emacs/s\
ite-lisp/tramp.elc" . 133124)] 3)
Directory-local variables error: (wrong-number-of-arguments #[(filename) "\306^H!\205!^@\307^H!^Y\310   !^Z\311 !^[\312 !^\\313 !^]\314
^K^L\315$-\207" [filename v method user host localname tramp-tramp-file-p tramp-dissect-file-name tramp-file-name-method tramp-file-name-user tramp-file-name-host tramp-file-name-localname tramp-make-tramp-file-name ""] 5 ("/usr/local/share/emacs/s\
ite-lisp/tramp.elc" . 133124)] 3)
Error: (wrong-number-of-arguments #[(filename) \306^H!\205!^@\307^H!^Y\310      !^Z\311 !^[\312 !^\\313 !^]\314
^K^L\315$-\207 [filename v method user host localname tramp-tramp-file-p tramp-dissect-file-name tramp-file-name-method tramp-file-name-user tramp-file-name-host tramp-file-name-localname tramp-make-tramp-file-name ] 5 (/usr/local/share/emacs/site-\
lisp/tramp.elc . 133124)] 3)

And I can't move around the file. Anyone experienced this? The only tramp-related lines in my .emacs file are:

(require 'tramp)
(setq tramp-default-method "ssh")


It looks like your shell prompt is appearing in that error string. If the remote shell prompt is an issue, I'm a little surprised that tramp gets as far as loading the file. But, one easy way to diagnose whether the remote shell prompt is an issue is to temporarily move aside your .bashrc (or whatever shell customizations you have that /bin/sh would load).

Here's the tramp manual on remote shell setup.

As for a solution (if the prompt is an issue), I have accumulated a set of conditions for falling back to a simple prompt (but I no longer recall which tests are used to avoid particular issues).

if [ "$TERM" == "vt100" -o "$TERM" == "dumb" -o "$EMACS" == "t" ]; then
    export PS1="\h [\W]> "
else 
    ...set fancy prompt here...
fi

(I also test for ! -z "$PS1" before doing any shell customizations, but I'm pretty sure the tramp shell is interactive.)

0

精彩评论

暂无评论...
验证码 换一张
取 消