diff options
author | Eric Schulte <schulte.eric@gmail.com> | 2010-07-16 15:34:57 -0700 |
---|---|---|
committer | Eric Schulte <schulte.eric@gmail.com> | 2010-07-16 15:34:57 -0700 |
commit | a3dfb1c626583e5b68c056cb50805d4d045f6a74 (patch) | |
tree | a36101aa16eb13c79482b6103ca8399f64eea53c | |
parent | bc8d3a7704191d676028d1f6553963dc2a024d2c (diff) | |
download | org-mode-a3dfb1c626583e5b68c056cb50805d4d045f6a74.tar.gz |
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
-rw-r--r-- | lisp/ob-exp.el | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lisp/ob-exp.el b/lisp/ob-exp.el index b500e55..565c75f 100644 --- a/lisp/ob-exp.el +++ b/lisp/ob-exp.el @@ -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) |