summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Schulte <schulte.eric@gmail.com>2013-01-26 13:58:15 -0700
committerEric Schulte <schulte.eric@gmail.com>2013-01-26 13:58:30 -0700
commitf52600a43908d5b246901780b9a761e477ec5604 (patch)
treef197b344e4e5eb7d54659a499ee1f8d67a08ab65
parentbb40d29b45e091f3a4226c890e1130299c4dffd4 (diff)
downloadorg-mode-f52600a43908d5b246901780b9a761e477ec5604.tar.gz
fix bug: tangling #+headers: lines w/prefix arg
-rw-r--r--lisp/ob-tangle.el9
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el
index 0db4335..210de21 100644
--- a/lisp/ob-tangle.el
+++ b/lisp/ob-tangle.el
@@ -202,7 +202,14 @@ exported source code blocks by language."
target-file)
(setq target-file
(read-from-minibuffer "Tangle to: " (buffer-file-name)))))
- (narrow-to-region (match-beginning 0) (match-end 0)))
+ (narrow-to-region
+ (save-match-data
+ (save-excursion
+ (goto-char (org-babel-where-is-src-block-head))
+ (while (and (forward-line -1)
+ (looking-at org-babel-multi-line-header-regexp)))
+ (point)))
+ (match-end 0)))
(save-excursion
(let ((block-counter 0)
(org-babel-default-header-args