tramp-devel
[Top][All Lists]
Advanced

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

Re: Tramp completion doesn't work like ange-ftp


From: Matthew Donaldson
Subject: Re: Tramp completion doesn't work like ange-ftp
Date: Thu, 02 Aug 2007 20:45:31 +0930
User-agent: Thunderbird 2.0.0.5 (X11/20070719)

Hi Michael,

That mostly fixes the problem. I can now complete things (interestingly, when I type /mc<TAB>, it first completes to /mcgd, then <TAB> again fills in the rest). It doesn't do it everywhere though. C-x C-f works fine, but if I do M-x copy-file, completion doesn't happen there.

Another thing I have noticed (not sure if this is related) is this: Part of my emacs startup loads a list of buffers and cursor positions saved before. This includes ange-ftp path names. I haven't had trouble with this before, but now it's failing to load some files, and although calling (find-file "path-to-file") from M-x : works, it doesn't work if put into a function. To narrow this down I made a little function called testit which loads two files:
/address@hidden:/public_html/training.php3 and
/address@hidden:/public_html/courseware/account/index.php3

This is the function:

(defun testit ()
  (interactive)
  (find-file "/address@hidden:/public_html/training.php3")
(find-file "/address@hidden:/public_html/courseware/account/index.php3")
)

When I run it, I get these messages:

Opening FTP connection to www.datadeliverance.com...done
Logging in as user address@hidden
Getting PWD...done
Doing CD...done
Listing /address@hidden:/public_html/...done
Retrieving /address@hidden:/public_html/training.php3...done
Loading html-helper-mode...done
Loading /home/matthew/emacs/tables.el (source)...done
Doing CD...done
Listing courseware/account/...done
Doing CD...done
Listing courseware/account/index.php3/...done
Doing CD...done
Listing courseware/account/...done
Doing CD...done
Listing courseware/account/index.php3/...done
Doing CD...done
Listing courseware/account/...done
Doing CD...done
Listing courseware/account/index.php3/...done
Doing CD...done
Listing courseware/account/...done
Doing CD...done
Listing /address@hidden:/public_html/courseware/account/...done
Doing CD...done
Listing /address@hidden:/public_html/courseware/...done
Doing CD...done
Listing /address@hidden:/public_html/courseware/account/...done
Doing CD...done
Listing /address@hidden:/public_html/courseware/...done
Use M-x make-directory RET RET to create the directory and its parents
Loading /home/matthew/emacs/tables.el (source)...done
Doing CD...done
Listing /address@hidden:/public_html/courseware/account/...done

Notice how it tries to put a slash on the end of the file name and list it as a directory. Something is confused somewhere there. Oddly this doesn't seem to happen unless I put it in a function following another find-file which also loads an ange-ftp path name. However it doesn't have to be the next command. The real code has quite a bit of messing around between each find-file, but they are all running in the same function.

Cheers

                 -Matthew


Michael Albinus wrote:
Matthew Donaldson <address@hidden> writes:

Hi Michael,

Hi Matthew,

The trace is enclosed.  Not sure if you wanted me to trace all of
this, but what I did was basically this:

Thanks a lot for the trace, it is interesting, indeed. I believe I've
found the problem. Could you, please, test the appended patch? It is
towards Tramp 2.1.11-pre, so you might need to adapt the line numbers.

Cheers

            -Matthew

Thanks for your patient testing, and best regards, Michael.



------------------------------------------------------------------------

*** /home/albinus/src/emacs/lisp/net/tramp.el   2007-07-29 17:16:56.000000000 
+0200
--- /home/albinus/src/tramp/lisp/tramp.el       2007-08-01 17:17:22.000000000 
+0200
***************
*** 4177,4184 ****
         ((and completion (zerop (length localname))
               (memq operation '(file-name-as-directory)))
          filename)
!        ;; Call the backend function.
!        (foreign (apply foreign operation args))
         ;; Nothing to do for us.
         (t (tramp-run-real-handler operation args)))))))
--- 4177,4187 ----
         ((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.
!        (foreign
!         (tramp-set-connection-property v "started" nil)
!         (apply foreign operation args))
         ;; Nothing to do for us.
         (t (tramp-run-real-handler operation args)))))))


--
+--------------------------------------------------------------------------+
| Matthew Donaldson             http://www.datadeliverance.com             |
| Data Deliverance Pty. Ltd.    Email: address@hidden         |
| 30 Musgrave Ave.              Phone: +61 8 8265 7976            _        |
| Banksia Park                  Fax:   +61 8 8265 0032     John  / \/      |
| South Australia 5091                                     3:16  \_/\      |
+--------------------------------------------------------------------------+




reply via email to

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