From mboxrd@z Thu Jan 1 00:00:00 1970 From: stardiviner Subject: Re: [RFC] Fixing link encoding once and for all Date: Sun, 03 Mar 2019 14:58:35 +0800 Message-ID: <874l8kh2as.fsf@gmail.com> References: <87tvguyohn.fsf@nicolasgoaziou.fr> <87sgw9cxr8.fsf@nicolasgoaziou.fr> <87lg1znh9t.fsf@nicolasgoaziou.fr> Reply-To: numbchild@gmail.com Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([209.51.188.92]:42309) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h0L57-0001QI-TX for emacs-orgmode@gnu.org; Sun, 03 Mar 2019 01:58:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h0L56-00058c-VL for emacs-orgmode@gnu.org; Sun, 03 Mar 2019 01:58:41 -0500 Received: from [61.175.244.13] (port=12420 helo=dark.localdomain) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h0L56-00055c-H3 for emacs-orgmode@gnu.org; Sun, 03 Mar 2019 01:58:40 -0500 In-reply-to: <87lg1znh9t.fsf@nicolasgoaziou.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org Cc: Neil Jerram Nicolas Goaziou writes: > Hello, > > Neil Jerram 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. > About this, I'm curious, is it possible let this checker search and interactive query replace with running recursively in a directory for all Org files. If Org updated, I hope my Org documents are update too. > WDYT? > > Regards, -- [ stardiviner ] I try to make every word tell the meaning what I want to express. Blog: https://stardiviner.github.io/ IRC(freenode): stardiviner, Matrix: stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3