I know you can use org-babel-execute-src-block (C-c C-c) to execute individual code blocks, but is there something akin to "Run all chunks above" that RStudio has for Rmarkdown files?

1 Answer 1


You can easily run all code blocks via C-c C-v C-b, or all blocks in a subtree. I don't think above this point is implemented.

It would be fairly easy write a custom function that takes all text below the point, hides it, executes all code blocks, and then restores the text. I would do that rather than taking all text above the point and executing it in a temporary buffer, because some code blocks may use the buffer-name or file-name so it should not be changed.

  • 1
    Note: Because of << noweb >> remote code inclusion, it may be difficult to know that blocks above don't depend on blocks below.
    – mankoff
    Commented Jan 23, 2020 at 12:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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