Open diadochos opened 7 years ago
Wow! Thank you! I'll wait for that.
https://github.com/diadochos/org-babel-eval-in-repl/pull/11
And I suggest don't bind [C-c C-c]
. Use [C-c <return>]
instead.
@stardiviner
Sorry that I didn't clarify, but the problem was not that we can use this function outside a source block.
The problem is that (org-babel-get-src-block-info)
still returns the information even if the cursor is on the header or the footer, therefore the header string (i.e. #+BEGIN_SRC foo
) or the footer (i.e. #END_SRC
) is sent to the REPL as is.
(Normally this will not likely cause a problem because # is often the symbol for starting a comment, but it would be more elegant if these lines wouldn't appear in the REPL buffer.)
(Example procedure to reproduce:
(ober-eval-in-repl)
)Still, the validation in your PR makes sense, so please do include this commit.
Finally, as for your suggestion regarding the key binding, I agree.
[C-c C-c]
is used for multiple purposes in org-mode, so we should avoid binding this (Yet, I've never used C-c C-c for any other purpose for myself, so I personally will bind C-c C-c). Thank you for pointing out.
By the way, because the problem has been changed, please let me know if you want to stop here and have the PR merged. However, I will very much appreciate it if you could try to solve the new problem too (since I have no idea yet).
I have an idea, I will create an PR.