emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] table not returned


From: Andreas Leha
Subject: Re: [O] table not returned
Date: Wed, 28 Mar 2012 15:26:29 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux)

Nick Dokos <address@hidden> writes:

> Andreas Leha <address@hidden> wrote:
>
>> 
>> Hi Bastien,
>> 
>> thanks for looking into this!
>> 
>> 
>> Bastien <address@hidden> writes:
>> 
>> > Andreas Leha <address@hidden> writes:
>> >
>> >> #+begin_src R :results table
>> >>   data.frame(parameter=c("parameter", "", "param1"),
>> >>              mean=c("mean  sd", "", "1.1  0.1"),
>> >>              median=c("median", "(minimum;maximum)", "1 (1;2)"))
>> >> #+end_src
>> >>
>> >> #+results:
>> >
>> > I can't test this because of the  character.
>>                                  ^^^^^
>> This character got lost on the mailing list.  I guess the offending
>> character was the plus-minus character.
>> 
>> This should be testable, I hope:
>> 
>> ,----
>> | #+begin_src R :results table
>> |   data.frame(parameter=c("parameter", "", "param1"),
>> |              mean=c("mean +- sd", "", "1.1 +- 0.1"),
>> |              median=c("median", "(minimum;maximum)", "1 (1;2)"))
>> | #+end_src
>> | 
>> | #+results:
>> `----
>> 
>> Again, this works as expected, if "(minimum" is replaced by "minimum".
>> 
>
> This happens in org-babel-import-elisp-from-file, when org-babel-string-read
> is mapped on each row. To wit:
>
> (org-babel-string-read "foo)") --> "foo)"
>
> but
>
> (org-babel-string-read "(foo)") --> Error
>
> The backtrace for the error says:
>
> ,----
> | Debugger entered--Lisp error: (void-function foo)
> |   (foo)
> |   eval((foo))
> |   (if (and (not inhibit-lisp-eval) (member (substring cell 0 1)
> | (quote ("(" "'" "`" "[")))) (eval (read cell)) (if (string=
> | (substring cell 0 1) "\"") (read cell) (progn (set-text-properties 0
> | (length cell) nil cell) cell)))
> |   (or (org-babel-number-p cell) (if (and (not inhibit-lisp-eval)
> | (member (substring cell 0 1) (quote ("(" "'" "`" "[")))) (eval (read
> | cell)) (if (string= (substring cell 0 1) "\"") (read cell) (progn
> | (set-text-properties 0 (length cell) nil cell) cell))))
> |   (if (and (stringp cell) (not (equal cell ""))) (or
> | (org-babel-number-p cell) (if (and (not inhibit-lisp-eval) (member
> | (substring cell 0 1) (quote ("(" "'" "`" "[")))) (eval (read cell))
> | (if (string= (substring cell 0 1) "\"") (read cell) (progn
> | (set-text-properties 0 (length cell) nil cell) cell)))) cell)
> |   org-babel-read("(foo)")
> |   org-babel-string-read("(foo)")
> `----
>
> Nick

Hi Nick,

thanks for that analysis!  I had tried replacing "(" with "[" without
success.  Now I "know" why:

(org-babel-string-read "[foo)") --> Error

,----
| Debugger entered--Lisp error: (invalid-read-syntax ") or . in a vector")
|   read("[foo)")
|   org-babel-read("[foo)")
|   org-babel-string-read("[foo)")
|   eval((org-babel-string-read "[foo)") nil)
|   eval-last-sexp-1(nil)
|   eval-last-sexp(nil)
|   call-interactively(eval-last-sexp nil nil)
`----

Regards,
Andreas




reply via email to

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