How do you trouble shoot this? (trying to run a sh block async)

#+BEGIN_SRC sh                                                                                                   

Then I do

C-c C-c

I get

Symbol's function definition is void: org-babel-get-header

My setup

prelude emacs25 org installed

;; my ~/prelude/personal/personal.el
(prelude-require-package 'ob-async)                                                                              
(require 'ob-async)   
(setq org-confirm-babel-evaluate nil)                                                                            

   (sh . t)                                                                                                      
   (ruby . t)                                                                                                    
  • 1
  • There are (today) 34 questions with a match for function definition is void: emacs.stackexchange.com/… The error always means the same thing, in the immediate sense, though the proper remedy can be different in different cases (e.g. trying to use a variable as a function, package not loaded yet, wrong Emacs version). The most common cause is not first loading the needed library. It would be great if someone carefully consolidated most or all of those questions into a new, generic, community question with a good answer. – Drew Dec 22 '17 at 18:58

According to https://lists.gnu.org/archive/html/emacs-orgmode/2015-11/msg00425.html ob-sh was renamed ob-shell in org 8.2 ... and I cite from there:

org-babel-get-header was removed in 0d000f5 (babel: small change in API., 2015-10-29), but the old ob-sh.el is still trying to call it.

That means you should replace (sh . t) by (shell . t) in your call of org-babel-do-load-languages. And don't forget to re-start emacs afterwards! ;-)

EDIT: You don't need to to change the source language of your source code blocks from sh to shell. It is only important to call org-babel-shell-initialize.

The source code languages that are supported by ob-shell are defined in the option org-babel-shell-names (which can be customized).

The default value of org-babel-shell-names is:

'("sh" "bash" "csh" "ash" "dash" "ksh" "mksh" "posh")

From these names org-babel-execute:... functions are generated by org-babel-shell-initialize.

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.