From: Nicolas Richard <theonewiththeevillook@yahoo.fr>
To: Thorsten Jolitz <tjolitz@gmail.com>
Cc: emacs-orgmode@gnu.org, Nicolas Goaziou <mail@nicolasgoaziou.fr>
Subject: Re: define a new export backend
Date: Thu, 31 Jul 2014 10:08:06 +0200 [thread overview]
Message-ID: <877g2uymqh.fsf@geodiff-mac3.ulb.ac.be> (raw)
In-Reply-To: <87bns69eeo.fsf@gmail.com> (Thorsten Jolitz's message of "Thu, 31 Jul 2014 09:27:11 +0200")
Thorsten Jolitz <tjolitz@gmail.com> writes:
> Shiyuan <gshy2014@gmail.com> 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.
next prev parent reply other threads:[~2014-07-31 8:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-31 7:11 define a new export backend Shiyuan
2014-07-31 7:27 ` Thorsten Jolitz
2014-07-31 8:08 ` Nicolas Richard [this message]
2014-07-31 8:39 ` Nicolas Goaziou
2014-07-31 9:17 ` Nicolas Richard
2014-07-31 11:41 ` Nicolas Goaziou
2014-07-31 22:04 ` Shiyuan
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=877g2uymqh.fsf@geodiff-mac3.ulb.ac.be \
--to=theonewiththeevillook@yahoo.fr \
--cc=emacs-orgmode@gnu.org \
--cc=mail@nicolasgoaziou.fr \
--cc=tjolitz@gmail.com \
/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).