changeset 93082:7e079018403b

* net/tramp.el (tramp-let-maybe): Removed. (tramp-drop-volume-letter): Don't use `replace-regexp-in-string'. It does not exist under XEmacs. (tramp-handle-file-truename, tramp-handle-expand-file-name) (tramp-completion-file-name-handler): Let-bind `directory-sep-char'.
author Michael Albinus <michael.albinus@gmx.de>
date Wed, 19 Mar 2008 21:05:26 +0000
parents dc3dfd7208a1
children 3f66e01387bb
files lisp/net/tramp.el
diffstat 1 files changed, 21 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/net/tramp.el	Wed Mar 19 21:03:49 2008 +0000
+++ b/lisp/net/tramp.el	Wed Mar 19 21:05:26 2008 +0000
@@ -5,7 +5,7 @@
 
 ;; (copyright statements below in code to be updated with the above notice)
 
-;; Author: Kai Großjohann <kai.grossjohann@gmx.net>
+;; Author: Kai Großjohann <kai.grossjohann@gmx.net>
 ;;         Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, processes
 
@@ -1957,18 +1957,6 @@
 (put 'with-connection-property 'edebug-form-spec t)
 (font-lock-add-keywords 'emacs-lisp-mode '("\\<with-connection-property\\>"))
 
-;;;###autoload
-(defmacro tramp-let-maybe (variable value &rest body)
-  "Let-bind VARIABLE to VALUE in BODY, but only if VARIABLE is not obsolete.
-BODY is executed whether or not the variable is obsolete.
-The intent is to protect against `obsolete variable' warnings."
-  `(if (get ',variable 'byte-obsolete-variable)
-       (progn ,@body)
-     (let ((,variable ,value))
-       ,@body)))
-(put 'tramp-let-maybe 'lisp-indent-function 2)
-(put 'tramp-let-maybe 'edebug-form-spec t)
-
 (defsubst tramp-make-tramp-temp-file (vec)
   "Create a temporary file on the remote host identified by VEC.
 Return the local name of the temporary file."
@@ -2201,9 +2189,9 @@
   "Like `file-truename' for Tramp files."
   (with-parsed-tramp-file-name (expand-file-name filename) nil
     (with-file-property v localname "file-truename"
-      (let* ((steps        (tramp-split-string localname "/"))
-	     (localnamedir (tramp-let-maybe directory-sep-char ?/ ;for XEmacs
-			     (file-name-as-directory localname)))
+      (let* ((directory-sep-char ?/) ; for XEmacs
+	     (steps (tramp-split-string localname "/"))
+	     (localnamedir (file-name-as-directory localname))
 	     (is-dir (string= localname localnamedir))
 	     (thisstep nil)
 	     (numchase 0)
@@ -3505,7 +3493,10 @@
 locally on a remote file name.  When the local system is a W32 system
 but the remote system is Unix, this introduces a superfluous drive
 letter into the file name.  This function removes it."
-	(save-match-data (replace-regexp-in-string tramp-root-regexp "/" name)))
+	(save-match-data
+	  (if (string-match tramp-root-regexp name)
+	      (replace-match "/" nil t name)
+	    name)))
 
     (defalias 'tramp-drop-volume-letter 'identity)))
 
@@ -3558,13 +3549,13 @@
       ;; would otherwise use backslash.  `default-directory' is
       ;; bound, because on Windows there would be problems with UNC
       ;; shares or Cygwin mounts.
-      (tramp-let-maybe directory-sep-char ?/
-	(let ((default-directory (tramp-compat-temporary-file-directory)))
-	  (tramp-make-tramp-file-name
-	   method user host
-	   (tramp-drop-volume-letter
-	    (tramp-run-real-handler 'expand-file-name
-				    (list localname)))))))))
+      (let ((directory-sep-char ?/)
+	    (default-directory (tramp-compat-temporary-file-directory)))
+	(tramp-make-tramp-file-name
+	 method user host
+	 (tramp-drop-volume-letter
+	  (tramp-run-real-handler 'expand-file-name
+				  (list localname))))))))
 
 (defun tramp-handle-substitute-in-file-name (filename)
   "Like `substitute-in-file-name' for Tramp files.
@@ -4500,11 +4491,11 @@
 Falls back to normal file name handler if no Tramp file name handler exists."
   ;; We bind `directory-sep-char' here for XEmacs on Windows, which
   ;; would otherwise use backslash.
-  (tramp-let-maybe directory-sep-char ?/
-    (let ((fn (assoc operation tramp-completion-file-name-handler-alist)))
-      (if fn
-	  (save-match-data (apply (cdr fn) args))
-	(tramp-completion-run-real-handler operation args))))))
+  (let ((directory-sep-char ?/)
+	(fn (assoc operation tramp-completion-file-name-handler-alist)))
+    (if fn
+	(save-match-data (apply (cdr fn) args))
+      (tramp-completion-run-real-handler operation args)))))
 
 ;;;###autoload
 (defsubst tramp-register-file-name-handler ()
@@ -7371,7 +7362,7 @@
 ;;   transfer method to use.  (Greg Stark)
 ;; * Remove unneeded parameters from methods.
 ;; * Invoke rsync once for copying a whole directory hierarchy.
-;;   (Francesco Potortì)
+;;   (Francesco Potortì)
 ;; * Make it work for different encodings, and for different file name
 ;;   encodings, too.  (Daniel Pittman)
 ;; * Progress reports while copying files.  (Michael Kifer)