我无法以通常的方式访问远程文件:
C-x C-f
[server]:[path][file]
并抛出此错误:
Wrong Type Argument: 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))))))))
答案 0 :(得分:1)
检查C-x C-f
绑定的命令(使用C-h k
)。它是标准绑定find-file
吗? (听起来不像。)
如果没有,请检查其interactive
规范。该命令期望接收列表作为参数,而是接收(看起来像)一个字符串。
这是interactive
的{{1}}规范:
find-file
如果您的(interactive
(find-file-read-args "Find file: " (confirm-nonexistent-file-or-buffer)))
命令的interactive
规范(如此命令)有非字符串作为其参数,那么您可以C-x C-f
,其中M-x debug-on-entry THE-FUNCTION
是函数调用参数(THE-FUNCTION
,在find-file-read-args
的情况下),或者包装该参数以便调用调试器:
find-file
无论哪种方式,调试器都将为读取文件名的交互式部分打开,您可以通过调试器查看出现了什么问题。
但是,您可以通过检查代码 - (progn (debug) (WHATEVER-WAS-THERE-BEFORE))
规范来解决问题。你的命令的参数(无论它是什么)应该是一个列表,但它是一个字符串。
我首先看一下本地文件名会发生什么。你也得到错误吗?
我注意到的另一件事是错误报告额外的interactive
,在您输入的输入前面。这应该提供一个线索。你认为阅读的内容并不是它所阅读的内容。