From 4a2ed86f6df5b2b890136628be3784e6d924d9c9 Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Sat, 29 Jan 2011 16:34:36 +0000 Subject: [PATCH] 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. --- lisp/ob.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lisp/ob.el b/lisp/ob.el index 5f3e4b8d5..a3a806f17 100644 --- a/lisp/ob.el +++ b/lisp/ob.el @@ -1100,8 +1100,11 @@ If the point is not on a source block then return nil." (or (save-excursion ;; on a source name line (beginning-of-line 1) - (and (looking-at org-babel-src-name-regexp) (forward-line 1) - (looking-at org-babel-src-block-regexp) + (and (looking-at org-babel-src-name-regexp) + (progn + (while (and (forward-line 1) + (looking-at org-babel-multi-line-header-regexp))) + (looking-at org-babel-src-block-regexp)) (point))) (save-excursion ;; on a #+begin_src line (beginning-of-line 1)