emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Build fail with emacs 24.3.1


From: Bastien
Subject: Re: [O] Build fail with emacs 24.3.1
Date: Thu, 14 Mar 2013 03:30:39 +0100
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux)

Achim Gratz <address@hidden> writes:

> This likely indicates that eager macro
> expansion is involved (one of the new things in Emacs 24.3) and may be a
> hint that the macro definition itself might need attention.

Thanks for the hint.  The two failing subtests are these:

   (should
    (equal '((:headline . test) (:headline . parent))
          (let (org-export-registered-backends)
            (org-export-define-backend parent ((:headline . parent)))
            (org-export-define-derived-backend test parent
              :translate-alist ((:headline . test)))
            (org-export-backend-translate-table 'test))))

and

   (should
    (let (org-export-registered-backends)
      (org-export-define-backend test ((headline . test)))
      (org-export-define-derived-backend test2 test)
      (org-export-define-derived-backend test3 test2)
      (org-export-derived-backend-p 'test3 'test)))

One potential problem in the first test is the use of "parent" as the
name of the symbol to pass to the macro... since this is the very same
name than the macro second argument.  At least this reminded me this
section of Elisp manual:

  13.5.4 Evaluating Macro Arguments in Expansion

But changing the name of the backend to e.g. testparent does not make
the test to pass -- so my guess is wrong.

A more obvious problem with the second subtest is the repeated call to
the same macro (which has side-effects, of course).  I checked:

  13.5.5 How Many Times is the Macro Expanded?

... 

So... instead of fixing the macro calls in the tests, I've been
wondering why using a macro for `org-export-define-derived-backend'
and `org-export-define-backend' would be better?

I actually think a defun would be good enough.

For what I can see, the use of a macro is cosmetic here (maybe to
avoid too many ' for the macros arguments?  Dunno.)

Here is a patch that replace these two macros with defuns, fix
the exporters definitions and the tests.  All tests pass fine.

Nicolas, would you be okay with this change?

This may impact several documents you've written, so I'd fix
them if you tell me which they are.  

Thanks!

Attachment: 0001-Use-defuns-for-org-export-define-backend-and-org-exp.patch
Description: Text Data

-- 
 Bastien

reply via email to

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