[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#68976: 30.0.50; Tramp: unexpected error when calling (file-remote-p
From: |
Eli Zaretskii |
Subject: |
bug#68976: 30.0.50; Tramp: unexpected error when calling (file-remote-p "/dav:localhost#8000:/foo") |
Date: |
Wed, 07 Feb 2024 18:42:34 +0200 |
> From: Ihor Radchenko <yantar92@posteo.net>
> Cc: 68976@debbugs.gnu.org, michael.albinus@gmx.de
> Date: Wed, 07 Feb 2024 16:40:12 +0000
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> >> (file-remote-p "/dav:localhost#8000:/foo")
> > ...>
> >> I believe that it is inappropriate that throw an error in such
> >> situation. If "gvfs" is not supported, but still claimed to be remote by
> >> TRAMP, I expect non-nil return value when calling `file-remote-p'; not
> >> an error.
> >
> > What if the "dav:" part was deliberate, i.e. not an accident? That
> > ism the caller did want to access a gvfs remote filesystem. Returning
> > nil in that case would be exactly the wrong thing to do.
>
> I do not suggest returning nil. I suggest to return non-nil rather than
> throwing an error. It would be more appropriate to throw an error when
> opening the file were attempted, not merely checking if that file is
> remote.
I don't know what you mean: Emacs doesn't have any "open file"
operations, it has a "visit file" operation, and that makes all kinds
of tests before actually trying to read the file's contents, to
provide user-friendly diagnostics instead of the cryptic errors
generated by the OS. One of those tests is file-remote-p.
But let's wait for Michael to chime in.