From mboxrd@z Thu Jan 1 00:00:00 1970 From: Skip Collins Subject: Re: non-standard link errors Date: Sun, 28 Feb 2016 23:04:24 -0500 Message-ID: References: <87vb5bdtl2.fsf@nicolasgoaziou.fr> <874mctck6y.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50397) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaF4f-00011m-H2 for emacs-orgmode@gnu.org; Sun, 28 Feb 2016 23:04:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aaF4e-00034I-KK for emacs-orgmode@gnu.org; Sun, 28 Feb 2016 23:04:45 -0500 Received: from mail-qg0-x22e.google.com ([2607:f8b0:400d:c04::22e]:33614) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaF4e-000346-G5 for emacs-orgmode@gnu.org; Sun, 28 Feb 2016 23:04:44 -0500 Received: by mail-qg0-x22e.google.com with SMTP id d32so51318720qgd.0 for ; Sun, 28 Feb 2016 20:04:44 -0800 (PST) In-Reply-To: <874mctck6y.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: emacs-org list Nicolas Goaziou wrote: > Not that I'm against the idea, but wouldn't it be a poor way to properly > fix the issue, i.e., add new link types? 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.