From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Neil Jerram <neiljerram@gmail.com>
Cc: Org Mode List <emacs-orgmode@gnu.org>
Subject: Re: [RFC] Fixing link encoding once and for all
Date: Fri, 01 Mar 2019 09:14:06 +0100 [thread overview]
Message-ID: <87lg1znh9t.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <CAKuG=vuBuugR1ZdDaxeCKKcmTGHUd5WBE+ufWUy=Cf1YxDGPNw@mail.gmail.com> (Neil Jerram's message of "Thu, 28 Feb 2019 10:24:26 +0000")
Hello,
Neil Jerram <neiljerram@gmail.com> writes:
> Do you mean Windows file names in existing Org files? I.e. the
> back-compatibility concern?
>
> If so, yes, I confess I didn't think at all about back-compatibility,
> with my suggestion above. So perhaps that rules my idea out.
>
> If we were starting from scratch, however,
> - I believe it would technically be fine; i.e. it's a complete and
> unambiguous encoding
> - it might be considered awkward for Windows users to have to write
> c:\\system32\\mydoc.txt instead of c:\system32\mydoc.txt, but I don't
> know how big a concern that would be.
Thinking a bit more about it, we don't need to escape /all/ square
brackets, only "]]" and "][" constructs. Therefore, we don't need to
escape every backslash either.
The regexp for bracket links could be, in its simple (!) form:
\[\[\(.*?[^\\]\(?:\\\)*\)\]\(?:\[\([^\000]+?\)\]\)?\]
Most links would need no change. I see one notable exception:
directories in Windows:
[[c:\system32\\]] for "c:\system32\"
Some further notes:
1. Macros already use backslashes to escape commas in arguments, so it
is at least consistent with this part of Org.
2. The description part of the link, like most parts of Org, does not
use backslash escaping. If needed, we can implement an entity for
a square bracket.
3. There will be some backward compatibility issues. We can add
a checker in Org Lint to catch most of those. For example, we could
look at URI where every percent is followed only by 25, 5B, and 5D.
WDYT?
Regards,
--
Nicolas Goaziou
next prev parent reply other threads:[~2019-03-01 8:14 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-24 1:16 [RFC] Fixing link encoding once and for all Nicolas Goaziou
2019-02-24 23:04 ` Neil Jerram
2019-02-27 10:48 ` Nicolas Goaziou
2019-02-28 10:24 ` Neil Jerram
2019-03-01 8:14 ` Nicolas Goaziou [this message]
2019-03-01 8:30 ` Nicolas Goaziou
2019-03-01 8:40 ` Michael Brand
2019-03-01 8:41 ` Jens Lechtenboerger
2019-03-01 8:56 ` Nicolas Goaziou
2019-03-01 9:40 ` Jens Lechtenboerger
2019-03-03 6:58 ` stardiviner
2019-03-03 8:08 ` Nicolas Goaziou
2019-03-04 23:16 ` Neil Jerram
2019-03-05 0:23 ` Nicolas Goaziou
2019-03-05 16:27 ` Neil Jerram
2019-03-05 16:36 ` Robert Pluim
2019-02-25 8:54 ` stardiviner
2019-02-27 8:07 ` Jens Lechtenboerger
2019-02-27 11:25 ` Nicolas Goaziou
2019-02-27 12:57 ` Jens Lechtenboerger
2019-02-28 10:51 ` Nicolas Goaziou
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=87lg1znh9t.fsf@nicolasgoaziou.fr \
--to=mail@nicolasgoaziou.fr \
--cc=emacs-orgmode@gnu.org \
--cc=neiljerram@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.