From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Charles C. Berry" Subject: [PATCH} Re: Bug: problem when exporting a org-mode file with a lots of code blocks Date: Tue, 10 Mar 2015 14:22:51 -0700 Message-ID: References: <87d24hs3pa.fsf@gmail.com> Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-1101510463-1426022574=:2030" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46071) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVRcH-0005yb-Cz for emacs-orgmode@gnu.org; Tue, 10 Mar 2015 17:23:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YVRcD-00051B-4R for emacs-orgmode@gnu.org; Tue, 10 Mar 2015 17:23:05 -0400 Received: from iport-bcv1-out.ucsd.edu ([132.239.0.119]:54246) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVRcC-0004tv-7U for emacs-orgmode@gnu.org; Tue, 10 Mar 2015 17:23:01 -0400 Received: from [137.110.38.143] (unknown [137.110.38.143]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: ccberry@ad.ucsd.edu) by act-bufferout-a1.ucsd.edu (Postfix) with ESMTPSA id 001581E3E for ; Tue, 10 Mar 2015 14:22:53 -0700 (PDT) In-Reply-To: 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: emacs-orgmode@gnu.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-1101510463-1426022574=:2030 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed The patch causes an informative error message to be reported for src blocks like this (no language): #+begin_src (+ 1 2) #_end_src when exporting instead of failing with a cryptic error message. Arguably, it would be better to skip the malformed src block as `org-babel-map-src-blocks' does or (as per John's message) org-babel-tangle does. WDYT? Chuck On Tue, 10 Mar 2015, Charles Berry wrote: > XIE Yuheng gmail.com> writes: > >> >> >> Bug: org-babel-parse-src-block-match reporting "Wrong type argument: >> stringp, nil" when exporting a org-mode file with a lots of code blocks >> [8.3beta (release_8.3beta-895-g375c83 >> /usr/share/emacs/site-lisp/org/)] >> >> the following is *Messages* buffer >> https://www.refheap.com/98243 >> the following is the org-mode file with a lot of code blocks >> https://github.com/the-little-language-designer/cicada-nymph/blob/ > master/cicada-nymph.org > > > Look at the *Messages* buffer and you will see a list of src blocks that were > processed without error. > > The src block *after* the last block in the list (before the error message) > caused the error. > > `org-babel-parse-src-block-match' expects a language for a src block. > > Specify a language for every src block and it will export. > > HTH, > > Chuck > > > --0-1101510463-1426022574=:2030 Content-Type: TEXT/PLAIN; charset=US-ASCII; name=0001-ob-exp.el-org-babel-exp-process-buffer-reports-src-b.patch Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Better error for bad src block Content-Disposition: attachment; filename=0001-ob-exp.el-org-babel-exp-process-buffer-reports-src-b.patch RnJvbSBmOTg1OWMwOWM1YWQ0NzkwZWY5NGQ4NzQ3N2U3ZGZiOTdmMjY0ODgw IE1vbiBTZXAgMTcgMDA6MDA6MDAgMjAwMQ0KRnJvbTogQ2hhcmxlcyBCZXJy eSA8Y2NiZXJyeUB1Y3NkLmVkdT4NCkRhdGU6IFR1ZSwgMTAgTWFyIDIwMTUg MTQ6MDk6NTIgLTA3MDANClN1YmplY3Q6IFtQQVRDSF0gb2ItZXhwLmVsOiBv cmctYmFiZWwtZXhwLXByb2Nlc3MtYnVmZmVyIHJlcG9ydHMgc3JjIGJsb2Nr IHcvbw0KIGxhbmd1YWdlDQoNCiogbGlzcC9vYi1leHAuZWwgKG9yZy1iYWJl bC1leHAtcHJvY2Vzcy1idWZmZXIpOiBJc3N1ZSBhbiBlcnJvciB3aGVuIGEN CiAgc3JjIGJsb2NrIHdp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