macos - 尝试使用 tramp 访问远程文件时如何修复 "Wrong Type Argument: listp,"错误?

标签 macos emacs elisp emacs24 tramp

我无法以我通常的方式访问远程文件:

C-x C-f [服务器]:[路径][文件]

并抛出这个错误: 错误的类型参数:listp,[[server]:[path][file]

我什至不确定如何进一步调试它。

感谢任何帮助。

编辑:

尝试调试时的输出:

Debugger entered: nil
(progn (debug) (ido-mode t) (progn (ad-add-advice (quote completing-read) (quote (foo nil
 t  (advice lambda nil (if (boundp ...) ad-do-it (setq ad-return-value ...))))) (quote 
around) (quote nil)) (ad-activate (quote completing-read) nil) (quote completing-read)) (define-key global-map [(meta 120)] (function (lambda nil (interactive) (call-interactively
(intern (ido-completing-read "M-x " (all-completions "" obarray ...))))))))
(if (fboundp (quote ido-mode)) (progn (debug) (ido-mode t) (progn (ad-add-advice (quote
completing-read) (quote (foo nil t (advice lambda nil (if ... ad-do-it ...)))) (quote
around) (quote nil)) (ad-activate (quote completing-read) nil) (quote completing-read)) 
(define-key global-map [(meta 120)] (function (lambda nil (interactive) (call-
interactively (intern (ido-completing-read "M-x " ...))))))))
eval-buffer()  ; Reading at buffer position 16103
call-interactively(eval-buffer)
(lambda nil (interactive) (call-interactively (intern (ido-completing-read "M-x " (all-
completions "" obarray (quote commandp))))))()
call-interactively((lambda nil (interactive) (call-interactively (intern (ido-completing- 
read "M-x " (all-completions "" obarray (quote commandp)))))) nil nil)

recursive-edit()
debug(debug)
implement-debug-on-entry()
*  ido-find-file()
call-interactively(ido-find-file nil nil)

这来 self 的 init.el:

(require 'ido)
(if (fboundp 'ido-mode)
(progn
  (debug)
  (ido-mode t)
  (defadvice completing-read
    (around foo activate)
    (if (boundp 'ido-cur-list)
        ad-do-it
      (setq ad-return-value
            (ido-completing-read
             prompt
             (all-completions "" collection predicate)
             nil require-match initial-input hist def))))
  (define-key global-map [(meta ?x)]
    (lambda ()
      (interactive)
      (call-interactively
       (intern
        (ido-completing-read "M-x " (all-completions "" obarray 'commandp))))))))

最佳答案

检查 C-x C-f 绑定(bind)到什么命令(使用 C-h k)。它是标准绑定(bind) find-file 吗? (听起来不像。)

如果不是,请检查其interactive 规范。该命令期望接收一个列表作为参数,但它却接收(看起来像)一个字符串。

这是 find-fileinteractive 规范:

(interactive
 (find-file-read-args "Find file: " (confirm-nonexistent-file-or-buffer)))

如果你的 C-x C-f 命令的 interactive 规范,像这个一样,有一个非字符串作为它的参数,那么你可以 M-x debug- on-entry THE-FUNCTION,其中 THE-FUNCTION 是为参数调用的函数(find-file-read-args,在 find-file),或者包装该参数以便调用调试器:

(progn (debug) (WHATEVER-WAS-THERE-BEFORE))

无论哪种方式,调试器都会打开读取文件名的交互部分,您可以浏览调试器以查看出现了什么问题。

但您可能仅通过检查代码 -- interactive 规范就可以找出问题所在。命令的参数(无论它是什么)应该是一个列表,但它是一个字符串。

我会先看看本地文件名会发生什么。你也会收到错误吗?

我注意到的另一件事是错误报告了一个额外的 [,在您所说的输入内容之前。这也应该提供线索。你认为它在读的不是它读过的。

关于macos - 尝试使用 tramp 访问远程文件时如何修复 "Wrong Type Argument: listp,"错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20647107/

相关文章:

cocoa - 在 Cocoa 中创建信息弹出窗口/工具提示

ios - StringBetweenString 函数

eclipse - 如何为 Eclipse 中的菜单项分配热键?

svn - 如何使用 Emacs 23.1 内置集成设置 SVN 密码?

shell - 如何将在 emacs *shell* 缓冲区内运行的进程更改为后台

emacs - Emacs 中的原始缩进

emacs - 如何获取 elisp 时间指定的月份中的天数?

function - 在 eLisp 的函数中设置变量

c++ - 从 Mac OS X 上的堆栈溢出中恢复

emacs - 如何在 Emacs 中创建类似于 *compilation* 的缓冲区?