I am executing a src block on a table that is determined by a prompt. A minimal example:

#+NAME: a-table
| Value  |

#+begin_src emacs-lisp :var (princ (format "table=a-table" (read-string "Select: ")))

| Value |

All is fine except that read-string is executed twice and takes the second prompts value. In reality I'm using helm to select from a list of tables and the helm prompt also appears twice.

Moving :var to a header-args property changes nothing.


Org mode version 9.0.3 and GNU Emacs 24.5.1 (i686-pc-mingw32) of 2015-04-11 on LEG570


Could it be that you have eldoc-mode or global-eldoc-mode active? I get the same behavior and other strange behavior (and I get prompted when just having the cursor on the argument line).

My way to debug such issues often is to enable debug-on-quit. When I'm in the select prompt I hit C-g and then from the backtrace I can see where the invocation originated. Eldoc mode definitely gets messed up with this kind of interactive prompting in the header argument. Depending on what modes you have active, could also originate from another tool trying to parse the code block arguments.

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.