emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] define a new export backend


From: Nicolas Richard
Subject: Re: [O] define a new export backend
Date: Thu, 31 Jul 2014 10:08:06 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.92 (gnu/linux)

Thorsten Jolitz <address@hidden> writes:
> Shiyuan <address@hidden> writes:
>> (org-export-define-derived-backend 'my-html-enlish 'html
>> :traslate-alist '((bold . my-org-html-english-bold))
>
>
> :translate-alist ?

Perhaps org-export-define-derived-backend could do a sanity check that
all keywords are known. use-package does that, and it has saved me
multiple times ! Nicolas, what am I overlooking ?

        Modified   lisp/ox.el
diff --git a/lisp/ox.el b/lisp/ox.el
index 03bd8bb..e931723 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -1187,9 +1187,9 @@ The back-end could then be called with, for example:
 
   \(org-export-to-buffer 'my-latex \"*Test my-latex*\")"
   (declare (indent 2))
-  (let (blocks filters menu-entry options transcoders contents)
+  (let (blocks filters menu-entry options transcoders contents keyword)
     (while (keywordp (car body))
-      (case (pop body)
+      (case (setq keyword (pop body))
        (:export-block (let ((names (pop body)))
                         (setq blocks (if (consp names) (mapcar 'upcase names)
                                        (list (upcase names))))))
@@ -1197,7 +1197,7 @@ The back-end could then be called with, for example:
        (:menu-entry (setq menu-entry (pop body)))
         (:options-alist (setq options (pop body)))
         (:translate-alist (setq transcoders (pop body)))
-        (t (pop body))))
+        (t (error "Unknown keyword in `org-export-define-derived-backend': %s" 
keyword))))
     (org-export-register-backend
      (org-export-create-backend :name child
                                :parent parent

-- 
Nico.



reply via email to

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