unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Aleksei Fedotov <aleksei@fedotov.email>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: 53223@debbugs.gnu.org
Subject: bug#53223: 27.2; multi-hop TRAMP with find-file-visit-truename t
Date: Thu, 13 Jan 2022 21:54:02 +0100	[thread overview]
Message-ID: <87sftr73x1.fsf@hp.cfotr.com> (raw)
In-Reply-To: <87a6fzpwfr.fsf@gmx.de> (Michael Albinus's message of "Thu, 13 Jan 2022 15:00:40 +0100")

>> I've spotted a problem with TRAMP when using multi-hop ssh with
>> find-file-visit-truename set to t.
>>
>> Assuming that there is a remote machine XXX.YYY.com with SSH server. On local
>> machine I run emacs like that:
>>
>>> emacs -Q --eval '(progn \
>>>       (require (quote tramp)) \
>>>       (setq find-file-visit-truename t) \
>>>       (with-current-buffer (find-file "/ssh:root@XXX.YYYY.com|ssh:localhost:") \
>>>       (tramp-cleanup-all-connections) \
>>>       (revert-buffer)))'
>>
>> It successfully connects to the remote machine and opens dired buffer with the
>> correct content, but the filename name in the dired header is not
>> '/ssh:XXX.YYYY.com|ssh:localhost:' as I might expect, but
>> '/ssh:localhost:/root:'. After (revert-buffer) I get an error in *Messages*:
>>
>>> tramp-handle-access-file: Reading directory: No such file or directory /ssh:localhost:/root/
>>
>> The issue does not reproduce if find-file-visit-truename set to nil. It looks like 'file-truename' doesn't work correctly with multi-hop tramp file names.
>
> Tramp behaves as expected. You use an ad-hoc multi-hop remote file
> name. Such ad-hoc definitions are removed when you call
> `tramp-cleanup-all-connections'. This is described in the Tramp manual
> (info "(tramp) Ad-hoc multi-hops")
> (info "(tramp) Cleanup remote connections")
>
> If you want to keep multi-hop definitions permanently, configure
> `tramp-default-proxies-alist' as described in the Tramp manual, or set
> `tramp-save-ad-hoc-proxies' to t. See (info "(tramp) Multi-hops")

It works exactly as described in the documentaion, but what is bothering me is
the difference in behaviour depending on the state of
`find-file-visit-truename'. It should only affect symlink resolution, but it
also changes Tramp behaviour.

If `find-file-visit-truename' is set to nil, then Tramp is able to revert the
buffer and add a multi-hop definition back to `tramp-default-proxies-alist'.
If `find-file-visit-truename' is set to t, then it doesn't work. Shouldn't the
buffer somehow preserve the full path?

-- 
Aleksei





  reply	other threads:[~2022-01-13 20:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-12 21:23 bug#53223: 27.2; multi-hop TRAMP with find-file-visit-truename t Aleksei Fedotov
2022-01-13 14:00 ` Michael Albinus
2022-01-13 20:54   ` Aleksei Fedotov [this message]
2022-01-13 22:38     ` Michael Albinus
2022-02-23  8:40       ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sftr73x1.fsf@hp.cfotr.com \
    --to=aleksei@fedotov.email \
    --cc=53223@debbugs.gnu.org \
    --cc=michael.albinus@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).