all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Avoid efficiency issues with user/host name completion in Tramp
@ 2002-09-13 22:04 Kai Großjohann
  2002-09-15  1:50 ` Richard Stallman
  2002-09-15 12:50 ` Michael Albinus
  0 siblings, 2 replies; 3+ messages in thread
From: Kai Großjohann @ 2002-09-13 22:04 UTC (permalink / raw)
  Cc: Michael.Albinus, Tramp Developers

Michael is working on user/host name completion in Tramp.  As you
might recall, Tramp allows filenames of the form

    /method:user@host: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 "/user@ho" is completed to
    "/user@host:".)

(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)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Avoid efficiency issues with user/host name completion in Tramp
  2002-09-13 22:04 Avoid efficiency issues with user/host name completion in Tramp Kai Großjohann
@ 2002-09-15  1:50 ` Richard Stallman
  2002-09-15 12:50 ` Michael Albinus
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Stallman @ 2002-09-15  1:50 UTC (permalink / raw)
  Cc: emacs-devel, Michael.Albinus, tramp-devel

I think that a, b and e are ok.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Avoid efficiency issues with user/host name completion in Tramp
  2002-09-13 22:04 Avoid efficiency issues with user/host name completion in Tramp Kai Großjohann
  2002-09-15  1:50 ` Richard Stallman
@ 2002-09-15 12:50 ` Michael Albinus
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Albinus @ 2002-09-15 12:50 UTC (permalink / raw)


Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) writes:

> (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.

I don't see the advantage of this alternative. If "/ho: <TAB>" is
expanded to a host name, there's still the problem that parsing the
file containing all host names takes time. And at this stage of
completion I (as user) would expect, that "ho" is already a complete
(method or) host name, and in case of host name it returns all file
names found there.

I guess, that Kai's alternatives a) and b) are promising: Cache the
host names once they are read, and allow to discard expansive
host name configuration files via customisation.

> kai

Best regards, Michael.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-09-15 12:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-13 22:04 Avoid efficiency issues with user/host name completion in Tramp Kai Großjohann
2002-09-15  1:50 ` Richard Stallman
2002-09-15 12:50 ` Michael Albinus

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.