From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aaron Ecay Subject: Re: [RFC] [PATCH] Warn about unexpanded macros on export Date: Sun, 28 Sep 2014 00:00:43 -0400 Message-ID: <87zjdkl7h0.fsf@gmail.com> References: <87k34zqv9r.fsf@gmail.com> <87bnqbv27b.fsf@nicolasgoaziou.fr> <87fvfjow6p.fsf@gmail.com> <8738bi13te.fsf@gmx.us> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59756) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XY5fO-0007oq-I7 for emacs-orgmode@gnu.org; Sun, 28 Sep 2014 00:01:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XY5fI-00044N-Jm for emacs-orgmode@gnu.org; Sun, 28 Sep 2014 00:00:58 -0400 Received: from mail-qg0-x233.google.com ([2607:f8b0:400d:c04::233]:50220) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XY5fI-00043J-ES for emacs-orgmode@gnu.org; Sun, 28 Sep 2014 00:00:52 -0400 Received: by mail-qg0-f51.google.com with SMTP id a108so10476569qge.24 for ; Sat, 27 Sep 2014 21:00:45 -0700 (PDT) In-Reply-To: <8738bi13te.fsf@gmx.us> 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: Rasmus , emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Rasmus, 2014ko irailak 23an, Rasmus-ek idatzi zuen: >=20 > Hi,=20 >=20 > Aaron Ecay writes: >=20 >>> You have two options. Either report an error, as you suggested, or >>> insert an obnoxious message in the output, e.g., "UNKNOWN MACRO", =C3= =A0 la >>> "DEFINITION NOT FOUND." for footnote definitions. In any case, this >>> should happen in "org-macro.el", not in the export framework. >=20 > This is pretty annoying for footnotes. This turned out to be very easy to change; attached is a patch. The links issue (re-)raised by Jacob in is a bit harder to deal with, since each backend currently does something a little different. It would be possible to make every backend=E2=80=99s org-X-link function error out at the end, but I=E2=80=99m= not sure if that=E2=80=99s the right thing to do or not. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0002-export-Raise-an-error-if-footnote-definition-is-not-.patch >From 123d5fcd4f4594c04210ab873395e7def8790450 Mon Sep 17 00:00:00 2001 From: Aaron Ecay Date: Sat, 27 Sep 2014 23:57:01 -0400 Subject: [PATCH 2/2] [export] Raise an error if footnote definition is not found. * lisp/ox.el (org-export-get-footnote-definition): Raise an error if footnote definition is not found. --- lisp/ox.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/ox.el b/lisp/ox.el index 216a375..2516a22 100644 --- a/lisp/ox.el +++ b/lisp/ox.el @@ -3711,12 +3711,12 @@ INFO is the plist used as a communication channel." (defun org-export-get-footnote-definition (footnote-reference info) "Return definition of FOOTNOTE-REFERENCE as parsed data. INFO is the plist used as a communication channel. If no such -definition can be found, return \"DEFINITION NOT FOUND\"." +definition can be found, raise an error." (let ((label (org-element-property :label footnote-reference))) (or (if label (cdr (assoc label (plist-get info :footnote-definition-alist))) (org-element-contents footnote-reference)) - "DEFINITION NOT FOUND."))) + (error "Definition not found for footnote %s" label)))) (defun org-export-get-footnote-number (footnote info) "Return number associated to a footnote. -- 2.1.1 --=-=-= Content-Type: text/plain -- Aaron Ecay --=-=-=--