emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] [BUG] ob-perl variable handling broken


From: Eric Schulte
Subject: Re: [O] [BUG] ob-perl variable handling broken
Date: Sun, 24 Mar 2013 18:27:18 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Rick Frankel <address@hidden> writes:

> The commit ca125b82b changed a lot of the variable handling in
> ob-perl, and it now will not accept tables as input. Below is an org
> doc with an example, the error message and a backtrace.
>

The attached patch fixes this behavior, however I haven't committed it
because I fear it would undo some of Achim's intentions in commit
ca125b82b.  I'll leave the final solution to Achim.

Thanks for pointing this out,

>From 0007d05de6e2d8994da01eee3ed4cec29ff43682 Mon Sep 17 00:00:00 2001
From: Eric Schulte <address@hidden>
Date: Sun, 24 Mar 2013 18:25:42 -0600
Subject: [PATCH] print Perl variables with a format string

Don't use princ because it doesn't always return a string.

Thanks to Rick Frankel for pointing this out.

* lisp/ob-perl.el (org-babel-perl--var-to-perl): Print Perl variables
  with a format string.
---
 lisp/ob-perl.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/ob-perl.el b/lisp/ob-perl.el
index 8bc84f0..a9db6ef 100644
--- a/lisp/ob-perl.el
+++ b/lisp/ob-perl.el
@@ -87,7 +87,7 @@ specifying a var of the same value."
                    (concat "[\n"
                            (mapconcat #'org-babel-perl--var-to-perl var "")
                            prefix "]"))
-               (concat "q(" (princ var) ")"))
+               (format "q(~a)" var))
              (unless (zerop org-babel-perl--lvl) ",\n")))))
 
 (defvar org-babel-perl-buffers '(:default . nil))
-- 
1.8.2

-- 
Eric Schulte
http://cs.unm.edu/~eschulte

reply via email to

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