I am using noweb with org-babel. What I enter in org-mode is as follows

#+BEGIN_SRC python :tangle yes :noweb tangle :comments noweb
  import sys
  import os

  def main(args):
      <<initialize-the-game-board>>

  if __name__ == "__main__":
      main(sys.argv)
#+END_SRC


#+NAME: initialize-the-game-board
#+BEGIN_SRC python :comments noweb
  board = [[-1 for x in range(3)] for y in range(3)]
#+END_SRC

This was taken from https://emacs.stackexchange.com/a/37079/15545. Normally (without noweb) when I go to the tangled file (the python file) I can use org-babel-tangle-jump-to-orgto back to the code in the org-file, but this function gets confused when I use noweb.

If I place my cursor in the def main(args): and run the command I can jump back to my org file but not if I place it at main(sys.argv). I think this is because the org-babel-tangle-jump-to-orgis counting the lines of code in the code blocks in the org file but then it gets confused when noweb structure is introduced.

What would be a possible workaround this i.e. be able to use org-babel-tangle-jump-to-org while also using noweb?

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.