Eyoel Yohannes <[email protected]> writes:

> I’ve run into what appears to be a bug in org-link-open-from-string while
> trying to extend Org Mode for my own uses; when a file URI contains spaces,
> only the portion before the first space gets honored.
>
> Steps to reproduce
> --------------------
> In Emacs + Org-Mode, evaluate one or any of the following:
>
>    (org-link-open-from-string "file:/mnt/c/Program Files/Go/bin/go.exe")
>    (org-link-open-from-string "file:/mnt/c/Program\ Files/Go/bin/go.exe")
>    (org-link-open-from-string "file:/mnt/c/Program\\ Files/Go/bin/go.exe")
>
> Actual behavior
> --------------------
> Only “/mnt/c/Program” is opened; the “ Files/Go/bin/go.exe” suffix is
> dropped.
> With a single backslash before the space in the string, it would ignore the
> whitespace and open "/mnt/c/ProgramFiles/Go/bin/go.exe", which is different
> from "/mnt/c/Program Files/Go/bin/go.exe"
>
> Expected behavior
> --------------------
> The entire path, “/mnt/c/Program Files/Go/bin/go.exe”, should be resolved
> and opened.

The problem is that "file:/foo/bar<space>baz" is not a valid Org
link. It is a link followed by "baz". If you want to create link with
spaces using Org markup, use "<file:/foo/bar baz>" or "[[file:/foo/bar baz]]"

I now made `org-link-open-from-string' throw an error in such scenario.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=1f6579357
Fixed.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
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>

Reply via email to