From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Bug: org-babel-tangle purges comma at the beginning of a line ] Date: Wed, 27 Feb 2013 09:01:22 +0100 Message-ID: <87d2vmtcbx.fsf@gmail.com> References: <87k3puvfq3.fsf@tu-dortmund.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:39965) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAbxL-0000Xg-6h for emacs-orgmode@gnu.org; Wed, 27 Feb 2013 03:01:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UAbxJ-0007Ug-NJ for emacs-orgmode@gnu.org; Wed, 27 Feb 2013 03:01:39 -0500 Received: from mail-wi0-f179.google.com ([209.85.212.179]:42017) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAbxJ-0007Ub-H1 for emacs-orgmode@gnu.org; Wed, 27 Feb 2013 03:01:37 -0500 Received: by mail-wi0-f179.google.com with SMTP id ez12so271447wid.12 for ; Wed, 27 Feb 2013 00:01:36 -0800 (PST) In-Reply-To: <87k3puvfq3.fsf@tu-dortmund.de> (Simon Campese's message of "Wed, 27 Feb 2013 00:05:08 +0100") 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: Simon Campese Cc: emacs-orgmode@gnu.org, Eric Schulte --=-=-= Content-Type: text/plain Hello, Simon Campese writes: > I just noticed that org-babel-tangle removes the comma if its at the > beginning of a line inside a source block. This seems to be independent from the > language indicated (tried with sh, js and emacs-lisp) and also > independent from the characters that follow (',' gets tangled to a blank > line, ',,,' gets tangled to ',,', ',sometext' gets tangled to 'sometext' > etc.). That looks like a bug, indeed. Thank you for reporting it. Would the following patch fix it? Regards, -- Nicolas Goaziou --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-ob-tangle-Correctly-unescape-code-when-tangling.patch >From c9dc22ea651056d6411dd27b57a252007d97bc00 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Wed, 27 Feb 2013 08:58:32 +0100 Subject: [PATCH] ob-tangle: Correctly unescape code when tangling * lisp/ob-tangle.el (org-babel-spec-to-string): Use dedicated function for unescaping code. --- lisp/ob-tangle.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el index 6c79794..2c2e7dd 100644 --- a/lisp/ob-tangle.el +++ b/lisp/ob-tangle.el @@ -346,8 +346,7 @@ form (insert (format "%s\n" - (replace-regexp-in-string - "^," "" + (org-unescape-code-in-string (org-babel-trim body (if org-src-preserve-indentation "[\f\n\r\v]"))))) (when link-p (funcall -- 1.8.1.4 --=-=-=--