changeset 80537:03d24c673b00

* net/tramp.el (tramp-replace-environment-variables): Remove it. There is a more simple solution. (tramp-file-name-handler): Apply `substitute-in-file-name' w/o Tramp file name handlers.
author Michael Albinus <michael.albinus@gmx.de>
date Mon, 28 Apr 2008 19:30:50 +0000
parents 4b0ab9e918cd
children 7fd5e261aca4
files lisp/net/tramp.el
diffstat 1 files changed, 3 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/net/tramp.el	Mon Apr 28 07:18:03 2008 +0000
+++ b/lisp/net/tramp.el	Mon Apr 28 19:30:50 2008 +0000
@@ -4375,16 +4375,6 @@
 	  (setq res (cdr elt))))
       res)))
 
-(defun tramp-replace-environment-variables (filename)
-  "Replace environment variables in FILENAME.
-Return the string with the replaced variables."
-  (when (string-match "$\\w+" filename)
-    (setq filename
-	  (replace-match
-	   (substitute-in-file-name (match-string 0 filename))
-	   t nil filename)))
-  filename)
-
 ;; Main function.
 ;;;###autoload
 (defun tramp-file-name-handler (operation &rest args)
@@ -4394,8 +4384,9 @@
 ;;  (edebug-trace "%s" (with-output-to-string (backtrace)))
   (save-match-data
     (let* ((filename
-	    (tramp-replace-environment-variables
-	     (apply 'tramp-file-name-for-operation operation args)))
+	    (tramp-run-real-handler
+	     'substitute-in-file-name
+	     (list (apply 'tramp-file-name-for-operation operation args))))
 	   (completion (tramp-completion-mode-p filename))
 	   (foreign (tramp-find-foreign-file-name-handler filename)))
       (with-parsed-tramp-file-name filename nil