From mboxrd@z Thu Jan 1 00:00:00 1970 From: Juan Pechiar Subject: Re: [BUG] LaTeX subtree export gives spurious "unbalanced begin/end_%s blocks" error Date: Mon, 12 Dec 2011 09:02:58 -0200 Message-ID: <20111212110258.GB12790@soloJazz.com> References: <4EE5C13A.9080900@christianmoe.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([140.186.70.92]:35187) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ra3f4-0001pJ-Dn for emacs-orgmode@gnu.org; Mon, 12 Dec 2011 06:03:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ra3ey-0000DJ-IN for emacs-orgmode@gnu.org; Mon, 12 Dec 2011 06:03:10 -0500 Received: from oproxy3-pub.bluehost.com ([69.89.21.8]:48317) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1Ra3ex-0000C9-T4 for emacs-orgmode@gnu.org; Mon, 12 Dec 2011 06:03:04 -0500 Content-Disposition: inline In-Reply-To: <4EE5C13A.9080900@christianmoe.com> 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: Christian Moe Cc: Org Mode I have the same problem. It occurs on a 2nd pass through org-export-blocks-preprocess (in org-exp-blocks.el). 1st pass runs OK, 2nd pass gets the error condition. 1st pass processes the following: (buffer-substring match-start (point-max)) -> "#+begin_src emacs-lisp\n (message \"Hello, World!\")\n#+end_src\n" 2nd pass processes an emptied skeleton of the block (buffer-substring match-start (point-max)) -> "#+begin_src emacs-lisp\n#+end_src\n" And fails to balance begin with end. At this point in the code, the regular expression for matching begin/end contains (I made ^M and tab visible here): inner-re = "[\r\n][\t ]*#\\+\\(begin\\|end\\)_src" And this expression fails right away: (re-search-forward inner-re nil t) -> nil I'll try to dig further into what's goning on. Regards, .j. On Mon, Dec 12, 2011 at 09:54:18AM +0100, Christian Moe wrote: > Hi, > > Here's a minimal document: > > ----BEGIN EXAMPLE---- > > #+title: Testing > > * Src blocks > > Here's some Lisp: > > #+begin_src emacs-lisp > (message "Hello world!") > #+end_src > > ----END EXAMPLE---- > > When I try to export the "Src blocks" subtree to PDF via LaTeX, I > get the error: > > "unbalanced begin/end_src blocks" > > Export of the whole document to PDF via LaTeX is not affected. > > Neither, initially, is HTML export, including subtree export to > HTML. However, after getting an error by trying to export the > subtree to LaTeX, I get the same error when trying to export to HTML > (whether subtree or the whole document). I can "clear" the HTML > export error by exporting the whole document via LaTeX again.