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 no language is processed.

Throw an error with an informative message when trying to export buffer
containing `#+src_block\n'.

Reported-by: XIE Yuheng <xyheme@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/95920>
This commit is contained in:
Charles Berry 2015-03-11 19:11:11 -07:00
parent 69e6f4acaf
commit 53c6f68896
1 changed files with 8 additions and 5 deletions

View File

@ -257,11 +257,14 @@ may make them unreachable."
(src-block (src-block
(let* ((match-start (copy-marker (match-beginning 0))) (let* ((match-start (copy-marker (match-beginning 0)))
(ind (org-get-indentation)) (ind (org-get-indentation))
(lang (or (org-element-property :language element)
(error "No language for src block: %s"
(or (org-element-property :name element)
"(unnamed)"))))
(headers (headers
(cons (cons lang
(org-element-property :language element) (let ((params
(let ((params (org-element-property :parameters (org-element-property :parameters element)))
element)))
(and params (org-split-string params "[ \t]+")))))) (and params (org-split-string params "[ \t]+"))))))
;; Take care of matched block: compute replacement ;; Take care of matched block: compute replacement
;; string. In particular, a nil REPLACEMENT means ;; string. In particular, a nil REPLACEMENT means