ob-exp: check for info before exporting code blocks -- fixes a latex export issue

Thanks for Nicolas Goaziou for pointing this out

* lisp/ob-exp.el (org-babel-exp-src-blocks): don't attempt to export
  blocks when there is no info match -- this fixes a bug in the latex
  export of code blocks located before the first headline
This commit is contained in:
Eric Schulte 2010-07-16 15:34:57 -07:00
parent bc8d3a7704
commit a3dfb1c626
1 changed files with 9 additions and 7 deletions

View File

@ -97,13 +97,15 @@ none ----- do not display either code or results upon export"
(goto-char (match-beginning 0))
(let* ((info (org-babel-get-src-block-info))
(params (nth 2 info)))
;; expand noweb references in the original file
(setf (nth 1 info)
(if (and (cdr (assoc :noweb params))
(string= "yes" (cdr (assoc :noweb params))))
(org-babel-expand-noweb-references
info (get-file-buffer org-current-export-file))
(nth 1 info)))
;; bail if we couldn't get any info from the block
(when info
;; expand noweb references in the original file
(setf (nth 1 info)
(if (and (cdr (assoc :noweb params))
(string= "yes" (cdr (assoc :noweb params))))
(org-babel-expand-noweb-references
info (get-file-buffer org-current-export-file))
(nth 1 info))))
(org-babel-exp-do-export info 'block))))
(defun org-babel-exp-inline-src-blocks (start end)