tramp-devel
[Top][All Lists]
Advanced

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

Re: distinguish tramp from non-tramp buffer


From: Ernesto Alfonso
Subject: Re: distinguish tramp from non-tramp buffer
Date: Fri, 10 Aug 2018 09:51:38 -0700

Thanks Michael, that seems to work.

Ernesto

On Fri, Aug 10, 2018 at 6:04 AM Michael Albinus <address@hidden> wrote:
Ernesto Alfonso <address@hidden> 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.

reply via email to

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