From mboxrd@z Thu Jan 1 00:00:00 1970 From: stardiviner Subject: Re: [ANN] Changes to link syntax Date: Mon, 18 Mar 2019 09:04:25 +0800 Message-ID: <8736nlkn6u.fsf@gmail.com> References: <87sgvusl43.fsf@nicolasgoaziou.fr> <87h8c490eh.fsf@gmail.com> <87wol0tnjr.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]:40968) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h5ghs-0000f2-Ak for emacs-orgmode@gnu.org; Sun, 17 Mar 2019 21:04:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h5gho-0006ey-3c for emacs-orgmode@gnu.org; Sun, 17 Mar 2019 21:04:45 -0400 Received: from [61.175.244.13] (port=19455 helo=dark.localdomain) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h5ghg-0006bA-K0 for emacs-orgmode@gnu.org; Sun, 17 Mar 2019 21:04:40 -0400 In-reply-to: <87wol0tnjr.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: Nicolas Goaziou Cc: emacs-orgmode@gnu.org Nicolas Goaziou writes: > Hello, > > stardiviner writes: > >> Hi, @Nicolas, will you release a method to update all existing Org >> file links? > > This is not limited to file links. > > There is no method that can, with certainty, convert old syntax into the > new one. More accurately, it is possible to convert them with: > > (org-link-escape (org-link-decode URI)) > > but in some cases, it may be difficult to tell when the URI should be > decoded in the first place. > > I suggest to first try the linter on a document. Once we know it detects > with a good ratio links to convert, we can write a wrapper to also > convert them. I agree, but I have so many Org files. #+begin_src sh :async find ~/Org/ -iname "*.org" -print | wc -l #+end_src #+RESULTS[<2019-03-16 16:34:21> d5afbee25c7529c23db70bb758b4bb1e7bdad9a3]: : 9872 So I have to consider a safer and larger method to upgrade link. I can't manually open every Org files and run linter on them. (Maybe linter can run on Org files automatically in programtically way?) Seems I can wait for better solution now. > >> I don't know which special escaped characters need to be converted. > > %20, %25, %5B and %5D. This is helpful, I will try to use external command-line tools to search and replace them. Like ripgrep.el wapper, etc. Then use wgrep mode to query-replace. This might be more safely. I'm wandering whether is it possible to extract my Org links out for testing before I really apply upgrade solution on my mess Org files. Because once I applied method, I will lose original data. Of course I can backup all files. I did backup them regularly about 1 week repeatedly. Also this upgrade experience can help Org Mode figure out a flow about how to do backward compatibility broken steps. That will reduce other user's damage. :) Seems this will keep me spin on before new link syntax commit for a while. I always catch up the latest Org Mode code as I like it so much. > > Regards, Thanks for your working :) -- [ 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