Ernesto Alfonso <> writes:

> Hi,

Hi Ernesto,

> I'm not too familiar with tramp internals and I was looking for a way
> to easily determine whether a given buffer is using tramp or not, and
> optionally to determine the method in use.

The buffer-local variable `default-directory' will help. It gives always
the default directory of a buffer, independent whether a file is visiting
this buffer or not.

If (file-remote-p default-directory) returns non-nil, the buffer is
related to Tramp. Even better, (file-remote-p default-directory 'method)
returns the connection method.
> Thanks,
> Ernesto

Best regards, Michael.

Tramp-devel mailing list

Reply via email to