emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: "Mark E. Shoulson" <mark@shoulson.com>
Cc: org-mode mailing list <emacs-orgmode@gnu.org>
Subject: Re: Spaces in bare URLs?
Date: Wed, 18 Mar 2020 10:43:50 +0100	[thread overview]
Message-ID: <875zf2gfqh.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <78f598f3-44e1-63aa-751a-49c2f7208fe7@kli.org> (Mark E. Shoulson's message of "Tue, 17 Mar 2020 22:14:01 -0400")

Hello,

"Mark E. Shoulson" <mark@shoulson.com> writes:

> So, in the "new" org-mode, we've done away with standard
> percent-encoding of URLs, in favor of a more... idiosyncratic method
> using backslashes.

...

> So... what is one supposed to do about spaces in URLs? 
> When they're in [[link format]], with or without a description, it's no problem, but org-mode has a long tradition of support for "bare" URLs too.  We're used to being able to type a URL or other link format
> and have it work, right?  And that doesn't seem (to me) to be a thing
> that we'd want to abandon.
>
> In org-mode 9.1.9, I can type "info:elisp#Syntactic%20Font%20Lock" and it'd work.  (Maybe not the greatest example, since %-encoding is seen more with http-based URIs, but still).  The
> percent-encoding is well-established and reliable

Unfortunately, that wasn't reliable. As it is not idempotent, you can
never know how many times you need to decode an URL before sending it.

Imagine I have a file called "foo%2000.org". Should I link it
file:foo%252000.org or file:foo%2000.org? You prefer the former. But
what if I forget about the rules?

Now, what Org is expected to do with file:foo%252000.org ? Decoding it
unconditionally lead to bug reports scattered throughout the years. So
did ignoring encoding.

The thing is URL encoding is not for human consumption, i.e., we
shouldn't have to deal with it.

> and you can *count* on it when nothing else works, because you can
> always fall back on plain ascii.  

Current backslash escaping is also well established, and as much
ASCII-like as anyone would expect.

> But that won't work in org-mode 9.3.6.  Nor will
> "info:elisp#Syntactic Font Lock" or "info:elisp#Syntactic\ Font\ Lock"
> or any other variant I've tried, short of putting it inside [[]]s or
> <>s (in other words, no longer using a bare URL).

True, but that's a minor annoyance.

You apparently prefer to encode a URL manually, replacing each space
with %20 (and other characters with more baroque escape sequences),
rather than adding <...> (or [[...]]) around it and be done with it.
Perhaps this one was the bad idea, after all?

> I think dropping percent-escaping of URLs was a bad idea, in terms of breaking past usage and lack of consistency with the standard used for URLs everywhere else.  But I don't know what impelled the
> decision to drop it, so I might well be missing something important.  
>
> At any rate, it does leave a hole in what org-mode can do, a thing it used to be able to do and can't anymore.  Is there a right way to do
> this?  (without using delimiters.)

It was not a bad idea. It is not perfect, but it is still better than
what we had, because it is unambiguous.

You can still use <...> delimiters, or, as you noted, [[...]].
I understand it breaks your workflow, but there is no loss of feature,
and no hole either: you can still link to URL with spaces in it.

Regards,

-- 
Nicolas Goaziou

  reply	other threads:[~2020-03-18  9:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-18  2:14 Spaces in bare URLs? Mark E. Shoulson
2020-03-18  9:43 ` Nicolas Goaziou [this message]
2020-03-18 20:25   ` Mark E. Shoulson

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.orgmode.org/

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

  git send-email \
    --in-reply-to=875zf2gfqh.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=mark@shoulson.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 public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.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).