Occasionally I use TRAMP mode to edit remote files.
I want to detect if the file open is remote, and if so, get the hostname of the server it's on.
I can't find any buffer-local variable that holds this information, though. tramp-current-host
holds the hostname, but isn't buffer local.