Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Macos 我该如何解决一个问题;错误类型参数:listp,";尝试使用tramp访问远程文件时出错?_Macos_Emacs_Elisp_Emacs24_Tramp - Fatal编程技术网

Macos 我该如何解决一个问题;错误类型参数:listp,";尝试使用tramp访问远程文件时出错?

Macos 我该如何解决一个问题;错误类型参数:listp,";尝试使用tramp访问远程文件时出错?,macos,emacs,elisp,emacs24,tramp,Macos,Emacs,Elisp,Emacs24,Tramp,我无法以常规方式访问远程文件: C-x C-f [server]:[path][file] 我抛出了这个错误: 错误的类型参数:listp,[[server]:[path][file] 我甚至不知道如何进一步调试它 感谢您的帮助 编辑: 尝试调试时的输出: Debugger entered: nil (progn (debug) (ido-mode t) (progn (ad-add-advice (quote completing-read) (quote (foo nil t (advi

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

C-x C-f
[server]:[path][file]

我抛出了这个错误:
错误的类型参数: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)
这是我的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-xc-f
绑定到的命令(使用
C-hk
)。它是标准绑定
find file

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

这是
查找文件的
交互式
规范:

(interactive
 (find-file-read-args "Find file: " (confirm-nonexistent-file-or-buffer)))
如果您的
C-x C-f
命令的
interactive
规范(如此)的参数为非字符串,则您可以
M-x在输入时调试-FUNCTION
,其中
函数
是为参数调用的函数(
查找文件读取参数
,在
查找文件
的情况下),或包装该参数以便调用调试器:

(progn (debug) (WHATEVER-WAS-THERE-BEFORE))
无论采用哪种方式,调试器都将打开,用于读取文件名的交互部分,您可以遍历调试器以查看出错的地方

但是,您可能只需检查代码即可解决问题--
交互式
规范。命令的参数(不管是什么)应该是一个列表,但它是一个字符串

我会先看看本地文件名会发生什么。你也会因此而出错吗


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

哎呀,很抱歉,在复制和粘贴之后,我按了enter键,然后在编辑中没有时间了……让我再试一次……您好,Drew,感谢您快速而详细的回答。C-x C-f运行命令i我启用了ido,所以一定要查找文件。我在哪里可以找到
交互式
规范?你认为呢?它内置在emacs中,但我不确定在哪里可以找到。
ido查找文件
在file
ido.el
中。它的
交互式
规范就是
(交互式)
:它不带任何参数。粗略地看一下您的调试输出,就会发现您正在使用的东西建议您完成读取(而AFAICT,Ido并没有这样做)。我建议你从那里开始:在你的代码或你加载的代码中寻找一个
defadvice
completing read
。试着从
emacs-Q
开始重现问题,也就是说,没有init文件——从你的init文件中添加你需要的内容来重新设置问题。嗨,Drew,再次感谢你花时间回复。我不需要em将ido.el作为其内置到我的emacs版本中。我的init.el包含您提到的代码,并且一直都有,因此我不确定为什么我现在才有这个问题。当我删除所有内容时,除了(需要“ido”的行)我失去了tramp功能。我想知道这是否是ido和yasnippet之间的冲突?很难相信没有Lisp源代码的Emacs。它应该随产品一起交付(毕竟这是GNU)。无论如何,如果不这样做,则很难提供帮助。如果您怀疑yasnippet,请尝试不使用它,看看这是否有帮助。尝试递归地平分init文件,将其缩小到导致问题的代码。