The Org manual says:

C-c ' for editing the current code block. It opens a new major-mode edit buffer containing the body of the ‘src’ code block, ready for any edits.

This feature is sweet.

However, since only the current code block is edited, previous code blocks in the same session/tangle are not evaluated. Hence, imports and variables are missing and produce errors in e.g. flycheck.

Code completion does not work. Is there a way to change this? For example, include all code in the edit buffer?

For example:

#+BEGIN_SRC ipython +n :session :tangel yes :results output


This produces error messages because of undefined names previously_defined_axes and previously_defined_list, although they were defined in the previous code block.

Also, os is not treated as imported and tab completion fails.

Any ideas how to circumvent this?

  • after some further research I found this and this question which is about the same topic. Lentic is suggested, the question is not resolved, though, because it does not do what is expeced. Sep 6, 2018 at 14:46


Your Answer

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