[Top][All Lists]

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

Re: Tramp with sshfs

From: Michael Albinus
Subject: Re: Tramp with sshfs
Date: Tue, 17 Aug 2010 21:19:08 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

[keeping address@hidden in cc, other people might be interested in]

Andrea Crotti <address@hidden> writes:

> Andrea Crotti <address@hidden> writes:
>> Ah that's interesting, if you point out where more or less to have a
>> look it would be nice to try to see if I'm able to.

There are some packages like this. tramp-smb.el, tramp-gvfs.el,
tramp-imap.el. All of them add new methods to Tramp. You could try to
study them.

>> And also I only found a CVS repository, something distributed would be
>> better if I want to play with my version.
>> Is there anything or should I use git-import magic?

Until now, being the only continously working Tramp maintainer, I was
too lazy to move somewhere else but cvs. It is on the "maybe we shall
change it" list. If needed, we could use a different dvcs, like git or
bzr. It depends on what supports.

> To make it even more simple, what if we have a list like
> '(('/volumes/arch' . 'arch')...)
> of (paths . name_in_ssh_config)
> What I would want then is that every time I execute a command it's
> executed instead of my local machine on the remote machine.

Tramp offers own implementations for so called "magic file name
handlers". The idea is, that in `file-name-handler-alist' for every such
a primitive function it is checked, whether there is a file name
handler, depending on the syntax of the file name in question.

You find there an entry like

   ("\\`/\\([^[/:]+\\|[^/]+]\\):" . tramp-file-name-handler)

That means, for file names with Tramp's remote file name syntax, the
Tramp implementation for these magic functions is applied.

See (info "(elisp) Magic File Names") for the list of magic functions.

> With some hooks or advising the shell-command could not that work or is
> too ugly/not working?

One could add another entry to `file-name-handler-alist', like

   (cons (reqexp-quote "/volumes/arch") 'sshfs-file-name-handler)

`sshfs-file-name-handler' would add implementations at least for
`file-remote-p', `process-file', `shell-command', `start-file-process'.
Maybe also for other functions, don't know.

This could be part of Tramp, or a package on its own.

Best regards, Michael.

reply via email to

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