* Port scimax's org facility functions
We provide a hydra to easily use the functions.
By default, the binding to call the hydra is `C-c h`
The hydra is only created if the hydra package is loaded.
* Move org extensions to its own file.
* Integrate revision comments
* Replaced manual placement of src blocks with
`org-element-interpret-data`
* Refactor some functions
* Add a hydra to `jupyter-org-interaction-mode-map`
Only actually define the Hydra if the package `hydra` exists.
* Refactor org extension functions.
* org-extensions: refactor and cleanup
* Remove compiler warnings
* Change condition-case for ignore-errors
* Functions that restart the kernel now work
* Use ivy and avy functions only if package exists
* org-extensions: change hydra bindings
* Match the hydra bindings better to emacs conventions
* org-extensions: improvements and code refactoring
* add where external functions should be found
* take into account empty RESULTS when moving blocks
* org-extensions: use context variable for jumping
* org-extensions: improve jumping to block function
* Set a default variable to specify how many lines of context to show
* Consider the case when a user supplies the nil value
This method allows kernel languages to do transformations of a src-block's code
based on the parameters supplied to the src-block before sending the code to
the kernel. The method is called in `org-babel-expand-body:jupyter`. Currently
the only parameter supported is the `:dir` option of a src-block.
Change the behavior of `jupyter-org-sync-results` to return the org formatted
result string and modify the result parameters in `org-babel-execute:jupyter`
to add the "raw" result parameter so that the result string is directly
inserted into the buffer.
This is to work towards better support for in-lined code blocks.
There was an ugly hack that destructively modified the source block parameters
supplied to the org-babel execute function to make `org-babel-insert-result` do
all of the insertion work. This relied too much on knowing the internals of
that function. I also could never figure out how to insert stream results in a
clean way.
Instead we manually insert the results by taking advantage of the `org-element`
API. Specifically the function `org-element-interpret-data` which takes an org
syntax tree and returns its printed representation. Now the
`jupyter-org-result` method returns either a string or a syntax tree. If the
latter is returned, it is filtered through `org-element-interpret-data` to
obtain the string representation for insertion.
In addition, all source blocks insert results in a RESULTS drawer. This allows
for inserting stream output as raw text in the drawer and allows for a way to
append results since the end of the drawer acts as an insertion point.