emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [PATCH] bug in expansion of variables in babel Perl


From: D M German
Subject: Re: [O] [PATCH] bug in expansion of variables in babel Perl
Date: Mon, 25 Feb 2013 01:42:16 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux)

 Achim Gratz twisted the bytes to say:

Hi Achim,

thanks for taking the time to do this.

I applied the patch, one of the hunks didn't apply due to Eric's
changes, but that is not an issue, since they do the same:

----------------------------------------------------------------------
diff a/lisp/ob-perl.el b/lisp/ob-perl.el        (rejected hunks)
@@ -75,7 +75,7 @@ (defun org-babel-perl-var-to-perl (var)
 specifying a var of the same value."
   (if (listp var)
       (concat "[" (mapconcat #'org-babel-perl-var-to-perl var ", ") "]")
-    (format "%S" var)))
+    (format "q(%s)" var)))
 
 (defvar org-babel-perl-buffers '(:default . nil))
----------------------------------------------------------------------

Everything works as intended, except for the return value of the perl
code. Values in the list are concatenated, as one:

#+begin_src perl :results table
(1, 2, 3)
#+end_src

#+RESULTS:
| 123 |

#+begin_src perl :results table
(1, 2, 3)
#+end_src

#+RESULTS:
| 123 |


I think the issue is that, at least in my computer the variable $\
returns empty (the record separator).

#+begin_src perl :results output
print "value of \$\\ [$\]\n";
#+end_src

#+RESULTS:
#+begin_example
value of $\ [] 
#+end_example

--daniel

--
Daniel M. German                  "Work. Finish. Publish. "
                                   Michael Faraday
http://turingmachine.org/
http://silvernegative.com/
dmg (at) uvic (dot) ca
replace (at) with @ and (dot) with .

 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]