From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: [Babel] : Bug in org-tangle with :comments, patch included Date: Fri, 09 Mar 2012 06:51:08 -0700 Message-ID: <87399hvptm.fsf@gmx.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:59027) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S60LN-0007ze-Cj for emacs-orgmode@gnu.org; Fri, 09 Mar 2012 08:58:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S60LD-0002WF-5n for emacs-orgmode@gnu.org; Fri, 09 Mar 2012 08:58:52 -0500 Received: from mailout-us.gmx.com ([74.208.5.67]:44969 helo=mailout-us.mail.com) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1S60LD-0002V7-01 for emacs-orgmode@gnu.org; Fri, 09 Mar 2012 08:58:43 -0500 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: aditya siram Cc: emacs-orgmode@gnu.org Applied. Thanks, aditya siram writes: > Hi all, > When I tangle a source block with ":comments yes" any spaces in the > sub-heading in which the block is found are replaced with "%2520" > instead of "%20". As a consequence when I "org-babel-detangle" the > correct heading is not found. > > As an example given the following org file: > * Babel Tangling > ** Test Source 1 > #+begin_src c :tangle /tmp/source1.txt :comments yes > nothing > #+end_src > > running "org-babel-tangle" generates the following source: > /* [[file:~/WorkingFiles/Org.org::*Test%2520Source%25201][Test-Source-1:1]] */ > > nothing > > /* Test-Source-1:1 ends here */ > > The problem is in the "org-babel-spec-to-string" function which takes > the correctly escaped link generated by "org-store-link": > "[[file:~/WorkingFiles/Org.org::*Test%20Source%201][Test-Source-1:1]]" > and escapes it again with "org-link-escape" which yielding the erroneous: > "[[file:~/WorkingFiles/Org.org::*Test%2520Source%25201][Test-Source-1:1]]". > > I have included a patch that removes the call to "org-link-escape" and > that fixes it on my machine. A grep of my current source tree shows > that "org-babel-spec-to-string" is only called from > "org-babel-tangle". I don't know if any other contribs are using this > function. > > -deech > > From 249f60fe17913db08f81bca40d12e114f66db4b6 Mon Sep 17 00:00:00 2001 > From: Deech > Date: Thu, 8 Mar 2012 13:25:14 -0600 > Subject: [PATCH 3/3] The link generated by org-store-link is escaped twice when tangling with ":comments yes" flag. > > --- > lisp/ob-tangle.el | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el > index 15c0518..e629c12 100644 > --- a/lisp/ob-tangle.el > +++ b/lisp/ob-tangle.el > @@ -381,7 +381,7 @@ form > (start-line file link source-name params body comment)" > (let* ((start-line (nth 0 spec)) > (file (nth 1 spec)) > - (link (org-link-escape (nth 2 spec))) > + (link (nth 2 spec)) > (source-name (nth 3 spec)) > (body (nth 5 spec)) > (comment (nth 6 spec)) -- Eric Schulte http://cs.unm.edu/~eschulte/