ox: Signal an error if keyword is unknown while defining backends

* lisp/ox.el (org-export-define-backend):
(org-export-define-derived-backend): Signal an error if keyword is
unknown.
This commit is contained in:
Nicolas Richard 2014-07-31 10:48:54 +02:00 committed by Nicolas Goaziou
parent 5ec0468e0a
commit 350fdfd676
1 changed files with 19 additions and 17 deletions

View File

@ -1139,14 +1139,15 @@ keywords are understood:
(declare (indent 1)) (declare (indent 1))
(let (blocks filters menu-entry options contents) (let (blocks filters menu-entry options contents)
(while (keywordp (car body)) (while (keywordp (car body))
(case (pop body) (let ((keyword (pop body)))
(case keyword
(:export-block (let ((names (pop body))) (:export-block (let ((names (pop body)))
(setq blocks (if (consp names) (mapcar 'upcase names) (setq blocks (if (consp names) (mapcar 'upcase names)
(list (upcase names)))))) (list (upcase names))))))
(:filters-alist (setq filters (pop body))) (:filters-alist (setq filters (pop body)))
(:menu-entry (setq menu-entry (pop body))) (:menu-entry (setq menu-entry (pop body)))
(:options-alist (setq options (pop body))) (:options-alist (setq options (pop body)))
(t (pop body)))) (t (error "Unknown keyword: %s" keyword)))))
(org-export-register-backend (org-export-register-backend
(org-export-create-backend :name backend (org-export-create-backend :name backend
:transcoders transcoders :transcoders transcoders
@ -1210,7 +1211,8 @@ The back-end could then be called with, for example:
(declare (indent 2)) (declare (indent 2))
(let (blocks filters menu-entry options transcoders contents) (let (blocks filters menu-entry options transcoders contents)
(while (keywordp (car body)) (while (keywordp (car body))
(case (pop body) (let ((keyword (pop body)))
(case keyword
(:export-block (let ((names (pop body))) (:export-block (let ((names (pop body)))
(setq blocks (if (consp names) (mapcar 'upcase names) (setq blocks (if (consp names) (mapcar 'upcase names)
(list (upcase names)))))) (list (upcase names))))))
@ -1218,7 +1220,7 @@ The back-end could then be called with, for example:
(:menu-entry (setq menu-entry (pop body))) (:menu-entry (setq menu-entry (pop body)))
(:options-alist (setq options (pop body))) (:options-alist (setq options (pop body)))
(:translate-alist (setq transcoders (pop body))) (:translate-alist (setq transcoders (pop body)))
(t (pop body)))) (t (error "Unknown keyword: %s" keyword)))))
(org-export-register-backend (org-export-register-backend
(org-export-create-backend :name child (org-export-create-backend :name child
:parent parent :parent parent