From f9859c09c5ad4790ef94d87477e7dfb97f264880 Mon Sep 17 00:00:00 2001 From: Charles Berry Date: Tue, 10 Mar 2015 14:09:52 -0700 Subject: [PATCH] ob-exp.el: org-babel-exp-process-buffer reports src block w/o language * lisp/ob-exp.el (org-babel-exp-process-buffer): Issue an error when a src block with neither language nor headers is processed. Throw an error with an informative message when trying to export buffer containing `#+src_block\n'. Reported-by: XIE Yuheng --- lisp/ob-exp.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/ob-exp.el b/lisp/ob-exp.el index 4c53a55..d17e49f 100644 --- a/lisp/ob-exp.el +++ b/lisp/ob-exp.el @@ -268,7 +268,11 @@ may make them unreachable." ;; the block should be left as-is while an empty ;; string should remove the block. (let ((replacement - (progn (goto-char match-start) + (progn (when (null (car headers)) + (error + "No src block language or headers at line %S" + (line-number-at-pos))) + (goto-char match-start) (org-babel-exp-src-block headers)))) (cond ((not replacement) (goto-char end)) ((equal replacement "") -- 1.9.3 (Apple Git-50)