all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Augusto Stoffel <arstoffel@gmail.com>
Cc: pquessev@gmail.com, emacs-devel@gnu.org
Subject: Re: browse-url and URL handlers (MS-Windows)
Date: Tue, 11 Oct 2022 19:36:50 +0300	[thread overview]
Message-ID: <83ilkqe2ql.fsf@gnu.org> (raw)
In-Reply-To: <87fsfuee22.fsf@gmail.com> (message from Augusto Stoffel on Tue,  11 Oct 2022 14:32:21 +0200)

> From: Augusto Stoffel <arstoffel@gmail.com>
> Cc: emacs-devel@gnu.org
> Date: Tue, 11 Oct 2022 14:32:21 +0200
> 
> > Type C-c C-c or C-c C-x to view the image as an image or hex.
> > Cannot display image: ( *mm*-273075 1 8193)
> > #<buffer kk01.jpg>
> >
> > I don't konw if this is because of the incorrectly reported read error
> > when opening the file.  When the file content is displayed in the
> > buffer I can view the image with C-c C-c.
> 
> I've come across issues with file URLs in Windows before, and the
> problem was that
> 
>   (url-filename (url-generic-parse-url "file:///C:/some/file"))
> 
> returns "/C:/some/file", with an extra slash at the beginning.

Is the below the right fix?

diff --git a/lisp/url/url-parse.el b/lisp/url/url-parse.el
index 91f47d0..cc3e236 100644
--- a/lisp/url/url-parse.el
+++ b/lisp/url/url-parse.el
@@ -201,6 +201,9 @@ url-generic-parse-url
 	    (when (looking-at "\\?")
 	      (skip-chars-forward "^#"))
 	    (setq file (buffer-substring save-pos (point)))
+            (if (and (eq system-type 'windows-nt)
+                     (string-match-p "/[A-Z]:/" file))
+                (setq file (substring file 1)))
 	    ;; 3.5 Fragment
 	    (when (looking-at "#")
 	      (let ((opoint (point)))



  parent reply	other threads:[~2022-10-11 16:36 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-03  9:44 browse-url and URL handlers (MS-Windows) Pascal Quesseveur
2022-10-03 20:42 ` Stefan Kangas
2022-10-05  8:11 ` Tassilo Horn
2022-10-05 16:21   ` Pascal Quesseveur
2022-10-11 10:04   ` Pascal Quesseveur
2022-10-11 12:32     ` Augusto Stoffel
2022-10-11 15:31       ` Pascal Quesseveur
2022-10-11 16:36       ` Eli Zaretskii [this message]
2022-10-11 16:59         ` Pascal Quesseveur
2022-10-11 17:16           ` Eli Zaretskii
2022-10-12  7:20             ` Pascal Quesseveur
2022-10-11 17:45         ` Augusto Stoffel
2022-10-11 18:50         ` Stefan Monnier
2022-10-11 17:23       ` Lars Ingebrigtsen
2022-10-11 17:39         ` Eli Zaretskii
2022-10-11 18:04           ` Lars Ingebrigtsen
2022-10-11 18:21             ` Eli Zaretskii
2022-10-11 18:24               ` Lars Ingebrigtsen
2022-10-11 19:27                 ` Eli Zaretskii
2022-10-11 19:32                   ` Lars Ingebrigtsen
2022-10-12  6:54                     ` Pascal Quesseveur
2022-10-11 18:52             ` Lars Ingebrigtsen
2022-10-11 19:16               ` Eli Zaretskii
2022-10-12  7:25               ` Augusto Stoffel
2022-10-11 17:43         ` Augusto Stoffel

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

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

  git send-email \
    --in-reply-to=83ilkqe2ql.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=arstoffel@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=pquessev@gmail.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.