From: Michael Albinus Date: Fri, 22 Jul 2011 11:04:55 +0000 (+0200) Subject: * net/tramp.el (tramp-file-name-handler): Avoid recursive X-Git-Tag: emacs-pretest-24.0.90~104^2~178 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=11d074b2952909def6ab8e0f8313e84ec440cdc9;p=emacs.git * net/tramp.el (tramp-file-name-handler): Avoid recursive loading. (Bug#9114) --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a2169898670..848d991feed 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2011-07-22 Michael Albinus + + * net/tramp.el (tramp-file-name-handler): Avoid recursive + loading. (Bug#9114) + 2011-07-21 Martin Rudalics * window.el (display-buffer-pop-up-window) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 82d878a6fa8..9b11ef58eab 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1876,7 +1876,17 @@ Falls back to normal file name handler if no Tramp file name handler exists." ;; Call the backend function. (if foreign (condition-case err - (apply foreign operation args) + (let ((sf (symbol-function foreign))) + ;; Some packages set the default directory to a + ;; remote path, before respective Tramp packages + ;; are already loaded. This results in + ;; recursive loading. Therefore, we load the + ;; Tramp packages locally. + (when (and (listp sf) (eq (car sf) 'autoload)) + (let ((default-directory + (tramp-compat-temporary-file-directory))) + (load (cadr sf) 'noerror))) + (apply foreign operation args)) ;; Trace that somebody has interrupted the operation. (quit