Hi,

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.

I did an apropos search and found `tramp-current-method`, but this variable
is not buffer-local.

I tried `tramp-mode`, but again, this is not buffer-local.

In my version of tramp, 2.3.3.26.1, only `tramp-temp-buffer-file-name` and
`tramp-rfn-eshadow-overlay` are buffer-local, neither of which seem useful
for my purpose.

Other than parsing the buffer-name, is there a good way to distinguish
tramp from non-tramp buffers?

I also noticed on tramp buffers, buffer-name returns a list like:

    #("filename</sudo:root@hostname:>" 16 20 (tramp-default t))

Is this behavior documented and can I rely on it? In my build, the
buffer-name doc says buffer-name should be a string:

    buffer-name is a built-in function in ‘C source code’.

    (buffer-name &optional BUFFER)

    Return the name of BUFFER, as a string.
    BUFFER defaults to the current buffer.
    Return nil if BUFFER has been killed.

Thanks,

Ernesto
_______________________________________________
Tramp-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/tramp-devel

Reply via email to