julia-snail icon indicating copy to clipboard operation
julia-snail copied to clipboard

problem when exporting org-mode file with source block

Open dahtah opened this issue 2 years ago • 2 comments

I'm having trouble getting the new org-babel support to work properly. Evaluating code blocks works but exporting results doesn't. MRE: initialise a test.org file with

-*- julia-snail-extensions: (ob-julia) -*- 

#+begin_src julia :exports both
a = "abc"
#+end_src

save, reload to add ob-julia extension, then M-x julia-snail, followed by org-beamer-export-to-pdf (NB: same problem appears with html export). Export fails with an error, trace is

Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
  goto-char(nil)
  (let ((out (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert-file-contents out-file) (let ... ...)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))))) (puthash (current-thread) (copy-marker (point)) julia-snail/ob-julia--point-finals) (goto-char (gethash (current-thread) julia-snail/ob-julia--point-inits)) out)
  (let ((src-file (concat (org-babel-temp-file "julia-src-") ".jl")) (out-file (org-babel-temp-file "julia-out-")) (module (let ((maybe-module (cdr (assq :module params)))) (if maybe-module maybe-module "Main")))) (let ((temp-file src-file) (temp-buffer (generate-new-buffer " *temp file*"))) (unwind-protect (prog1 (save-current-buffer (set-buffer temp-buffer) (insert body)) (save-current-buffer (set-buffer temp-buffer) (write-region nil nil temp-file nil 0))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))) (julia-snail/ob-julia-evaluate module body src-file out-file) (let ((out (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn ... ...) (and ... ...)))))) (puthash (current-thread) (copy-marker (point)) julia-snail/ob-julia--point-finals) (goto-char (gethash (current-thread) julia-snail/ob-julia--point-inits)) out))
  org-babel-execute:julia("a = \"abc\"" ((:colname-names) (:rowname-names) (:result-params "replace") (:result-type . value) (:results . "replace") (:exports . "both") (:cache . "no") (:hlines . "no") (:module . "Main") (:noweb . "no") (:session . "none") (:tangle . "no") (:wrap)))

dahtah avatar Jun 27 '22 14:06 dahtah

@MasonProtter: What do you think?

gcv avatar Jun 28 '22 20:06 gcv

I am also getting this isssue

kiranshila avatar Jul 01 '22 01:07 kiranshila

Sorry for the late response, I was away. Think #106 should fix this.

MasonProtter avatar Aug 09 '22 17:08 MasonProtter

Thanks, @MasonProtter! @dahtah, @kiranshila: Could you please check that this works for you now (and reopen the ticket if necessary)?

gcv avatar Aug 12 '22 22:08 gcv