From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Richard Subject: Re: define a new export backend Date: Thu, 31 Jul 2014 10:08:06 +0200 Message-ID: <877g2uymqh.fsf@geodiff-mac3.ulb.ac.be> References: <87bns69eeo.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54793) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XClNN-0002vw-RJ for emacs-orgmode@gnu.org; Thu, 31 Jul 2014 04:06:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XClNG-0002Gz-Bc for emacs-orgmode@gnu.org; Thu, 31 Jul 2014 04:06:13 -0400 Received: from mxin.ulb.ac.be ([164.15.128.112]:39416) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XClNG-0002Gs-5g for emacs-orgmode@gnu.org; Thu, 31 Jul 2014 04:06:06 -0400 In-Reply-To: <87bns69eeo.fsf@gmail.com> (Thorsten Jolitz's message of "Thu, 31 Jul 2014 09:27:11 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Thorsten Jolitz Cc: emacs-orgmode@gnu.org, Nicolas Goaziou Thorsten Jolitz writes: > Shiyuan 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.