emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/net/tramp.el,v


From: Michael Albinus
Subject: [Emacs-diffs] Changes to emacs/lisp/net/tramp.el,v
Date: Sun, 09 Sep 2007 08:31:28 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Michael Albinus <albinus>       07/09/09 08:31:27

Index: net/tramp.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/net/tramp.el,v
retrieving revision 1.135
retrieving revision 1.136
diff -u -b -r1.135 -r1.136
--- net/tramp.el        28 Aug 2007 20:09:58 -0000      1.135
+++ net/tramp.el        9 Sep 2007 08:31:27 -0000       1.136
@@ -149,17 +149,12 @@
                    (unload-feature 'tramp-fish 'force))))
 
      ;; Load gateways.  It needs `make-network-process' from Emacs 22.
-     (if (functionp 'make-network-process)
-        (progn
+     (when (functionp 'make-network-process)
           (require 'tramp-gw)
           (add-hook 'tramp-unload-hook
                     '(lambda ()
                        (when (featurep 'tramp-gw)
                          (unload-feature 'tramp-gw 'force)))))
-       ;; We need to declare used tramp-gw-* symbols at least.
-       (setq tramp-gw-tunnel-method ""
-            tramp-gw-socks-method "")
-       (defalias 'tramp-gw-open-connection 'ignore))
 
      ;; tramp-util offers integration into other (X)Emacs packages like
      ;; compile.el, gud.el etc.  Not necessary in Emacs 23.
@@ -2024,6 +2019,22 @@
 (put 'tramp-let-maybe 'lisp-indent-function 2)
 (put 'tramp-let-maybe 'edebug-form-spec t)
 
+(defsubst tramp-make-temp-file (filename)
+  (concat
+   (funcall (if (fboundp 'make-temp-file) 'make-temp-file 'make-temp-name)
+           (expand-file-name tramp-temp-name-prefix
+                             (tramp-temporary-file-directory)))
+   (file-name-extension filename t)))
+
+(defsubst tramp-make-tramp-temp-file (vec)
+  (format
+   "/tmp/%s%s"
+   tramp-temp-name-prefix
+   (if (get-buffer-process (tramp-get-connection-buffer vec))
+       (process-id (get-buffer-process (tramp-get-connection-buffer vec)))
+     (emacs-pid))))
+
+
 ;;; Config Manipulation Functions:
 
 (defun tramp-set-completion-function (method function-list)
@@ -3030,16 +3041,16 @@
 KEEP-DATE means to make sure that NEWNAME has the same timestamp
 as FILENAME.  PRESERVE-UID-GID, when non-nil, instructs to keep
 the uid and gid from FILENAME."
+  (let ((t1 (tramp-tramp-file-p filename))
+       (t2 (tramp-tramp-file-p newname)))
   (with-parsed-tramp-file-name (if t1 filename newname) nil
     (let* ((cmd (cond ((and (eq op 'copy) preserve-uid-gid) "cp -f -p")
                      ((eq op 'copy) "cp -f")
                      ((eq op 'rename) "mv -f")
                      (t (tramp-error
-                         vec 'file-error
+                           v 'file-error
                          "Unknown operation `%s', must be `copy' or `rename'"
                          op))))
-          (t1 (tramp-tramp-file-p filename))
-          (t2 (tramp-tramp-file-p newname))
           (localname1
            (if t1 (tramp-handle-file-remote-p filename 'localname) filename))
           (localname2
@@ -3137,7 +3148,7 @@
              (rename-file tmpfile localname2 ok-if-already-exists))))
 
          ;; Remove temporary file.
-         (when (eq op 'copy) (delete-file tmpfile))))))
+           (when (eq op 'copy) (delete-file tmpfile)))))))
 
       ;; Set the time and mode. Mask possible errors.
       ;; Won't be applied for 'rename.
@@ -3577,21 +3588,6 @@
 
 ;;; Remote commands.
 
-(defsubst tramp-make-temp-file (filename)
-  (concat
-   (funcall (if (fboundp 'make-temp-file) 'make-temp-file 'make-temp-name)
-           (expand-file-name tramp-temp-name-prefix
-                             (tramp-temporary-file-directory)))
-   (file-name-extension filename t)))
-
-(defsubst tramp-make-tramp-temp-file (vec)
-  (format
-   "/tmp/%s%s"
-   tramp-temp-name-prefix
-   (if (get-buffer-process (tramp-get-connection-buffer vec))
-       (process-id (get-buffer-process (tramp-get-connection-buffer vec)))
-     (emacs-pid))))
-
 (defun tramp-handle-executable-find (command)
   "Like `executable-find' for Tramp files."
   (with-parsed-tramp-file-name default-directory nil
@@ -4339,8 +4335,7 @@
         ((and completion (zerop (length localname))
               (memq operation '(file-name-as-directory)))
          filename)
-        ;; Call the backend function.  Set a connection property
-        ;; first, it will be reused for user/host name completion.
+        ;; Call the backend function.
         (foreign (apply foreign operation args))
         ;; Nothing to do for us.
         (t (tramp-run-real-handler operation args)))))))
@@ -5945,10 +5940,12 @@
            (setq choices tramp-default-proxies-alist)))))
 
     ;; Handle gateways.
-    (when (string-match (format
+    (when (and (boundp 'tramp-gw-tunnel-method)
+              (string-match (format
                         "^\\(%s\\|%s\\)$"
-                        tramp-gw-tunnel-method tramp-gw-socks-method)
-                       (tramp-file-name-method (car target-alist)))
+                             (symbol-value 'tramp-gw-tunnel-method)
+                             (symbol-value 'tramp-gw-socks-method))
+                            (tramp-file-name-method (car target-alist))))
       (let ((gw (pop target-alist))
            (hop (pop target-alist)))
        ;; Is the method prepared for gateways?
@@ -5973,7 +5970,7 @@
         'target-alist
         (vector
          (tramp-file-name-method hop) (tramp-file-name-user hop)
-         (tramp-gw-open-connection vec gw hop) nil))
+         (funcall (intern "tramp-gw-open-connection") vec gw hop) nil))
        ;; For the password prompt, we need the correct values.
        ;; Therefore, we must remember the gateway vector.  But we
        ;; cannot do it as connection property, because it shouldn't
@@ -6524,7 +6521,7 @@
 
 ;; The host part of a Tramp file name vector can be of kind
 ;; "host#port".  Sometimes, we must extract these parts.
-(defsubst tramp-file-name-real-host (vec)
+(defun tramp-file-name-real-host (vec)
   "Return the host name of VEC without port."
   (let ((host (tramp-file-name-host vec)))
     (if (and (stringp host)
@@ -6532,7 +6529,7 @@
        (match-string 1 host)
       host)))
 
-(defsubst tramp-file-name-port (vec)
+(defun tramp-file-name-port (vec)
   "Return the port number of VEC."
   (let ((host (tramp-file-name-host vec)))
     (and (stringp host)
@@ -6544,7 +6541,7 @@
   (save-match-data
     (string-match tramp-file-name-regexp name)))
 
-(defsubst tramp-find-method (method user host)
+(defun tramp-find-method (method user host)
   "Return the right method string to use.
 This is METHOD, if non-nil. Otherwise, do a lookup in
 `tramp-default-method-alist'."
@@ -6560,7 +6557,7 @@
        lmethod)
       tramp-default-method))
 
-(defsubst tramp-find-user (method user host)
+(defun tramp-find-user (method user host)
   "Return the right user string to use.
 This is USER, if non-nil. Otherwise, do a lookup in
 `tramp-default-user-alist'."
@@ -6576,7 +6573,7 @@
        luser)
       tramp-default-user))
 
-(defsubst tramp-find-host (method user host)
+(defun tramp-find-host (method user host)
   "Return the right host string to use.
 This is HOST, if non-nil. Otherwise, it is `tramp-default-host'."
   (or (and (> (length host) 0) host)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]