Re: [O] Bug: org-babel-tangle purges comma at the beginning of a line ]

2013-03-02 Thread Nicolas Goaziou
Hello,

Simon Campese emacs-orgm...@campese.de writes:

 thanks a lot for the patch. It partly works, as long as there are some
 more characters after the first comma, but a single comma at the beginning of
 a line still gets purged. Now we can start discussing about whoever
 would want to have a single comma in a line of its own... :-)

I have applied the patch. Thank you for reporting the problem.

I think the other problem is unrelated to this. Could you provide an ECM
demonstrating this behaviour?


Regards,

-- 
Nicolas Goaziou



Re: [O] Bug: org-babel-tangle purges comma at the beginning of a line ]

2013-02-27 Thread Nicolas Goaziou
Hello,

Simon Campese emacs-orgm...@campese.de 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
From c9dc22ea651056d6411dd27b57a252007d97bc00 Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou n.goaz...@gmail.com
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



Re: [O] Bug: org-babel-tangle purges comma at the beginning of a line ]

2013-02-27 Thread Simon Campese
Hello Nicolas, 

thanks a lot for the patch. It partly works, as long as there are some
more characters after the first comma, but a single comma at the beginning of
a line still gets purged. Now we can start discussing about whoever
would want to have a single comma in a line of its own... :-) 


Best wishes,

Simon