emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: aditya siram <aditya.siram@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Bug in org-babel-tangle/org-babel-detangle
Date: Thu, 12 Sep 2013 15:48:04 -0500	[thread overview]
Message-ID: <CAJrReyjoXM1nR6+=xUj7RdZjPD5E7ayehH05Mj2dEEx1d37P7Q@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1177 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1453 bytes --]

                 reply	other threads:[~2013-09-12 20:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJrReyjoXM1nR6+=xUj7RdZjPD5E7ayehH05Mj2dEEx1d37P7Q@mail.gmail.com' \
    --to=aditya.siram@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).