tramp-devel
[Top][All Lists]
Advanced

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

Re: No longer accessible host paths


From: Michael Albinus
Subject: Re: No longer accessible host paths
Date: Sun, 03 Nov 2019 11:36:07 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

JD Smith <address@hidden> writes:

Hi,

> Tramp (2.3.5.26.2) commonly hangs my Emacs session in the following
> scenario:
>
> * On an internal network at my work, I visit a file via:
>
> * /ssh:someinternalpath.foo.bar:file
>
> * I continue to edit the file after leaving the internal network.
> * Later, on another network (at home, etc.) Tramp can no longer access
>   the file via someinternalpath.foo.bar.  File operations, write
>   attempts, etc. hang as Tramp tries in vain to reach the host via a
>   no longer reachable hostname/path.
> * The various `tramp-cleanup-*` commands do nothing for this problem,
>   since they assume the host is still reachable via the original
>   hostname, and merely reset the cached information.
> * I can at this point kill the buffer (or Emacs, if hung), and visit
>   the file using
>
> * /ssh:hopserver.bar.baz|ssh:someinternalpath.foo.bar:file
>
> * but there is no way to save or write the changes in my local buffer.
>    So this often hangs Emacs and loses the changes.

So why doesn't work

M-x tramp-cleanup-all-connections
C-x w ;; in a remote buffer

The second command, write-file, should ask you for a new file name. This
includes editing the host name.

> Is there some what to effect a `tramp-reset-host` so that a buffer
> will be marked as no longer visiting any file, and will re-prompt you
> for a filename so you can write your changes?

No, such a command does not exist. There is the danger that if you have
a modified buffer, and you remove the buffer-file-name, this buffer is
not covered by auto-save, nor by "C-x s" (save-some-buffers), nor by
"C-x C-c" (save-buffers-kill-terminal). I, for example, count on this
behavior, because I'm notorious in *not* saving buffers.

> Or perhaps a `tramp-change-hostpath` so you can re-enter the (possibly
> multi-hop) host path to the file?

That's a good idea. Will see how to implement it. It shall be a bulk
renaming, for all buffers related to the respective host.

The bulk renaming shall be only for the remote part of a file name,
including existing multi-hops. For the local part, we cannot assume that
a file is located at the very same location on the other host. So Emacs
must go through all related buffers, and offer to edit the new file
name, with the default "/method:newhost:/same/path/to/file".

WDYT?

> If not, this would be a great feature for those who work with networks
> that have different hostpaths from inside and outside the network. It
> would also be ideal if an unreachable host timed out and gave you the
> option to reset or re-enter the host path as well.
>
> Thanks for Tramp.  I use it daily (and usually love it!).

Best regards, Michael.



reply via email to

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