1

In Org-mode working with 'src' code blocks and table formulas together, org-mode cuts of the cell strings at the first whitespace character.

I.e.: having a cell with Hello World the 'src' code block only receives Hello.

Following example:

This shows the weird result.

#+NAME: bugornot-src
#+BEGIN_SRC emacs-lisp :var x='()
(mapconcat 'prin1-to-string x "")
#+END_SRC

#+TBLNAME: bugornot-tbl
| Test | Hello World | Foo | TestHelloFoo |
|      |             |     | TestHelloFoo |
#+TBLFM: @1$4='(org-sbe bugornot-src (x @1$1..@1$3))
#+TBLFM: @2$4='(org-sbe bugornot-src (x @1$1 @1$2 @1$3))

But the resulting table I expected after evaluating the formulas should look like this:

| Test | Hello World | Foo | TestHello WorldFoo |
|      |             |     | TestHello WorldFoo |

Is there a way to get the full string from cell @1$2 to cells @1$4 and @2$4 (with this whitespace character inside)?

3

I would say that this is not exactly a bug, but a complexity of dealing with the interpolation of values from the table into the lisp code of the formula.

The org manual says:

    With Emacs Lisp forms, you need to be conscious about the way field
references are interpolated into the form.  By default, a reference
will be interpolated as a Lisp string (in double-quotes) containing the
field.

While for org-sbe it says:

Return the results of calling SOURCE-BLOCK with VARIABLES.

Each element of VARIABLES should be a list of two elements: the
first element is the name of the variable and second element is a
string of its value.

But you're passing in a list of four elements, so exactly how it gets processed isn't clear. If I try #+TBLFM: '(org-sbe bugornot-src (x '(@1$1..@1$3))), to pass a single list of strings to x, then it works just fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.