unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: michael.albinus@gmx.de, 68976@debbugs.gnu.org
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	[thread overview]
Message-ID: <86wmrgxm2t.fsf@gnu.org> (raw)
In-Reply-To: <87fry4qlcj.fsf@localhost> (message from Ihor Radchenko on Wed, 07 Feb 2024 16:40:12 +0000)

> 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.





  reply	other threads:[~2024-02-07 16:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-07 16:08 bug#68976: 30.0.50; Tramp: unexpected error when calling (file-remote-p "/dav:localhost#8000:/foo") Ihor Radchenko
2024-02-07 16:29 ` Eli Zaretskii
2024-02-07 16:40   ` Ihor Radchenko
2024-02-07 16:42     ` Eli Zaretskii [this message]
2024-02-07 17:59 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-07 19:07   ` Ihor Radchenko
2024-02-08 10:25     ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors

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=86wmrgxm2t.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=68976@debbugs.gnu.org \
    --cc=michael.albinus@gmx.de \
    --cc=yantar92@posteo.net \
    /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).