From mboxrd@z Thu Jan 1 00:00:00 1970 From: aditya siram Subject: [Babel] : Bug in org-tangle with :comments, patch included Date: Thu, 8 Mar 2012 13:36:22 -0600 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=e89a8f3ba11711adf404bac064e2 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:38596) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5j8Y-000832-3G for emacs-orgmode@gnu.org; Thu, 08 Mar 2012 14:36:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S5j8T-0007NW-Bo for emacs-orgmode@gnu.org; Thu, 08 Mar 2012 14:36:29 -0500 Received: from mail-iy0-f169.google.com ([209.85.210.169]:53345) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5j8T-0007NP-4z for emacs-orgmode@gnu.org; Thu, 08 Mar 2012 14:36:25 -0500 Received: by iajr24 with SMTP id r24so1308140iaj.0 for ; Thu, 08 Mar 2012 11:36:22 -0800 (PST) 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 --e89a8f3ba11711adf404bac064e2 Content-Type: text/plain; charset=ISO-8859-1 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 --e89a8f3ba11711adf404bac064e2 Content-Type: text/x-diff; charset=US-ASCII; name="link-escaped-twice.patch" Content-Disposition: attachment; filename="link-escaped-twice.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gzk757hv0 RnJvbSAyNDlmNjBmZTE3OTEzZGIwOGY4MWJjYTQwZDEyZTExNGY2NmRiNGI2IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBEZWVjaCA8ZGVlY2hAZGVlY2gtVGhpbmtQYWQtWDIwMC4obm9u ZSk+CkRhdGU6IFRodSwgOCBNYXIgMjAxMiAxMzoyNToxNCAtMDYwMApTdWJqZWN0OiBbUEFUQ0gg My8zXSBUaGUgbGluayBnZW5lcmF0ZWQgYnkgb3JnLXN0b3JlLWxpbmsgaXMgZXNjYXBlZCB0d2lj ZSB3aGVuIHRhbmdsaW5nIHdpdGggIjpjb21tZW50cyB5ZXMiIGZsYWcuCgotLS0KIGxpc3Avb2It dGFuZ2xlLmVsIHwgICAgMiArLQogMSBmaWxlcyBjaGFuZ2VkLCAxIGluc2VydGlvbnMoKyksIDEg ZGVsZXRpb25zKC0pCgpkaWZmIC0tZ2l0IGEvbGlzcC9vYi10YW5nbGUuZWwgYi9saXNwL29iLXRh bmdsZS5lbAppbmRleCAxNWMwNTE4Li5lNjI5YzEyIDEwMDY0NAotLS0gYS9saXNwL29iLXRhbmds ZS5lbAorKysgYi9saXNwL29iLXRhbmdsZS5lbApAQCAtMzgxLDcgKzM4MSw3IEBAIGZvcm0KICAg KHN0YXJ0LWxpbmUgZmlsZSBsaW5rIHNvdXJjZS1uYW1lIHBhcmFtcyBib2R5IGNvbW1l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