ob: Don't allow #+header lines to prevent block finding

* lisp/ob.el (org-babel-where-is-src-block-head): Skip over
intervening #+header lines when searching for block associated with
block name line.
This commit is contained in:
Dan Davison 2011-01-29 16:34:36 +00:00
parent ba0f6d765f
commit 4a2ed86f6d
1 changed files with 5 additions and 2 deletions

View File

@ -1100,8 +1100,11 @@ If the point is not on a source block then return nil."
(or (or
(save-excursion ;; on a source name line (save-excursion ;; on a source name line
(beginning-of-line 1) (beginning-of-line 1)
(and (looking-at org-babel-src-name-regexp) (forward-line 1) (and (looking-at org-babel-src-name-regexp)
(looking-at org-babel-src-block-regexp) (progn
(while (and (forward-line 1)
(looking-at org-babel-multi-line-header-regexp)))
(looking-at org-babel-src-block-regexp))
(point))) (point)))
(save-excursion ;; on a #+begin_src line (save-excursion ;; on a #+begin_src line
(beginning-of-line 1) (beginning-of-line 1)