tramp-devel
[Top][All Lists]
Advanced

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

Re: tramp and windows network places


From: Michael Albinus
Subject: Re: tramp and windows network places
Date: Sun, 23 Oct 2005 14:02:42 +0200
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

Deliverable Mail <address@hidden> writes:

> When using tramp under XEmacs on Windows, there's a problem mixing this use
> with accessing network places.
>  A typical sessions runs as follows: load a tramp file, edit it, be happy.
>  Access a network-place file, \\place\\winfile <file://\\place\\winfile>.
>  Then try to load a tramp file /[plink1/...]/path/trampfile, *when in the
> winfile buffer*, via C-x C-f.
>  Tramp dutifully goes out but then says,
>  The directory containing /[plink1/...]//place/trampfile does not exist
>  -- it seems to take a piece of the path from the network place.

Good point! The patch below fixes the problem. It is towards the
recent stable version 2.0.51 (I don't know which Tramp version you are
running); but you could adapt it easily in tramp.el, function
`tramp-handle-expand-file-name'.

>  Cheers,
> Alexy

Thanks for your report, and best regards, Michael.

Index: tramp.el
===================================================================
RCS file: /cvsroot/tramp/tramp/lisp/tramp.el,v
retrieving revision 2.359.2.55
retrieving revision 2.359.2.58
diff -u -r2.359.2.55 -r2.359.2.58
--- tramp.el    11 Oct 2005 21:40:00 -0000      2.359.2.55
+++ tramp.el    23 Oct 2005 10:54:24 -0000      2.359.2.58
@@ -3498,15 +3498,18 @@
            (erase-buffer)))
        ;; No tilde characters in file name, do normal
        ;; expand-file-name (this does "/./" and "/../").  We bind
-       ;; directory-sep-char here for XEmacs on Windows, which
-       ;; would otherwise use backslash.
+       ;; directory-sep-char here for XEmacs on Windows, which would
+       ;; otherwise use backslash.  `default-directory' is bound to
+       ;; "/", because on Windows there would be problems with UNC
+       ;; shares or Cygwin mounts.
        (tramp-let-maybe directory-sep-char ?/
-         (tramp-make-tramp-file-name
-          multi-method (or method (tramp-find-default-method user host))
-          user host
-          (tramp-drop-volume-letter
-           (tramp-run-real-handler 'expand-file-name
-                                   (list localname)))))))))
+         (let ((default-directory "/"))
+           (tramp-make-tramp-file-name
+            multi-method (or method (tramp-find-default-method user host))
+            user host
+            (tramp-drop-volume-letter
+             (tramp-run-real-handler 'expand-file-name
+                                     (list localname))))))))))

 ;; old version follows.  it uses ".." to cross file handler
 ;; boundaries.

reply via email to

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