emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Sean O'Halpin" <sean.ohalpin@gmail.com>
To: Org Mode <emacs-orgmode@gnu.org>
Subject: [BABEL] [PATCH] Make it possible to use buffer local noweb start/end patterns
Date: Sat, 25 Aug 2012 23:22:24 +0100	[thread overview]
Message-ID: <CAOXM+eUsjJLqD9VK+GU2DxAyTVMJUTFhDTv9yViyDDoHERA2Qw@mail.gmail.com> (raw)

* 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
---
 lisp/ob.el |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/lisp/ob.el b/lisp/ob.el
index 7518293..f9e9ae1 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))
-- 
1.7.0.4

             reply	other threads:[~2012-08-25 22:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-25 22:22 Sean O'Halpin [this message]
2012-08-25 22:50 ` [BABEL] [PATCH] Make it possible to use buffer local noweb start/end patterns Eric Schulte
2012-08-25 23:23   ` Sean O'Halpin
2012-08-26 14:31     ` Eric Schulte
2012-08-26 16:40       ` Sean O'Halpin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAOXM+eUsjJLqD9VK+GU2DxAyTVMJUTFhDTv9yViyDDoHERA2Qw@mail.gmail.com \
    --to=sean.ohalpin@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).