From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Thum Subject: Re: non-standard link errors Date: Wed, 2 Mar 2016 10:11:11 +0100 Message-ID: <56D6AE2F.8000103@gmx.de> References: <87vb5bdtl2.fsf@nicolasgoaziou.fr> <874mctck6y.fsf@nicolasgoaziou.fr> <87wppnz8th.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58771) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ab2nW-0003RJ-LA for emacs-orgmode@gnu.org; Wed, 02 Mar 2016 04:10:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ab2nS-0003v3-Kr for emacs-orgmode@gnu.org; Wed, 02 Mar 2016 04:10:22 -0500 Received: from mout.gmx.net ([212.227.15.18]:53533) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ab2nS-0003ug-Al for emacs-orgmode@gnu.org; Wed, 02 Mar 2016 04:10:18 -0500 In-Reply-To: <87wppnz8th.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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Skip Collins , emacs-org list , Nicolas Goaziou Hi, this reminds me of my issue with tel: links. I also would have preferred to have them exported "pass-through", but AFAICT this requires me to come up with a trival function for every possible backend: those I know, those I don't, and those that may not exist yet. I cannot switch to the raw: solution (due to vcard export). I'm not currently experiencing problems, but I would like to suggest that maybe such a trival default handler could be added to the backends as some well-known property to be available to those who set the broken link handler to e.g. 'fallback. The onus would be on the user to do this, since correctness of output may suffer. Of course, basic sanitation should still be done in such a handler, but preferably no spectacular failure*. Cheers, Simon (*) Because I sync using org exporter, I tend to suffer from those. And yes, I'd rather have wrong output I can diagnose than nothing. On 02/29/2016 07:10 PM, Nicolas Goaziou wrote: > Hello, > > Skip Collins writes: > >> I have come up with a better solution than globally passing "broken" >> links. I defined a new "raw" link type. So now if I want to put a >> non-standard link in my export, I can do something like: >> Here is a [[raw:foo:/\bar, baz][bad link]]. >> which is exported in html as: >> Here is a bad link. >> >> Now I can have non-standard links included in the output without >> disabling link checking for all standard link types. This is how it is >> defined in my .emacs: >> (org-add-link-type "raw" 'org-raw-follow 'org-raw-export) >> (defun org-raw-follow (path)) >> (defun org-raw-export (path desc format) >> "Export a raw link. >> See `org-add-link-type' for details about PATH, DESC and FORMAT." >> (cond >> ((eq format 'html) (format "%s" path desc)) >> ((eq format 'latex) (format "\\href{%s}{%s}" path desc)) >> ((eq format 'ascii) (format "%s (%s)" desc path)) >> (t path))) >> >> Perhaps this could be included in the standard Org distribution as a >> fallback option for exporting non-standard link types. Emacs/Org does >> nothing with the link. The user is responsible for ensuring the output >> is correct. > > This is already the default behavior for custom types. You don't even > need to use `org-raw-export' or `org-raw-open'. All is needed, is > > (org-add-link-type "raw") > > Org requires it so it can tell if the link is an internal link or not. > However, I don't think we need to introduce a particular link type for > that. Users can define whatever they want. > > > Regards, >