[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Avoid efficiency issues with user/host name completion in Tramp
From: |
Kai Großjohann |
Subject: |
Avoid efficiency issues with user/host name completion in Tramp |
Date: |
Sat, 14 Sep 2002 00:04:18 +0200 |
User-agent: |
Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.3.50 (i686-pc-linux-gnu) |
Michael is working on user/host name completion in Tramp. As you
might recall, Tramp allows filenames of the form
/method:address@hidden:file
If you type that in and hit TAB during entering the host name, then
it's clear what Tramp has to do: complete a host name.
But you might also want to type filenames without the method, and
possibly also without the user name. So the filenames look like this:
/host:file
At this spot, typing TAB during entering the host name suffers from a
problem. Suppose the user types /fo and then TAB:
(1) Getting completions for host names might take long, and
(2) the user might have intended a local file like /foo/bar.
Why might it take long to get completions for host names? Because
Tramp will read files with host names in them (like /etc/hosts and
/etc/ssh/known_hosts), and some sites have really long such files.
(Michael's site is one of them.)
There are a number of possible approaches, but I don't know what is
the right one?
(a) Live with TAB taking a long time in such cases. (And Tramp caches
the list of host names in memory, so it's only slow once.)
(b) The list of files to read host names from is configurable. Users
are responsible for deleteting from the list the files that are
too long.
Maybe the default list of files could consist of short files only.
(c) Don't allow host name completion for these kinds of filenames,
require the users to type in the method name if they want host
name completion, so that "/ssh:ho" is completed to "/ssh:host:".
(Or maybe the user name, so that "/address@hidden" is completed to
"/address@hidden:".)
(d) Change the filename syntax so that it's possible to recognize even
Tramp files where only part of the host name is given. This, of
course, breaks the Ange-FTP/Tramp unified filename syntax. (Or at
least it breaks backward compatiblity with Ange-FTP in this
regard.)
(e) Require the user to type ":" at the end of the filename before
invoking completion. So the user types "/ho:" and then hits TAB
and the system completes to "/host:". This is a funny kind of
completion and different from the rest of Emacs. But with
partial-completion-mode it could make some kind of sense.
Opinions?
kai
--
~/.signature is: umop 3p!sdn (Frank Nobis)
- Avoid efficiency issues with user/host name completion in Tramp,
Kai Großjohann <=