如何修复“错误类型参数:listp”,尝试使用流浪汉访问远程文件时出错? [英] How do I fix a "Wrong Type Argument: listp," error when trying to access remote file using tramp?

查看:304
本文介绍了如何修复“错误类型参数:listp”,尝试使用流浪汉访问远程文件时出错?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am unable to access remote files in my usual way:

Cx Cf
[server]:[path]文件]

并抛出此错误:
错误类型参数:listp,[[server] :[路径] [文件]

我甚至不知道如何进一步调试。

I'm not even sure how to debug this further.

任何帮助都不胜感激。

编辑:

尝试调试输出时: / p>

output when trying to debug:

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)

这是从我的init.el:

And this from my 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))))))))


推荐答案

检查什么命令 Cx Cf 被绑定(使用 Ch k )。是否是标准绑定 find-file ? (这听起来不像。)

Check what command C-x C-f is bound to (use C-h k). Is it the standard binding find-file? (It doesn't sound like it.)

如果没有,请检查其交互式规格。该命令期待收到列表作为参数,而是接收(看起来像)一个字符串。

If not, check its interactive spec. The command is expecting to receive a list as argument, and it is instead receiving (what looks like) a string.

这是交互式 spec of find-file

This is the interactive spec of find-file:

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

如果您的 Cx Cf 命令的交互式有一个非字符串作为其参数,那么你可以 Mx调试输入THE-FUNCTION ,其中 THE-FUNCTION 是调用参数的函数( find-file-read-args ,在 find-file )或包装该参数以调用调试器:

If the interactive spec of your C-x C-f command, like this one, has a non-string as its argument, then you can either M-x debug-on-entry THE-FUNCTION, where THE-FUNCTION is the function called for the argument (find-file-read-args, in the case of find-file), or wrap that argument so that the debugger is invoked:

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

无论哪种方式,调试器将打开阅读文件名的交互式部分,您可以通过调试器查看出现什么问题。

Either way, the debugger will open for the interactive part of reading the file name, and you can walk through the debugger to see what goes wrong.

但是,您可以通过检查代码 - 交互式规范来解决问题。您的命令的参数(无论是什么)预计将是一个列表,但它是一个字符串。

But probably you can figure out the problem just by inspecting the code -- the interactive spec. The argument to your command (whatever it is) is expected to be a list, but it is a string.

我将首先看看本地文件名称会发生​​什么。你也收到一个错误?

I would start by seeing what happens with a local file name. Do you get an error for that too?

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

Another thing I notice is that the error reports an extra [, in front of what you say you typed as input. That should provide a clue too. What you think it is reading is not what it has read.

这篇关于如何修复“错误类型参数:listp”,尝试使用流浪汉访问远程文件时出错?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆