From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Regression: org-translate-link doesn't work correctly in Org 8.3 Date: Wed, 19 Aug 2015 15:28:18 +0200 Message-ID: <87r3mz8l1p.fsf@nicolasgoaziou.fr> References: <87bne3mv78.fsf@gnu.org> <877fora7fz.fsf@nicolasgoaziou.fr> <87pp2jtumi.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55272) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZS3O8-0002Lb-8C for emacs-orgmode@gnu.org; Wed, 19 Aug 2015 09:26:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZS3O7-0005Ta-Ge for emacs-orgmode@gnu.org; Wed, 19 Aug 2015 09:26:44 -0400 In-Reply-To: <87pp2jtumi.fsf@gnu.org> (Bastien's message of "Wed, 19 Aug 2015 12:55:49 +0200") 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Bastien Cc: Sergei Nosov , emacs-orgmode@gnu.org Bastien writes: > Nicolas Goaziou writes: > >> I think `org-translate-link' should be updated to provide correct type, >> including internal ones, to `org-link-translation-function'. E.g., >> >> http://orgmode.org => "http" >> #something => "custom-id" >> (ref:line) => "coderef" >> whatever => "fuzzy" >> >> At least, this would be consistent with the parser. > > Agreed. Done. There is one foreseeable incompatible change however. When link type is unknown to Org, it is reported as fuzzy, e.g.: [[foobar:something]] is seen as ("fuzzy" "foobar:something") by `org-link-translation-function', not ("foobar" "something"), unless "foobar" belong to `org-link-types'. In practice I don't think it matters because `org-link-translation-function' isn't meant to create new link types but handle conflicting link types. In any case, in the example above, one can always use (when (and (string= type "fuzzy") (string-match "\\(.*?\\):\\(.*\\)" path)) (cons (match-string 1) (match-string 2))) in `org-link-translation-function'. Regards,