标题听起来几乎与问题here完全相同。它似乎没有得到解决,我也无法发表评论,从而打开了这个问题。
我在Mac OS X Mavericks上使用MacPorts安装emacs 24.3.1。直到最近,我一直在使用tramp访问远程文件而没有问题。我曾经没有我的用户名ssh访问文件,它工作正常。当它停止工作时,我注意到错误"错误的类型参数:listp,/ home / t_nithyanandan / .bashrc"这个问题不是特定于.bashrc。它适用于任何文件。随后我开始将我的用户名放在远程计算机名称前面的ssh行中,它已经工作了一段时间,直到它也因为同样的错误而崩溃。现在我根本无法使用流浪汉。
我可以在本地计算机上打开文件,而无需使用C-x C-f。我使用macport重新安装了emacs,但它没有改变任何东西。我从here安装了emacs,但在使用tramp时遇到了同样的问题。
我在启动前禁用了我的.emacs,但这也没有帮助。
完成后
M-x load-library RET tramp.el RET
C-u 1 M-x toggle-debug-on-error RET
这里是* Messages *:
中的输出Loading /opt/local/share/emacs/site-lisp/subdirs.el (source)...done
For information about GNU Emacs and the GNU system, type C-h C-a.
Making completion list...
Loading /Applications/MacPorts/Emacs.app/Contents/Resources/lisp/net/tramp.el.gz...
uncompressing tramp.el.gz...done
Loading /Applications/MacPorts/Emacs.app/Contents/Resources/lisp/net/tramp.el.gz...done
Debug on Error enabled globally
Quit
Tramp: Opening connection for enterprise.sese.asu.edu using ssh...
Tramp: Sending command `exec ssh -e none enterprise.sese.asu.edu'
Tramp: Waiting for prompts from remote shell
Tramp: Sending password
Tramp: Sending command `exec ssh -e none enterprise.sese.asu.edu'
Tramp: Found remote shell prompt on `enterprise.sese.asu.edu'
Tramp: Opening connection for enterprise.sese.asu.edu using ssh...done
Entering debugger...
Tramp: Opening connection for enterprise.sese.asu.edu using ssh...
Tramp: Sending command `exec ssh -e none enterprise.sese.asu.edu'
Tramp: Waiting for prompts from remote shell
Tramp: Sending password
Tramp: Sending command `exec ssh -e none enterprise.sese.asu.edu'
Tramp: Found remote shell prompt on `enterprise.sese.asu.edu'
Tramp: Opening connection for enterprise.sese.asu.edu using ssh...done
tramp-sh-handle-file-attributes: Wrong type argument: listp, /home/t_nithyanandan/\.bashrc
这里是* Backtrace *的输出:
Debugger entered--Lisp error: (wrong-type-argument listp /home/t_nithyanandan/\.bashrc)
tramp-convert-file-attributes(["ssh" nil "enterprise.sese.asu.edu" "/home/t_nithyanandan/.bashrc" nil] /home/t_nithyanandan/\.bashrc)
tramp-sh-handle-file-attributes("/ssh:enterprise.sese.asu.edu:/home/t_nithyanandan/.bashrc")
apply(tramp-sh-handle-file-attributes "/ssh:enterprise.sese.asu.edu:/home/t_nithyanandan/.bashrc")
tramp-sh-file-name-handler(file-attributes "/ssh:enterprise.sese.asu.edu:/home/t_nithyanandan/.bashrc")
apply(tramp-sh-file-name-handler file-attributes "/ssh:enterprise.sese.asu.edu:/home/t_nithyanandan/.bashrc")
(catch (quote suppress) (apply foreign operation args))
(catch (quote non-essential) (catch (quote suppress) (apply foreign operation args)))
(setq result (catch (quote non-essential) (catch (quote suppress) (apply foreign operation args))))
(let ((sf (symbol-function foreign)) result) (if (and (listp sf) (eq (car sf) (quote autoload))) (progn (let ((default-directory (tramp-compat-temporary-file-directory))) (load (cadr sf) (quote noerror) (quote nomessage))))) (setq result (catch (quote non-essential) (catch (quote suppress) (apply foreign operation args)))) (cond ((eq result (quote non-essential)) (tramp-message v 5 "Non-essential received in operation %s" (append (list operation) args)) (tramp-run-real-handler operation args)) ((eq result (quote suppress)) (let (tramp-message-show-message) (tramp-message v 1 "Suppress received in operation %s" (append (list operation) args)) (tramp-cleanup v) (tramp-run-real-handler operation args))) (t result)))
(lambda nil (let ((sf (symbol-function foreign)) result) (if (and (listp sf) (eq (car sf) (quote autoload))) (progn (let ((default-directory (tramp-compat-temporary-file-directory))) (load (cadr sf) (quote noerror) (quote nomessage))))) (setq result (catch (quote non-essential) (catch (quote suppress) (apply foreign operation args)))) (cond ((eq result (quote non-essential)) (tramp-message v 5 "Non-essential received in operation %s" (append (list operation) args)) (tramp-run-real-handler operation args)) ((eq result (quote suppress)) (let (tramp-message-show-message) (tramp-message v 1 "Suppress received in operation %s" (append (list operation) args)) (tramp-cleanup v) (tramp-run-real-handler operation args))) (t result))))()
funcall((lambda nil (let ((sf (symbol-function foreign)) result) (if (and (listp sf) (eq (car sf) (quote autoload))) (progn (let ((default-directory (tramp-compat-temporary-file-directory))) (load (cadr sf) (quote noerror) (quote nomessage))))) (setq result (catch (quote non-essential) (catch (quote suppress) (apply foreign operation args)))) (cond ((eq result (quote non-essential)) (tramp-message v 5 "Non-essential received in operation %s" (append (list operation) args)) (tramp-run-real-handler operation args)) ((eq result (quote suppress)) (let (tramp-message-show-message) (tramp-message v 1 "Suppress received in operation %s" (append (list operation) args)) (tramp-cleanup v) (tramp-run-real-handler operation args))) (t result)))))
(if debug-on-error (funcall body) (condition-case err (funcall body) ((debug quit) (let (tramp-message-show-message) (tramp-message v 1 "Interrupt received in operation %s" (append (list operation) args))) (signal (car err) (cdr err))) (error (cond ((and completion (zerop (length localname)) (memq operation (quote ...))) t) ((and completion (zerop (length localname)) (memq operation (quote ...))) filename) (t (signal (car err) (cdr err)))))))
(let ((body (function (lambda nil (let ((sf ...) result) (if (and ... ...) (progn ...)) (setq result (catch ... ...)) (cond (... ... ...) (... ...) (t result))))))) (if debug-on-error (funcall body) (condition-case err (funcall body) ((debug quit) (let (tramp-message-show-message) (tramp-message v 1 "Interrupt received in operation %s" (append (list operation) args))) (signal (car err) (cdr err))) (error (cond ((and completion (zerop ...) (memq operation ...)) t) ((and completion (zerop ...) (memq operation ...)) filename) (t (signal (car err) (cdr err))))))))
(if foreign (let ((body (function (lambda nil (let (... result) (if ... ...) (setq result ...) (cond ... ... ...)))))) (if debug-on-error (funcall body) (condition-case err (funcall body) ((debug quit) (let (tramp-message-show-message) (tramp-message v 1 "Interrupt received in operation %s" (append ... args))) (signal (car err) (cdr err))) (error (cond ((and completion ... ...) t) ((and completion ... ...) filename) (t (signal ... ...))))))) (tramp-run-real-handler operation args))
(let* ((v (tramp-dissect-file-name filename)) (method (tramp-file-name-method v)) (user (tramp-file-name-user v)) (host (tramp-file-name-host v)) (localname (tramp-file-name-localname v)) (hop (tramp-file-name-hop v))) (if foreign (let ((body (function (lambda nil (let ... ... ... ...))))) (if debug-on-error (funcall body) (condition-case err (funcall body) ((debug quit) (let (tramp-message-show-message) (tramp-message v 1 "Interrupt received in operation %s" ...)) (signal (car err) (cdr err))) (error (cond (... t) (... filename) (t ...)))))) (tramp-run-real-handler operation args)))
(let* ((filename (tramp-replace-environment-variables (apply (quote tramp-file-name-for-operation) operation args))) (completion (tramp-completion-mode-p)) (foreign (tramp-find-foreign-file-name-handler filename))) (let* ((v (tramp-dissect-file-name filename)) (method (tramp-file-name-method v)) (user (tramp-file-name-user v)) (host (tramp-file-name-host v)) (localname (tramp-file-name-localname v)) (hop (tramp-file-name-hop v))) (if foreign (let ((body (function (lambda nil ...)))) (if debug-on-error (funcall body) (condition-case err (funcall body) ((debug quit) (let ... ...) (signal ... ...)) (error (cond ... ... ...))))) (tramp-run-real-handler operation args))))
(progn (let* ((filename (tramp-replace-environment-variables (apply (quote tramp-file-name-for-operation) operation args))) (completion (tramp-completion-mode-p)) (foreign (tramp-find-foreign-file-name-handler filename))) (let* ((v (tramp-dissect-file-name filename)) (method (tramp-file-name-method v)) (user (tramp-file-name-user v)) (host (tramp-file-name-host v)) (localname (tramp-file-name-localname v)) (hop (tramp-file-name-hop v))) (if foreign (let ((body (function ...))) (if debug-on-error (funcall body) (condition-case err (funcall body) (... ... ...) (error ...)))) (tramp-run-real-handler operation args)))))
(unwind-protect (progn (let* ((filename (tramp-replace-environment-variables (apply (quote tramp-file-name-for-operation) operation args))) (completion (tramp-completion-mode-p)) (foreign (tramp-find-foreign-file-name-handler filename))) (let* ((v (tramp-dissect-file-name filename)) (method (tramp-file-name-method v)) (user (tramp-file-name-user v)) (host (tramp-file-name-host v)) (localname (tramp-file-name-localname v)) (hop (tramp-file-name-hop v))) (if foreign (let ((body ...)) (if debug-on-error (funcall body) (condition-case err ... ... ...))) (tramp-run-real-handler operation args))))) (set-match-data save-match-data-internal (quote evaporate)))
(let ((save-match-data-internal (match-data))) (unwind-protect (progn (let* ((filename (tramp-replace-environment-variables (apply ... operation args))) (completion (tramp-completion-mode-p)) (foreign (tramp-find-foreign-file-name-handler filename))) (let* ((v (tramp-dissect-file-name filename)) (method (tramp-file-name-method v)) (user (tramp-file-name-user v)) (host (tramp-file-name-host v)) (localname (tramp-file-name-localname v)) (hop (tramp-file-name-hop v))) (if foreign (let (...) (if debug-on-error ... ...)) (tramp-run-real-handler operation args))))) (set-match-data save-match-data-internal (quote evaporate))))
(if tramp-mode (let ((save-match-data-internal (match-data))) (unwind-protect (progn (let* ((filename (tramp-replace-environment-variables ...)) (completion (tramp-completion-mode-p)) (foreign (tramp-find-foreign-file-name-handler filename))) (let* ((v ...) (method ...) (user ...) (host ...) (localname ...) (hop ...)) (if foreign (let ... ...) (tramp-run-real-handler operation args))))) (set-match-data save-match-data-internal (quote evaporate)))) (tramp-run-real-handler operation args))
tramp-file-name-handler(file-attributes "/ssh:enterprise.sese.asu.edu:/home/t_nithyanandan/.bashrc")
file-attributes("/ssh:enterprise.sese.asu.edu:/home/t_nithyanandan/.bashrc")
find-file-noselect("/ssh:enterprise.sese.asu.edu:/home/t_nithyanandan/.bashrc" nil nil t)
find-file("/ssh:enterprise.sese.asu.edu:/home/t_nithyanandan/.bashrc" t)
call-interactively(find-file nil nil)
我不擅长口齿不清。如果您希望我运行一些诊断程序,请记住我是初学者。任何帮助将不胜感激。
感谢。
P.S:我必须提到的是,虽然tramp在这次故障发生之前就已经开始工作了,但有时它曾经常常挂起而且我不耐烦地使用C-g来戒掉任何tramp试图做的事情。我不确定这是否会破坏流浪汉内部的某些内容。修改1
尝试遵循Drew的建议,这就是我找到的。我已将我的init文件.emacs重命名为.emacs.bkp,我一直认为这应该禁用emacs加载该初始化文件。有趣的是,如果我用
打开emacsemacs -Q
然后我可以ssh到远程机器并查看我的文件。所以我有以下问题:
1)似乎重命名init文件并重新启动emacs不会阻止init文件干扰 2)如何禁用init文件我需要做什么? 3)我的init文件的哪个部分可能导致此问题?让我知道如果定位我的整个init文件会有所帮助。我重命名的init文件.emacs.bkp中的Tramp相关行是:
(add-to-list 'load-path "/usr/local/share/emacs/tramp/lisp/")
(require 'tramp)
(setq tramp-default-method "ssh")
(setq tramp-verbose 9)
修改2
我使用我在其他地方备份的原始源恢复了我的init文件。我使用ediff-buffers来找出差异并恢复所有差异,使其与我在破坏的init文件中的想法相同。出于某些奇怪的原因,新的init文件看起来与我之前的init文件完全相同,并且tramp工作正常。换句话说,我不知道究竟修复了什么,但恢复我的init文件似乎可以解决问题。