From mboxrd@z Thu Jan 1 00:00:00 1970 From: aditya siram Subject: Bug in org-babel-tangle/org-babel-detangle Date: Thu, 12 Sep 2013 15:48:04 -0500 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7bdc1870208a3204e635dd24 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55382) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKDok-00073o-VN for emacs-orgmode@gnu.org; Thu, 12 Sep 2013 16:48:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VKDoj-0004Y9-My for emacs-orgmode@gnu.org; Thu, 12 Sep 2013 16:48:46 -0400 Received: from mail-ie0-x22f.google.com ([2607:f8b0:4001:c03::22f]:53838) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKDoj-0004Xf-HQ for emacs-orgmode@gnu.org; Thu, 12 Sep 2013 16:48:45 -0400 Received: by mail-ie0-f175.google.com with SMTP id e14so754411iej.6 for ; Thu, 12 Sep 2013 13:48:44 -0700 (PDT) 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 --047d7bdc1870208a3204e635dd24 Content-Type: text/plain; charset=ISO-8859-1 Hi all, Currently in HEAD a file tangled with org-babel-tangle does not detangle with org-babel-detangle. The problem is that the chunk delimiters in the tangled file are cushioned with empty lines whereas the same chunk in the Org file is not. So when 'org-babel-detangle' tries to determine the beginning and end of the chunk it includes the spaces which causes it to error out when trying to re-insert the chunk in the Org file because the size of the chunks don't match. This is a simple fix and I would have submitted a patch but I don't know if the problem is that org-tangle is adding empty lines or if the detangle process should be taking that into account. Let me know which and I'll submit a patch. This can be reproduced in the following way: Tangling the following snippet: * Test Tangle #+begin_src sh :tangle /tmp/test-tangle.txt :comments yes hello world #+end_src produces: # [[file:~/WorkingFiles/Org.org::*Test%20Tangle][Test\ Tangle:1]] hello world # Test\ Tangle:1 ends here Detangling the same file highlights the code chunk in the Org file and leaves an error message: "progn: End of buffer" in the *Messages* buffer. Thanks! -deech --047d7bdc1870208a3204e635dd24 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi all,
Currently in HEAD a file tangle= d with org-babel-tangle does not detangle with org-babel-detangle.

T= he problem is that the chunk delimiters in the tangled file are cushioned w= ith empty lines whereas the same chunk in the Org file is not. So when '= ;org-babel-detangle' tries to determine the beginning and end of the ch= unk it includes the spaces which causes it to error out when trying to re-i= nsert the chunk in the Org file because the size of the chunks don't ma= tch.

This is a simple fix and I would have submitted a patch but I don't= know if the problem is that org-tangle is adding empty lines or if the det= angle process should be taking that into account.=A0 Let me know which and = I'll submit a patch.

This can be reproduced in the following way:
<= /div>

Tangling the following snippet:
* Test Tangle
=A0=A0 #+begin_src sh :tangle /tmp/test-tangle.txt :comments yes
=A0= =A0=A0=A0 hello world
=A0=A0 #+end_src
produces:

# [[file:~/WorkingFiles/Org.org::*Test= %20Tangle][Test\ Tangle:1]]

hello world

# Test\ Tangle:1 ends= here

Detangling the same file highlights the code chunk = in the Org file and leaves an error message:=A0
"progn: End of buffer" in the *Messages* buffer.

Thanks!
-deech


--047d7bdc1870208a3204e635dd24--