3

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

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

and am thrown this error: Wrong Type Argument: listp, [[server]:[path][file]

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

any help is appreciated.

edit:

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)

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

1 回答 1

1

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

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

这是interactive规格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-FUNCTIONTHE-FUNCTION为参数调用的函数在哪里(find-file-read-args在 的情况下find-file),或者包装该参数,以便调试器是调用:

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

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

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

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

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

于 2013-12-18T01:07:28.927 回答