From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: non-standard link errors Date: Mon, 29 Feb 2016 19:10:34 +0100 Message-ID: <87wppnz8th.fsf@nicolasgoaziou.fr> References: <87vb5bdtl2.fsf@nicolasgoaziou.fr> <874mctck6y.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51629) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaSFI-0003Kd-4s for emacs-orgmode@gnu.org; Mon, 29 Feb 2016 13:08:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aaSFD-0008Ql-1o for emacs-orgmode@gnu.org; Mon, 29 Feb 2016 13:08:36 -0500 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:35729) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaSFC-0008QZ-N2 for emacs-orgmode@gnu.org; Mon, 29 Feb 2016 13:08:30 -0500 In-Reply-To: (Skip Collins's message of "Sun, 28 Feb 2016 23:04:24 -0500") 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 Cc: emacs-org list 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, -- Nicolas Goaziou