emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [RFC] [PATCH] Warn about unexpanded macros on export


From: Nicolas Goaziou
Subject: Re: [O] [RFC] [PATCH] Warn about unexpanded macros on export
Date: Fri, 19 Sep 2014 21:29:28 +0200

Hello,

Aaron Ecay <address@hidden> writes:

> Currently, if a macro is not defined, it will silently produce an empty
> string while exporting.  This situation could arise for example if a
> macro name is acidentally mistyped.  I think it’s desirable to warn the
> user in this case.  The attached patch introduces a function to do so,
> and shows how it would be integrated in the latex backend.  This raises
> several questions:
>
> 1. Should the warning be a “message” (allows the export process to
>    continue) or a “user-error” (stops the export process)?  Or, should
>    this be configurable?

Certainly not a message, due to asynchronous export.

> 2. Since this is a feature that many backends will want to use, should
>    we introduce a new “abstract” backend from which other backends can
>    inherit, which incorporates this feature, and others like it in the
>    future?  The idea would be similar to prog-mode in emacs, the major
>    mode from which programming-language modes can derive.  The
>    alternative is adding the (macro . org-export-macro-warn) entry
>    manually to all the relevant backends, and relying on future backend
>    authors to do the same.
>
> 3. Should this even be implemented as part of the backend’s
>    translate-alist, or at a lower level?

Don't bother with export back-ends, they never get to see macros, which
are expanded very early in the export process. This explains, for
example, why there is no `macro' translator.

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.


Regards,

-- 
Nicolas Goaziou



reply via email to

[Prev in Thread] Current Thread [Next in Thread]