emacs-devel
[Top][All Lists]
Advanced

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

Re: Emacs unconditionally loads tramp.el


From: Michael Albinus
Subject: Re: Emacs unconditionally loads tramp.el
Date: Fri, 28 Apr 2006 21:58:09 +0200
User-agent: Gnus/5.110005 (No Gnus v0.5) Emacs/22.0.50 (gnu/linux)

Richard Stallman <address@hidden> writes:

>     That's not new, because it's a similar story with Emacs 21 and
>     `ange-ftp-completion-hook-function'. The only difference is that
>     Ange-FTP is loaded only for `file-name-completion´, whereas
>     Tramp is loaded in more cases.
>
> Why is Tramp loaded in more cases?  Can you get rid of them, and
> arrange to load it only for file name completion?

For GNU Emacs, it should be possible. Commentary from
`tramp-completion-file-name-handler-alist´ (I haven't checked further
yet):

;; Handlers for partial tramp file names. For GNU Emacs just
;; `file-name-all-completions' is needed. The other ones are necessary
;; for XEmacs.

But this problem has reached XEmacs mailing lists as well. I fear a
general solution is needed.

> Also, maybe it is possible to prevent loading these packages
> in the specific case of just `/'.  Completion is not very
> useful in that case, and that is the most likely case for someone
> to type and not really want it.

That would be simple:

(defconst tramp-completion-file-name-regexp-unified "^/[^/:][^/]*$")

A user would need to type at least one additional character after the
leading "/" in order to get Tramp loaded. But this still will happen
without typing <TAB> or so, just due to `expand-file-name´.

Meanwhile, I doubt whether it is worth the trouble. We could revert
the patch, and would fall back to the following scenario:

- After starting Emacs, there is no hostname completion for remote file
  names.
- After using the first remote file name, Tramp is loaded, and
  hostname completion is active.
- If a user wants to use hostname completion immediately after
  starting Emacs, a simple (require 'tramp) in .emacs is sufficient.

This must be documented. It seems to be more accepted (see Eli's
message on this subject). Shall we go this direction?

Best regards, Michael.




reply via email to

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