From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robert Klein Subject: PATCH for Re: Bug: src block asterisk escaping doesn't work anymore Date: Sat, 16 Jul 2016 21:12:29 +0200 Message-ID: <20160716211229.0607309b@x121e.fritz.box> References: <20160713154839.09da9e2e@pckr186.mpip-mainz.mpg.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/Np6+GZoKLEs_xIsBiQPRPt1" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33510) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bOV1O-0001nx-B3 for emacs-orgmode@gnu.org; Sat, 16 Jul 2016 15:13:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bOV1K-0001kP-22 for emacs-orgmode@gnu.org; Sat, 16 Jul 2016 15:13:05 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:57935) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bOV1J-0001kH-NL for emacs-orgmode@gnu.org; Sat, 16 Jul 2016 15:13:01 -0400 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" To: "Charles C. Berry" Cc: emacs-orgmode@gnu.org --MP_/Np6+GZoKLEs_xIsBiQPRPt1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi, On Wed, 13 Jul 2016 18:47:58 -0700 "Charles C. Berry" wrote: > On Wed, 13 Jul 2016, Robert Klein wrote: >=20 > > Hi, > > > > When exporting a source block, e.g. > > > > --- snip (example org file) --- > > #+begin_src conf > > Test > > > > ,* asterisk in src block > > #+end_src > > --- snip --- > > > > > > the escaping of the asterisk does not work. Instead a headline > > =E2=80=9Casterisk in src block=E2=80=9D is created. =20 >=20 > I don't have `ob-conf', but this: >=20 > --8<---------------cut here---------------start------------->8--- >=20 > #+begin_src emacs-lisp :exports both > "Test >=20 > ,* asterisk in src block" > #+end_src >=20 > --8<---------------cut here---------------end--------------->8--- >=20 > shows the issue. Also, the #+[BEGIN|END]_SRC parts of the src block=20 > are showing up in the export. >=20 > Putting `org-escape-code-in-string' back in `org-babel-exp-code' here >=20 > : ("body" . ,(org-escape-code-in-string (nth 1 info))) >=20 > seems to fix this as long as there is a newline after the last > #+END_SRC in the buffer. Thanks for the confirmation. I also have issues exporting http://orgmode.org/worg/dev/org-element-api.org -- while the error message is "Unable to resolve code reference: end" bisecting leads to the same commit; reverting the commit solves the issue. I reckon the line(s) beginning with #+ in the src block above confuse the exporter in the same way. I attached a tentative patch. Best regards Robert --MP_/Np6+GZoKLEs_xIsBiQPRPt1 Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0001-Revert-ob-exp-Remove-spurious-comma-un-escaping.patch >From ceecd352546453eb0215628c093faf13bca16b97 Mon Sep 17 00:00:00 2001 From: Robert Klein Date: Sat, 16 Jul 2016 20:50:01 +0200 Subject: [PATCH] Revert "ob-exp: Remove spurious comma un-escaping" This reverts commit 0279d84cd7f857535342b4ec3c2e70ac76c1ee27. The original commit breaks exports containing lines beginning with "* " or "#+" in src blocks. --- lisp/ob-exp.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/ob-exp.el b/lisp/ob-exp.el index e824992..a1a945f 100644 --- a/lisp/ob-exp.el +++ b/lisp/ob-exp.el @@ -48,6 +48,7 @@ (declare-function org-element-property "org-element" (property element)) (declare-function org-element-type "org-element" (element)) (declare-function org-id-get "org-id" (&optional pom create prefix)) +(declare-function org-escape-code-in-string "org-src" (s)) (defcustom org-export-babel-evaluate t "Switch controlling code evaluation during export. @@ -385,7 +386,7 @@ replaced with its value." org-babel-exp-inline-code-template org-babel-exp-code-template) `(("lang" . ,(nth 0 info)) - ("body" . ,(nth 1 info)) + ("body" . ,(org-escape-code-in-string (nth 1 info))) ("switches" . ,(let ((f (nth 3 info))) (and (org-string-nw-p f) (concat " " f)))) ("flags" . ,(let ((f (assq :flags (nth 2 info)))) -- 2.9.0 --MP_/Np6+GZoKLEs_xIsBiQPRPt1--