summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean O'Halpin <sean.ohalpin@gmail.com>2012-08-25 23:22:24 +0100
committerEric Schulte <eric.schulte@gmx.com>2012-08-26 08:29:32 -0600
commit30a24f464f65e0e372e0517e7d65956182f76b6e (patch)
treeec3b8cb59df5b5f62a78034e59fbb74847395a51
parentdb0e3066587272dc3bac43266e77f1f0e6fab9f6 (diff)
downloadorg-mode-30a24f464f65e0e372e0517e7d65956182f76b6e.tar.gz
Make it possible to use buffer local noweb start/end patterns
* lisp/ob.el (org-babel-expand-noweb-references): Capture current noweb start and end patterns then use to set buffer locals in (with-temp-buffer) form. This solves the problem that using different patterns for org-babel-noweb-wrap-start and org-babel-noweb-wrap-end could be done only globally. TINYCHANGE
-rw-r--r--lisp/ob.el4
1 files changed, 4 insertions, 0 deletions
diff --git a/lisp/ob.el b/lisp/ob.el
index 5211345..af61c8c 100644
--- a/lisp/ob.el
+++ b/lisp/ob.el
@@ -2270,6 +2270,8 @@ block but are passed literally to the \"example-block\"."
(info (or info (org-babel-get-src-block-info)))
(lang (nth 0 info))
(body (nth 1 info))
+ (ob-nww-start org-babel-noweb-wrap-start)
+ (ob-nww-end org-babel-noweb-wrap-end)
(comment (string= "noweb" (cdr (assoc :comments (nth 2 info)))))
(rx-prefix (concat "\\(" org-babel-src-name-regexp "\\|"
":noweb-ref[ \t]+" "\\)"))
@@ -2282,6 +2284,8 @@ block but are passed literally to the \"example-block\"."
(org-babel-trim (buffer-string)))))
index source-name evaluate prefix blocks-in-buffer)
(with-temp-buffer
+ (org-set-local 'org-babel-noweb-wrap-start ob-nww-start)
+ (org-set-local 'org-babel-noweb-wrap-end ob-nww-end)
(insert body) (goto-char (point-min))
(setq index (point))
(while (and (re-search-forward (org-babel-noweb-wrap) nil t))