babel: bug fix related to "no longer overwriting non-babel src blocks" commit

this fixes a bug introduced in commit
  d154f27947
This commit is contained in:
Eric Schulte 2010-01-25 23:54:03 -07:00
parent b37ccbee9b
commit b59a57e890
1 changed files with 14 additions and 12 deletions

View File

@ -73,18 +73,20 @@ results - just like none only the block is run on export ensuring
none ----- do not display either code or results upon export"
(interactive)
(message "org-babel-exp processing...")
(or (and (re-search-backward org-babel-src-block-regexp progress-marker t)
(setq progress-marker (match-end 0))
(org-babel-exp-do-export (org-babel-get-src-block-info) 'block))
(save-excursion
(forward-line 0)
(and (org-babel-where-is-src-block-head)
(goto-char (org-babel-where-is-src-block-head))
(org-babel-exp-do-export (org-babel-get-src-block-info) 'block)))
(and (re-search-backward org-block-regexp progress-marker t)
(setq progress-marker (match-end 0))
(match-string 0))
(error "Unmatched block [bug in `org-babel-exp-src-blocks'].")))
(flet ((cond-progress-marker () (when (and progress-marker (< progress-marker (point)))
progress-marker)))
(or (and (re-search-backward org-babel-src-block-regexp (cond-progress-marker) t)
(setq progress-marker (match-end 0))
(org-babel-exp-do-export (org-babel-get-src-block-info) 'block))
(save-excursion
(forward-line 0)
(and (org-babel-where-is-src-block-head)
(goto-char (org-babel-where-is-src-block-head))
(org-babel-exp-do-export (org-babel-get-src-block-info) 'block)))
(and (re-search-backward org-block-regexp (cond-progress-marker) t)
(setq progress-marker (match-end 0))
(match-string 0))
(error "Unmatched block [bug in `org-babel-exp-src-blocks']."))))
(defun org-babel-exp-inline-src-blocks (start end)
"Process inline src blocks between START and END for export.