emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Aaron Ecay <aaronecay@gmail.com>
To: Rasmus <rasmus@gmx.us>, emacs-orgmode@gnu.org
Subject: Re: [RFC] [PATCH] Warn about unexpanded macros on export
Date: Sun, 28 Sep 2014 00:00:43 -0400	[thread overview]
Message-ID: <87zjdkl7h0.fsf@gmail.com> (raw)
In-Reply-To: <8738bi13te.fsf@gmx.us>

[-- Attachment #1: Type: text/plain, Size: 907 bytes --]

Hi Rasmus,

2014ko irailak 23an, Rasmus-ek idatzi zuen:
> 
> Hi, 
> 
> Aaron Ecay <aaronecay@gmail.com> writes:
> 
>>> You have two options. Either report an error, as you suggested, or
>>> insert an obnoxious message in the output, e.g., "UNKNOWN MACRO", à la
>>> "DEFINITION NOT FOUND." for footnote definitions. In any case, this
>>> should happen in "org-macro.el", not in the export framework.
> 
> 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
<http://mid.gmane.org/CAA6UvuFm-1nWD06A5o3HwSvEQmgqLJNcfK_PtoHSEhcVdJTYQw@mail.gmail.com>
is a bit harder to deal with, since each backend currently does
something a little different.  It would be possible to make every
backend’s org-X-link function error out at the end, but I’m not sure if
that’s the right thing to do or not.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0002-export-Raise-an-error-if-footnote-definition-is-not-.patch --]
[-- Type: text/x-diff, Size: 1285 bytes --]

From 123d5fcd4f4594c04210ab873395e7def8790450 Mon Sep 17 00:00:00 2001
From: Aaron Ecay <aaronecay@gmail.com>
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


[-- Attachment #3: Type: text/plain, Size: 15 bytes --]

-- 
Aaron Ecay

  reply	other threads:[~2014-09-28  4:01 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-19 19:12 [RFC] [PATCH] Warn about unexpanded macros on export Aaron Ecay
2014-09-19 19:29 ` Nicolas Goaziou
2014-09-23  3:25   ` Aaron Ecay
2014-09-23 16:59     ` Grant Rettke
2014-09-23 17:18       ` Aaron Ecay
2014-09-23 17:29         ` Jacob Gerlach
2014-09-23 21:10           ` Nicolas Goaziou
2014-09-23 20:24     ` Nicolas Goaziou
2014-09-28  3:53       ` Aaron Ecay
2014-09-28  6:59         ` Nicolas Goaziou
2014-10-12 15:48           ` Aaron Ecay
2014-09-23 20:26     ` Rasmus
2014-09-28  4:00       ` Aaron Ecay [this message]
2014-09-28  7:03         ` Nicolas Goaziou
2014-10-12 15:49           ` Aaron Ecay
2014-10-12 17:19             ` Nicolas Goaziou
2015-03-12  2:55           ` Jacob Gerlach
2015-03-15  8:44             ` Nicolas Goaziou
2015-03-17 16:20               ` Jacob Gerlach
2015-03-17 22:38                 ` Nicolas Goaziou
2015-03-18 20:25                   ` Jacob Gerlach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zjdkl7h0.fsf@gmail.com \
    --to=aaronecay@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=rasmus@gmx.us \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).