Closed MasonProtter closed 3 months ago
That was a fun little problem to debug. :)
This happens because julia-snail-repl-buffer
is a buffer-local variable, not a regular dynamic variable. (I'm not sure there's a good way to make it dynamic and still allow .dir-locals.el
customization — maybe I don't fully understand the semantics here.) So it's correctly set in your org-mode file. Then, in julia-snail/ob-julia--module-at-point
you use with-temp-buffer
. Inside the temporary buffer, the buffer-local value of julia-snail-repl-buffer
disappears (because the temporary buffer is probably not in the same directory as your original org file). Then you call julia-snail--cst-module-at
, which expects julia-snail-repl-buffer
to be set.
I think you can just save the value of julia-snail-repl-buffer
outside with-temp-buffer
, and rebind it inside. You can see me working around a similar problem here: https://github.com/gcv/julia-snail/blob/69d2a4c183925c820516fe860aed8964a78c9895/julia-snail.el#L1797-L1801
Ahh, that makes sense!
in my
.dir-locals.el
so that I'm using a non-standardjulia-snail-repl-buffer
, then whenever I enter asrc julia
org block and attempt to do autocompletion, I get notifiedevaluation and everything works totally fine, but I think somehow the
julia-snail-repl-buffer
isn't getting properly communicated tojulia-snail-repl-completion-at-point
something.This problem appears to only be present in the
ob-julia
extension, not when editing.jl
files, and I realize I was the one who implemented theob-julia
extension, but maybe someone familiar with how the completion system works can take a look and help me figure out what I did wrong.