Subject: Re: bug#68976: 30.0.50; Tramp: unexpected error when calling (file-remote-p "/dav:localhost#8000:/foo")

From: Ihor Radchenko <[email-masked]>
Date: Wed, 07 Feb 2024 19:07:02 +0000

Michael Albinus <[email-masked]> writes:

> You are right. It should have returned nil instead of the
> error. `file-remote-p' claims in its docstring
> ...
> --8<---------------cut here---------------start------------->8---
> Test whether FILE specifies a location on a remote system.
> --8<---------------cut here---------------end--------------->8---
> ...
>
> If you want to know, whether a file name has remote file name syntax,
> you should call
>
> (string-match-p tramp-file-name-regexp "/dav:localhost#8000:/foo")
>
> This variable is documented in the Tramp manual, node "(tramp) Change
> file name syntax".

Are you saying that I shouldn't use `file-remote-p'?

For me, the goal is to determine whether file is coming from trusted
place or not. By default, anything non-local (Urls, TRAMP paths, etc)
should not be trusted.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>