aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/net
diff options
context:
space:
mode:
authorMichael Albinus2008-03-19 21:06:37 +0000
committerMichael Albinus2008-03-19 21:06:37 +0000
commitaff67808c108e2b24bbc626d66647d6c759134b9 (patch)
tree5ab5ff6b9582f98398e9a4234f52d93d8b31c402 /lisp/net
parentc9e646c2e2d431de3cb8116fe6565112ed53db4b (diff)
downloademacs-aff67808c108e2b24bbc626d66647d6c759134b9.tar.gz
emacs-aff67808c108e2b24bbc626d66647d6c759134b9.zip
* 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'.
Diffstat (limited to 'lisp/net')
-rw-r--r--lisp/net/tramp.el51
1 files changed, 21 insertions, 30 deletions
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index d530da37e22..fa5cdafca56 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -5,7 +5,7 @@
5 5
6;; (copyright statements below in code to be updated with the above notice) 6;; (copyright statements below in code to be updated with the above notice)
7 7
8;; Author: Kai Großjohann <kai.grossjohann@gmx.net> 8;; Author: Kai Großjohann <kai.grossjohann@gmx.net>
9;; Michael Albinus <michael.albinus@gmx.de> 9;; Michael Albinus <michael.albinus@gmx.de>
10;; Keywords: comm, processes 10;; Keywords: comm, processes
11 11
@@ -1957,18 +1957,6 @@ FILE must be a local file name on a connection identified via VEC."
1957(put 'with-connection-property 'edebug-form-spec t) 1957(put 'with-connection-property 'edebug-form-spec t)
1958(font-lock-add-keywords 'emacs-lisp-mode '("\\<with-connection-property\\>")) 1958(font-lock-add-keywords 'emacs-lisp-mode '("\\<with-connection-property\\>"))
1959 1959
1960;;;###autoload
1961(defmacro tramp-let-maybe (variable value &rest body)
1962 "Let-bind VARIABLE to VALUE in BODY, but only if VARIABLE is not obsolete.
1963BODY is executed whether or not the variable is obsolete.
1964The intent is to protect against `obsolete variable' warnings."
1965 `(if (get ',variable 'byte-obsolete-variable)
1966 (progn ,@body)
1967 (let ((,variable ,value))
1968 ,@body)))
1969(put 'tramp-let-maybe 'lisp-indent-function 2)
1970(put 'tramp-let-maybe 'edebug-form-spec t)
1971
1972(defsubst tramp-make-tramp-temp-file (vec) 1960(defsubst tramp-make-tramp-temp-file (vec)
1973 "Create a temporary file on the remote host identified by VEC. 1961 "Create a temporary file on the remote host identified by VEC.
1974Return the local name of the temporary file." 1962Return the local name of the temporary file."
@@ -2201,9 +2189,9 @@ target of the symlink differ."
2201 "Like `file-truename' for Tramp files." 2189 "Like `file-truename' for Tramp files."
2202 (with-parsed-tramp-file-name (expand-file-name filename) nil 2190 (with-parsed-tramp-file-name (expand-file-name filename) nil
2203 (with-file-property v localname "file-truename" 2191 (with-file-property v localname "file-truename"
2204 (let* ((steps (tramp-split-string localname "/")) 2192 (let* ((directory-sep-char ?/) ; for XEmacs
2205 (localnamedir (tramp-let-maybe directory-sep-char ?/ ;for XEmacs 2193 (steps (tramp-split-string localname "/"))
2206 (file-name-as-directory localname))) 2194 (localnamedir (file-name-as-directory localname))
2207 (is-dir (string= localname localnamedir)) 2195 (is-dir (string= localname localnamedir))
2208 (thisstep nil) 2196 (thisstep nil)
2209 (numchase 0) 2197 (numchase 0)
@@ -3505,7 +3493,10 @@ The function `tramp-handle-expand-file-name' calls `expand-file-name'
3505locally on a remote file name. When the local system is a W32 system 3493locally on a remote file name. When the local system is a W32 system
3506but the remote system is Unix, this introduces a superfluous drive 3494but the remote system is Unix, this introduces a superfluous drive
3507letter into the file name. This function removes it." 3495letter into the file name. This function removes it."
3508 (save-match-data (replace-regexp-in-string tramp-root-regexp "/" name))) 3496 (save-match-data
3497 (if (string-match tramp-root-regexp name)
3498 (replace-match "/" nil t name)
3499 name)))
3509 3500
3510 (defalias 'tramp-drop-volume-letter 'identity))) 3501 (defalias 'tramp-drop-volume-letter 'identity)))
3511 3502
@@ -3558,13 +3549,13 @@ the result will be a local, non-Tramp, filename."
3558 ;; would otherwise use backslash. `default-directory' is 3549 ;; would otherwise use backslash. `default-directory' is
3559 ;; bound, because on Windows there would be problems with UNC 3550 ;; bound, because on Windows there would be problems with UNC
3560 ;; shares or Cygwin mounts. 3551 ;; shares or Cygwin mounts.
3561 (tramp-let-maybe directory-sep-char ?/ 3552 (let ((directory-sep-char ?/)
3562 (let ((default-directory (tramp-compat-temporary-file-directory))) 3553 (default-directory (tramp-compat-temporary-file-directory)))
3563 (tramp-make-tramp-file-name 3554 (tramp-make-tramp-file-name
3564 method user host 3555 method user host
3565 (tramp-drop-volume-letter 3556 (tramp-drop-volume-letter
3566 (tramp-run-real-handler 'expand-file-name 3557 (tramp-run-real-handler 'expand-file-name
3567 (list localname))))))))) 3558 (list localname))))))))
3568 3559
3569(defun tramp-handle-substitute-in-file-name (filename) 3560(defun tramp-handle-substitute-in-file-name (filename)
3570 "Like `substitute-in-file-name' for Tramp files. 3561 "Like `substitute-in-file-name' for Tramp files.
@@ -4500,11 +4491,11 @@ Fall back to normal file name handler if no Tramp handler exists."
4500Falls back to normal file name handler if no Tramp file name handler exists." 4491Falls back to normal file name handler if no Tramp file name handler exists."
4501 ;; We bind `directory-sep-char' here for XEmacs on Windows, which 4492 ;; We bind `directory-sep-char' here for XEmacs on Windows, which
4502 ;; would otherwise use backslash. 4493 ;; would otherwise use backslash.
4503 (tramp-let-maybe directory-sep-char ?/ 4494 (let ((directory-sep-char ?/)
4504 (let ((fn (assoc operation tramp-completion-file-name-handler-alist))) 4495 (fn (assoc operation tramp-completion-file-name-handler-alist)))
4505 (if fn 4496 (if fn
4506 (save-match-data (apply (cdr fn) args)) 4497 (save-match-data (apply (cdr fn) args))
4507 (tramp-completion-run-real-handler operation args)))))) 4498 (tramp-completion-run-real-handler operation args)))))
4508 4499
4509;;;###autoload 4500;;;###autoload
4510(defsubst tramp-register-file-name-handler () 4501(defsubst tramp-register-file-name-handler ()
@@ -7371,7 +7362,7 @@ Only works for Bourne-like shells."
7371;; transfer method to use. (Greg Stark) 7362;; transfer method to use. (Greg Stark)
7372;; * Remove unneeded parameters from methods. 7363;; * Remove unneeded parameters from methods.
7373;; * Invoke rsync once for copying a whole directory hierarchy. 7364;; * Invoke rsync once for copying a whole directory hierarchy.
7374;; (Francesco Potortì) 7365;; (Francesco Potortì)
7375;; * Make it work for different encodings, and for different file name 7366;; * Make it work for different encodings, and for different file name
7376;; encodings, too. (Daniel Pittman) 7367;; encodings, too. (Daniel Pittman)
7377;; * Progress reports while copying files. (Michael Kifer) 7368;; * Progress reports while copying files. (Michael Kifer)