I try to work with the tangled file in order to be able to use
python-mode features. Eventually I detangle.

The changes I make in each code block in the tangled source code file
are many and the code block will change in size. I believe this
creates a bug because of the following lines in
org-babel-tangle-jump-to-org

      ;; Try to preserve location of point within the source code in
      ;; tangled code file.
       (let ((offset (- mid body-start)))
         (when (> end (+ offset (point)))
           (forward-char offset)))

For instance, if I call org-babel-tangle-jump-to-org directly, if the
offset is larger than the size of the original block in the org-file
(as I have written more lines of code in the python file) I will end
up outside the block when jumping. On the other hand,
org-babel-detangle will call org-babel-tangle-jump-to-org only after
it has searched for the end of the code block "... ends here", making
the offset the maximum possible. For my own benefit, I have simply
commented the lines above.

Reply via email to