From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: [BABEL] [PATCH] Make it possible to use buffer local noweb start/end patterns Date: Sat, 25 Aug 2012 16:50:29 -0600 Message-ID: <87a9xitwlm.fsf@gmx.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:42202) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T5PBi-0001mk-8k for emacs-orgmode@gnu.org; Sat, 25 Aug 2012 18:50:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T5PBh-00012S-0z for emacs-orgmode@gnu.org; Sat, 25 Aug 2012 18:50:42 -0400 Received: from mailout-us.gmx.com ([74.208.5.67]:42157) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1T5PBg-00012H-NO for emacs-orgmode@gnu.org; Sat, 25 Aug 2012 18:50:40 -0400 In-Reply-To: (Sean O'Halpin's message of "Sat, 25 Aug 2012 23:22:24 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Sean O'Halpin Cc: Org Mode Are you familiar with file local variables? See (info "(emacs)Specifying File Variables") "Sean O'Halpin" writes: > * 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)) -- Eric Schulte http://cs.unm.edu/~eschulte