Subject: Re: bug#76457: 31.0.50; Cannot create bookmark to chained TRAMP connection

From: Michael Albinus <[email-masked]>
Date: Fri, 21 Feb 2025 08:08:04 +0100

Sean Whitton <[email-masked]> writes:

> Hello,

Hi Sean,

> I have a role account on a machine where I have to SSH to the machine as
> spwhitton and then use sudo to do things as the role account.
>
> I can get to it like this:
>
>     C-x C-f /ssh:t2u-oracle|sudo:tag2upload-oracle@t2u-oracle:~/ RET
>
> This opens a dired buffer, which is a useful place to start working on
> the machine.
>
> But if I then use C-x r m to create a bookmark to get back there more
> quickly, the bookmark is created with the filename property set to
> "/sudo:tag2upload-oracle@t2u-oracle:~/" which is wrong, as visiting that
> bookmark would try to access an account on localhost.
>
> I can work around this problem by manually editing my bookmarks file.

In my local git repo, there is a pending change of the Tramp manual:

--8<---------------cut here---------------start------------->8---
   • Why saved multi-hop file names do not work in a new Emacs
     session?

     When saving ad-hoc multi-hop TRAMP file names (*note Ad-hoc
     multi-hops::) via bookmarks, recent files, filecache, bbdb, or
     another package, use the full ad-hoc file name including all
     hops, like ‘/ssh:bird@bastion|ssh:news.my.domain:/opt/news/etc’.
     This is achieved by setting the user option
     ‘tramp-show-ad-hoc-proxies’ to non-‘nil’.

     Alternatively, when saving abbreviated multi-hop file names like
     ‘/ssh:[email-masked]:/opt/news/etc’, the user option
     ‘tramp-save-ad-hoc-proxies’ must be set non-‘nil’ value.
--8<---------------cut here---------------end--------------->8---

Does this help?

> Thanks.

Best regards, Michael.