emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Schulte <schulte.eric@gmail.com>
To: Rick Frankel <rick@rickster.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [BUG] ob-perl variable handling broken
Date: Sun, 24 Mar 2013 18:27:18 -0600	[thread overview]
Message-ID: <87boa8nx21.fsf@gmail.com> (raw)
In-Reply-To: <m2y5dcl5fq.wl%rick@rickster.com> (Rick Frankel's message of "Sun, 24 Mar 2013 19:54:33 -0400")

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

Rick Frankel <rick@rickster.com> 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,


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-print-Perl-variables-with-a-format-string.patch --]
[-- Type: text/x-patch, Size: 943 bytes --]

From 0007d05de6e2d8994da01eee3ed4cec29ff43682 Mon Sep 17 00:00:00 2001
From: Eric Schulte <schulte.eric@gmail.com>
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


[-- Attachment #3: Type: text/plain, Size: 46 bytes --]


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

  reply	other threads:[~2013-03-25  0:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-24 23:54 [BUG] ob-perl variable handling broken Rick Frankel
2013-03-25  0:27 ` Eric Schulte [this message]
2013-03-25  8:22   ` Achim Gratz
2013-03-25 13:40     ` Eric Schulte

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=87boa8nx21.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=rick@rickster.com \
    /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).