Emacs 错误

发布于 2024-09-19 18:02:52 字数 1459 浏览 2 评论 0原文

当我尝试使用 Tramp 2.1.9 在另一台计算机上打开文件时,它会将我登录到计算机并显示该文件,但随后会出现在迷你缓冲区中:

File mode specification 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)
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)

而且我无法移动该文件。有人经历过这个吗?我的 .emacs 文件中唯一与流浪者相关的行是:

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

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     !^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")

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

山川志 2024-09-26 18:02:52

您的 shell 提示符似乎出现在该错误字符串中。如果远程 shell 提示符是一个问题,那么我对 trapmp 能够加载文件感到有点惊讶。但是,诊断远程 shell 提示符是否存在问题的一种简单方法是暂时移开您的 .bashrc (或 /bin/sh 所拥有的任何 shell 自定义项)加载)。

这是关于 远程 shell 设置

至于解决方案(如果提示是一个问题),我已经积累了一组返回到简单提示的条件(但我不再记得使用哪些测试来避免特定问题)。

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

(在进行任何 shell 自定义之前,我还测试了 ! -z "$PS1",但我非常确定流浪 shell 是交互式的。)

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.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文