From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jacob Gerlach Subject: Re: Stop export on bad link? Date: Wed, 20 Aug 2014 13:40:16 -0400 Message-ID: References: <87k36xgzw3.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1133a9b8d821fb05011318cf Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55266) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XK9rw-0001bQ-Rk for emacs-orgmode@gnu.org; Wed, 20 Aug 2014 13:40:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XK9rv-0001XJ-Ce for emacs-orgmode@gnu.org; Wed, 20 Aug 2014 13:40:20 -0400 Received: from mail-lb0-x22c.google.com ([2a00:1450:4010:c04::22c]:36590) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XK9ru-0001XB-VZ for emacs-orgmode@gnu.org; Wed, 20 Aug 2014 13:40:19 -0400 Received: by mail-lb0-f172.google.com with SMTP id z11so7078535lbi.31 for ; Wed, 20 Aug 2014 10:40:16 -0700 (PDT) In-Reply-To: <87k36xgzw3.fsf@bzg.ath.cx> 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-orgmode@gnu.org --001a1133a9b8d821fb05011318cf Content-Type: text/plain; charset=UTF-8 On Sun, Jul 27, 2014 at 7:27 AM, Bastien wrote: > Hi Jacob, > > Jacob Gerlach writes: > > > Is it possible to configure the exporter to stop and throw an error > > for a bad link? > > No. But what is really a "bad link"? Is it bad because it cannot be > exported to a specific backend? > By bad, I meant a link that can't be resolved (perhaps because of a typo). Org already handles this by formatting the "bad" link with texttt in latex. For example: ----- * First In [[frst]], we see the ECM. ----- Exports to: ----- \section{First} \label{sec-1} In \texttt{frst}, we see the ECM. ----- Whereas ---- * First In [[First]], we see the ECM. ---- exports as: ---- \section{First} \label{sec-1} In \ref{sec-1}, we see the ECM. ---- After further digging, I found org-latex-link-with-unknown-path-format. Since I usually export directly to pdf, I can achieve my desired result by customizing this variable to some undefined control sequence (i.e. \BADLINK), in which case latex complains, but I have to hunt down the error in the *Org PDF LaTeX Output* buffer. It would be great if the export would just quit and move point to the offending link > > -- > Bastien > --001a1133a9b8d821fb05011318cf Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On S= un, Jul 27, 2014 at 7:27 AM, Bastien <bzg@gnu.org> wrote:
Hi Jacob,

Jacob Gerlach <jacobgerlach@gm= ail.com> writes:

> Is it possible to configure the exporter to stop and throw an error > for a bad link?

No.=C2=A0 But what is really a "bad link"?=C2=A0 Is it bad = because it cannot be
exported to a specific backend?

By bad, I meant a link that can't be resolved (perhaps because of a t= ypo). Org already handles this by formatting the "bad" link with = texttt in latex. For example:

-----
* First
In [[frst]], we see the ECM.
-----
Exports to:
-----
\section{First}
\label{sec-1}
In \= texttt{frst}, we see the ECM.
-----

Whereas=C2=A0
----
* First
In [[First]], we see the ECM.
----
=
= exports as:
= ----
\section{First}
\label{sec-1}
In \ref{se= c-1}, we see the ECM.
----

After further digging, I found=C2=A0org-latex-link-with-unknown-path-format= . Since I usually export directly to pdf, I can achieve my desired result b= y customizing this variable to some undefined control sequence (i.e. \BADLI= NK), in which case latex complains, but I have to hunt down the error in th= e=C2=A0*Org PDF LaTeX Output* buffer. It would be great if the export would= just quit and move point to the offending link
=C2=A0

--
=C2=A0Bastien

--001a1133a9b8d821fb05011318cf--