Subject: bug#58464: 28.1; browse-url-emacs doesn't work for local files on Windows

From: Eli Zaretskii <[email-masked]>
Date: Wed, 12 Oct 2022 16:13:58 +0300

> Cc: [email-masked]
> From: Lars Ingebrigtsen <[email-masked]>
> Date: Wed, 12 Oct 2022 13:09:41 +0200
> 
> Pascal Quesseveur <[email-masked]> writes:
> 
> > emacs -Q
> > (browse-url-emacs "file://C:/Windows/win.ini") -> Emacs hangs, nothing
> > is displayed, C-g
> 
> That's the wrong syntax, but Emacs shouldn't hang...

Emacs 29 doesn't hang, at least on my system.

> > (browse-url-emacs "file:///C:/Windows/win.ini") -> file content is
> > displayed, Message buffer contains:
> >
> > File exists, but cannot be read
> > #<buffer win.ini</Windows>>
> 
> So it works fine when you use the right syntax for the URL, but the
> problem is the misleading message?

No, the misleading message is likely just a symptom of the root
cause.  The root cause is that the buffer-file-name is set
incorrectly, and likewise the default-directory.

It could be that the original problem (with displaying images given by
the file:// URL) doesn't work, but that is not yet certain, AFAIU.