* :session for Julia in org babel?
@ 2022-08-08 15:19 Fraga, Eric
2022-08-08 15:49 ` Bill Burdick
2022-08-17 10:16 ` Timothy
0 siblings, 2 replies; 24+ messages in thread
From: Fraga, Eric @ 2022-08-08 15:19 UTC (permalink / raw)
To: Emacs Org mode mailing list
Hello all,
has anybody tried using sessions for Julia in org?
I'm asking because I've never used sessions (for any language) before
and it's failing with obscure ess- related errors so I just want to
confirm that Julia should (or should not) work with sessions before I
spend some time debugging.
Thank you,
eric
--
: Eric S Fraga, with org release_9.5.4-719-g00adad in Emacs 29.0.50
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: :session for Julia in org babel?
2022-08-08 15:19 :session for Julia in org babel? Fraga, Eric
@ 2022-08-08 15:49 ` Bill Burdick
2022-08-08 16:28 ` Fraga, Eric
2022-08-17 10:16 ` Timothy
1 sibling, 1 reply; 24+ messages in thread
From: Bill Burdick @ 2022-08-08 15:49 UTC (permalink / raw)
To: Org Mode List
[-- Attachment #1: Type: text/plain, Size: 657 bytes --]
Julia works in org without sessions for me but with sessions I get this
error:
org-babel-execute:julia: Cannot open load file: No such file or directory,
ess
-- Bill
On Mon, Aug 8, 2022 at 11:22 AM Fraga, Eric <e.fraga@ucl.ac.uk> wrote:
> Hello all,
>
> has anybody tried using sessions for Julia in org?
>
> I'm asking because I've never used sessions (for any language) before
> and it's failing with obscure ess- related errors so I just want to
> confirm that Julia should (or should not) work with sessions before I
> spend some time debugging.
>
> Thank you,
> eric
>
> --
> : Eric S Fraga, with org release_9.5.4-719-g00adad in Emacs 29.0.50
>
[-- Attachment #2: Type: text/html, Size: 1163 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: :session for Julia in org babel?
2022-08-08 15:49 ` Bill Burdick
@ 2022-08-08 16:28 ` Fraga, Eric
2022-08-08 16:51 ` Bill Burdick
0 siblings, 1 reply; 24+ messages in thread
From: Fraga, Eric @ 2022-08-08 16:28 UTC (permalink / raw)
To: Bill Burdick; +Cc: Org Mode List
Hi Bill,
thank you for the quick response.
On Monday, 8 Aug 2022 at 11:49, Bill Burdick wrote:
> Julia works in org without sessions for me but with sessions I get this error:
>
> org-babel-execute:julia: Cannot open load file: No such file or directory, ess
Yeah, it does require the ess package to be installed. I do have that
so I get further than you do, I guess. But then get errors related to
ess settings. I'll see whether anybody else has some experience before
I start digging into the code!
Thanks again,
eric
--
: Eric S Fraga, with org release_9.5.4-720-g4db67d in Emacs 29.0.50
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: :session for Julia in org babel?
2022-08-08 16:28 ` Fraga, Eric
@ 2022-08-08 16:51 ` Bill Burdick
2022-08-08 17:36 ` Fraga, Eric
2022-08-09 12:39 ` Ihor Radchenko
0 siblings, 2 replies; 24+ messages in thread
From: Bill Burdick @ 2022-08-08 16:51 UTC (permalink / raw)
To: Org Mode List
[-- Attachment #1: Type: text/plain, Size: 1282 bytes --]
OK, now I get this:
ess-eval-buffer: Wrong type argument: symbolp,
((inferior-ess-primary-prompt . "\\w*> ") (inferior-ess-secondary-prompt)
(inferior-ess-prompt . "\\w*> ") (ess-local-customize-alist .
ess-julia-customize-alist) (inferior-ess-program . inferior-julia-program)
(ess-load-command . "include(expanduser(\"%s\"))
") (ess-funargs-command . "ESS.fun_args(\"%s\")
") (ess-dump-error-re . "in \\w* at \\(.*\\):[0-9]+") (ess-error-regexp .
"\\(^\\s-*at\\s-*\\(?3:.*\\):\\(?2:[0-9]+\\)\\)") (ess-error-regexp-alist .
ess-julia-error-regexp-alist) ...)
-- Bill
On Mon, Aug 8, 2022 at 12:28 PM Fraga, Eric <e.fraga@ucl.ac.uk> wrote:
> Hi Bill,
>
> thank you for the quick response.
>
> On Monday, 8 Aug 2022 at 11:49, Bill Burdick wrote:
> > Julia works in org without sessions for me but with sessions I get this
> error:
> >
> > org-babel-execute:julia: Cannot open load file: No such file or
> directory, ess
>
> Yeah, it does require the ess package to be installed. I do have that
> so I get further than you do, I guess. But then get errors related to
> ess settings. I'll see whether anybody else has some experience before
> I start digging into the code!
>
> Thanks again,
> eric
>
> --
> : Eric S Fraga, with org release_9.5.4-720-g4db67d in Emacs 29.0.50
[-- Attachment #2: Type: text/html, Size: 1897 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: :session for Julia in org babel?
2022-08-08 16:51 ` Bill Burdick
@ 2022-08-08 17:36 ` Fraga, Eric
2022-08-09 12:39 ` Ihor Radchenko
1 sibling, 0 replies; 24+ messages in thread
From: Fraga, Eric @ 2022-08-08 17:36 UTC (permalink / raw)
To: Bill Burdick; +Cc: Org Mode List
> OK, now I get this:
> ess-eval-buffer: Wrong type argument: symbolp,
[...]
> (ess-error-regexp-alist . ess-julia-error-regexp-alist) ...)
Yeah, pretty much what I get as well. Thanks for confirming that it's
not my configuration that causes this!
--
: Eric S Fraga, with org release_9.5.4-720-g4db67d in Emacs 29.0.50
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: :session for Julia in org babel?
2022-08-08 16:51 ` Bill Burdick
2022-08-08 17:36 ` Fraga, Eric
@ 2022-08-09 12:39 ` Ihor Radchenko
2022-08-09 12:53 ` Fraga, Eric
1 sibling, 1 reply; 24+ messages in thread
From: Ihor Radchenko @ 2022-08-09 12:39 UTC (permalink / raw)
To: Bill Burdick; +Cc: Org Mode List
Bill Burdick <bill.burdick@gmail.com> writes:
> OK, now I get this:
>
> ess-eval-buffer: Wrong type argument: symbolp,
> ((inferior-ess-primary-prompt . "\\w*> ") (inferior-ess-secondary-prompt)
> (inferior-ess-prompt . "\\w*> ") (ess-local-customize-alist .
> ess-julia-customize-alist) (inferior-ess-program . inferior-julia-program)
> (ess-load-command . "include(expanduser(\"%s\"))
> ") (ess-funargs-command . "ESS.fun_args(\"%s\")
> ") (ess-dump-error-re . "in \\w* at \\(.*\\):[0-9]+") (ess-error-regexp .
> "\\(^\\s-*at\\s-*\\(?3:.*\\):\\(?2:[0-9]+\\)\\)") (ess-error-regexp-alist .
> ess-julia-error-regexp-alist) ...)
Can you please run M-x toggle-debug-on-error and share the full
backtrace?
--
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: :session for Julia in org babel?
2022-08-09 12:39 ` Ihor Radchenko
@ 2022-08-09 12:53 ` Fraga, Eric
2022-08-09 12:54 ` Bill Burdick
2022-08-10 7:10 ` Ihor Radchenko
0 siblings, 2 replies; 24+ messages in thread
From: Fraga, Eric @ 2022-08-09 12:53 UTC (permalink / raw)
To: Ihor Radchenko; +Cc: Bill Burdick, Org Mode List
Hi Ihor,
On Tuesday, 9 Aug 2022 at 20:39, Ihor Radchenko wrote:
> Can you please run M-x toggle-debug-on-error and share the full
> backtrace?
See below. I've not started investigating at all. The Julia REPL
buffer does get started so it's not an issue with Julia itself.
The backtrace below is the result of typing C-c C-c on this src block:
#+name: exampleusingfresa
#+begin_src julia
using Fresa
#+end_src
with these header settings:
:PROPERTIES:
:header-args:julia: :tangle no :exports code :noweb yes :session
:END:
Thank you,
eric
--8<---------------cut here---------------start------------->8---
Debugger entered--Lisp error: (wrong-type-argument symbolp ((inferior-ess-primary-prompt . "\\w*> ") (inferior-ess-secondary-prompt) (inferior-ess-prompt . "\\w*> ") (ess-local-customize-alist . ess-julia-customize-alist) (inferior-ess-program . inferior-julia-program) (ess-load-command . "include(expanduser(\"%s\"))\n") (ess-funargs-command . "ESS.fun_args(\"%s\")\n") (ess-dump-error-re . "in \\w* at \\(.*\\):[0-9]+") (ess-error-regexp . "\\(^\\s-*at\\s-*\\(?3:.*\\):\\(?2:[0-9]+\\)\\)") (ess-error-regexp-alist . ess-julia-error-regexp-alist) (ess-mode-completion-syntax-table . ess-julia-completion-syntax-table) (inferior-ess-help-command . "ESS.help(\"%s\")\n") (ess-language . "julia") (ess-dialect . "julia") (ess-suffix . "jl") (ess-dump-filename-template replace-regexp-in-string "S$" ess-suffix ess-dump-filename-template-proto) (ess-mode-editing-alist) (ess-change-sp-regexp) (ess-help-sec-regex . ess-help-r-sec-regex) (ess-help-sec-keys-alist . ess-help-r-sec-keys-alist) (ess-function-pattern . ess-r-function-pattern) (ess-object-name-db-file . "ess-jl-namedb.el") (ess-smart-operators . ess-r-smart-operators) (inferior-ess-exit-command . "exit()\n") (inferior-ess-language-start) (ess-STERM . "iESS") (ess-editor . ess-r-editor) (ess-pager . ess-r-pager) (ess-getwd-command . "pwd()\n") (ess-setwd-command . "cd(expanduser(\"%s\"))\n")))
ess-eval-region(1 12 nil "Eval buffer" buffer)
ess-eval-buffer(nil)
org-babel-julia-evaluate-session(#<buffer *Julia*> "using Fresa" value ("replace") nil)
org-babel-julia-evaluate(#<buffer *Julia*> "using Fresa" value ("replace") nil)
org-babel-execute:julia("using Fresa" ((:colname-names) (:rowname-names) (:result-params "replace") (:result-type . value) (:results . "replace") (:exports . "code") (:cache . "no") (:hlines . "no") (:comments . "yes") (:tangle . "no") (:noweb . "yes") (:session)))
org-babel-execute-src-block(nil ("julia" "using Fresa" ((:colname-names) (:rowname-names) (:result-params "replace") (:result-type . value) (:results . "replace") (:exports . "code") (:session) (:noweb . "yes") (:tangle . "no") (:comments . "yes") (:hlines . "no") (:cache . "no")) "" "exampleusingfresa" 10118 "(ref:%s)"))
org-ctrl-c-ctrl-c(nil)
funcall-interactively(org-ctrl-c-ctrl-c nil)
command-execute(org-ctrl-c-ctrl-c)
--8<---------------cut here---------------end--------------->8---
--
: Eric S Fraga, with org release_9.5.4-720-g4db67d in Emacs 29.0.50
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: :session for Julia in org babel?
2022-08-09 12:53 ` Fraga, Eric
@ 2022-08-09 12:54 ` Bill Burdick
2022-08-10 7:10 ` Ihor Radchenko
1 sibling, 0 replies; 24+ messages in thread
From: Bill Burdick @ 2022-08-09 12:54 UTC (permalink / raw)
To: Org Mode List; +Cc: Ihor Radchenko
[-- Attachment #1: Type: text/plain, Size: 3332 bytes --]
OK, I was just about to hit "Send". My backtrace is the same.
-- Bill
On Tue, Aug 9, 2022 at 8:53 AM Fraga, Eric <e.fraga@ucl.ac.uk> wrote:
> Hi Ihor,
>
> On Tuesday, 9 Aug 2022 at 20:39, Ihor Radchenko wrote:
> > Can you please run M-x toggle-debug-on-error and share the full
> > backtrace?
>
> See below. I've not started investigating at all. The Julia REPL
> buffer does get started so it's not an issue with Julia itself.
>
> The backtrace below is the result of typing C-c C-c on this src block:
>
> #+name: exampleusingfresa
> #+begin_src julia
> using Fresa
> #+end_src
>
> with these header settings:
>
> :PROPERTIES:
> :header-args:julia: :tangle no :exports code :noweb yes :session
> :END:
>
> Thank you,
> eric
>
> --8<---------------cut here---------------start------------->8---
> Debugger entered--Lisp error: (wrong-type-argument symbolp
> ((inferior-ess-primary-prompt . "\\w*> ") (inferior-ess-secondary-prompt)
> (inferior-ess-prompt . "\\w*> ") (ess-local-customize-alist .
> ess-julia-customize-alist) (inferior-ess-program . inferior-julia-program)
> (ess-load-command . "include(expanduser(\"%s\"))\n") (ess-funargs-command .
> "ESS.fun_args(\"%s\")\n") (ess-dump-error-re . "in \\w* at
> \\(.*\\):[0-9]+") (ess-error-regexp .
> "\\(^\\s-*at\\s-*\\(?3:.*\\):\\(?2:[0-9]+\\)\\)") (ess-error-regexp-alist .
> ess-julia-error-regexp-alist) (ess-mode-completion-syntax-table .
> ess-julia-completion-syntax-table) (inferior-ess-help-command .
> "ESS.help(\"%s\")\n") (ess-language . "julia") (ess-dialect . "julia")
> (ess-suffix . "jl") (ess-dump-filename-template replace-regexp-in-string
> "S$" ess-suffix ess-dump-filename-template-proto) (ess-mode-editing-alist)
> (ess-change-sp-regexp) (ess-help-sec-regex . ess-help-r-sec-regex)
> (ess-help-sec-keys-alist . ess-help-r-sec-keys-alist) (ess-function-pattern
> . ess-r-function-pattern) (ess-object-name-db-file . "ess-jl-namedb.el")
> (ess-smart-operators . ess-r-smart-operators) (inferior-ess-exit-command .
> "exit()\n") (inferior-ess-language-start) (ess-STERM . "iESS") (ess-editor
> . ess-r-editor) (ess-pager . ess-r-pager) (ess-getwd-command . "pwd()\n")
> (ess-setwd-command . "cd(expanduser(\"%s\"))\n")))
> ess-eval-region(1 12 nil "Eval buffer" buffer)
> ess-eval-buffer(nil)
> org-babel-julia-evaluate-session(#<buffer *Julia*> "using Fresa" value
> ("replace") nil)
> org-babel-julia-evaluate(#<buffer *Julia*> "using Fresa" value
> ("replace") nil)
> org-babel-execute:julia("using Fresa" ((:colname-names) (:rowname-names)
> (:result-params "replace") (:result-type . value) (:results . "replace")
> (:exports . "code") (:cache . "no") (:hlines . "no") (:comments . "yes")
> (:tangle . "no") (:noweb . "yes") (:session)))
> org-babel-execute-src-block(nil ("julia" "using Fresa" ((:colname-names)
> (:rowname-names) (:result-params "replace") (:result-type . value)
> (:results . "replace") (:exports . "code") (:session) (:noweb . "yes")
> (:tangle . "no") (:comments . "yes") (:hlines . "no") (:cache . "no")) ""
> "exampleusingfresa" 10118 "(ref:%s)"))
> org-ctrl-c-ctrl-c(nil)
> funcall-interactively(org-ctrl-c-ctrl-c nil)
> command-execute(org-ctrl-c-ctrl-c)
> --8<---------------cut here---------------end--------------->8---
>
> --
> : Eric S Fraga, with org release_9.5.4-720-g4db67d in Emacs 29.0.50
[-- Attachment #2: Type: text/html, Size: 4366 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: :session for Julia in org babel?
2022-08-09 12:53 ` Fraga, Eric
2022-08-09 12:54 ` Bill Burdick
@ 2022-08-10 7:10 ` Ihor Radchenko
2022-08-10 7:56 ` Fraga, Eric
2022-08-16 12:52 ` Fraga, Eric
1 sibling, 2 replies; 24+ messages in thread
From: Ihor Radchenko @ 2022-08-10 7:10 UTC (permalink / raw)
To: Fraga, Eric; +Cc: Bill Burdick, Org Mode List
"Fraga, Eric" <e.fraga@ucl.ac.uk> writes:
> Debugger entered--Lisp error: (wrong-type-argument symbolp ((inferior-ess-primary-prompt . "\\w*> ") (inferior-ess-secondary-prompt) (inferior-ess-prompt . "\\w*> ") (ess-local-customize-alist . ess-julia-customize-alist) (inferior-ess-program . inferior-julia-program) (ess-load-command . "include(expanduser(\"%s\"))\n") (ess-funargs-command . "ESS.fun_args(\"%s\")\n") (ess-dump-error-re . "in \\w* at \\(.*\\):[0-9]+") (ess-error-regexp . "\\(^\\s-*at\\s-*\\(?3:.*\\):\\(?2:[0-9]+\\)\\)") (ess-error-regexp-alist . ess-julia-error-regexp-alist) (ess-mode-completion-syntax-table . ess-julia-completion-syntax-table) (inferior-ess-help-command . "ESS.help(\"%s\")\n") (ess-language . "julia") (ess-dialect . "julia") (ess-suffix . "jl") (ess-dump-filename-template replace-regexp-in-string "S$" ess-suffix ess-dump-filename-template-proto) (ess-mode-editing-alist) (ess-change-sp-regexp) (ess-help-sec-regex . ess-help-r-sec-regex) (ess-help-sec-keys-alist . ess-help-r-sec-keys-alist) (ess-function-pattern . ess-r-function-pattern) (ess-object-name-db-file . "ess-jl-namedb.el") (ess-smart-operators . ess-r-smart-operators) (inferior-ess-exit-command . "exit()\n") (inferior-ess-language-start) (ess-STERM . "iESS") (ess-editor . ess-r-editor) (ess-pager . ess-r-pager) (ess-getwd-command . "pwd()\n") (ess-setwd-command . "cd(expanduser(\"%s\"))\n")))
> ess-eval-region(1 12 nil "Eval buffer" buffer)
This looks like a bug in ess itself.
(defun ess-eval-region ...
(ess-setq-vars-local (symbol-value (ess-get-process-variable 'ess-local-customize-alist)))
...)
The above code does not work at all because ess-get-process-variable
returns the variable value, not a symbol.
Please report to ESS devs.
--
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: :session for Julia in org babel?
2022-08-10 7:10 ` Ihor Radchenko
@ 2022-08-10 7:56 ` Fraga, Eric
2022-08-16 12:52 ` Fraga, Eric
1 sibling, 0 replies; 24+ messages in thread
From: Fraga, Eric @ 2022-08-10 7:56 UTC (permalink / raw)
To: Ihor Radchenko; +Cc: Bill Burdick, Org Mode List
On Wednesday, 10 Aug 2022 at 15:10, Ihor Radchenko wrote:
> Please report to ESS devs.
Will do. Thanks.
--
: Eric S Fraga, with org release_9.5.4-720-g4db67d in Emacs 29.0.50
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: :session for Julia in org babel?
2022-08-10 7:10 ` Ihor Radchenko
2022-08-10 7:56 ` Fraga, Eric
@ 2022-08-16 12:52 ` Fraga, Eric
2022-08-16 13:21 ` Ihor Radchenko
1 sibling, 1 reply; 24+ messages in thread
From: Fraga, Eric @ 2022-08-16 12:52 UTC (permalink / raw)
To: Ihor Radchenko; +Cc: Bill Burdick, Org Mode List
[-- Attachment #1: Type: text/plain, Size: 569 bytes --]
On Wednesday, 10 Aug 2022 at 15:10, Ihor Radchenko wrote:
> This looks like a bug in ess itself.
[...]
> Please report to ESS devs.
After discussion with Stephen Eglen on the ESS mailing list, he gave me
a single line of elisp to add to ob-julia.el for sessions to work and
noted that the Julia installation must have two specific packages
available (I'm not sure why that is). See attached patch (which
includes a URL for the archive of the email thread).
thank you,
eric
--
: Eric S Fraga, with org release_9.5.4-737-gd3a9c4 in Emacs 29.0.50
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-lisp-ob-julia.el-Fix-session-support-for-Julia.patch --]
[-- Type: text/x-diff; name="0001-lisp-ob-julia.el-Fix-session-support-for-Julia.patch", Size: 1310 bytes --]
From 8847c86ae29d8065353e8f75793d917bf615637e Mon Sep 17 00:00:00 2001
From: Eric S Fraga <e.fraga@ucl.ac.uk>
Date: Tue, 16 Aug 2022 13:23:18 +0100
Subject: [PATCH] lisp/ob-julia.el: Fix session support for Julia
* ob-julia.el (org-babel-julia-evaluate-session, commentary): Add line
to initialize ESS so that Julia sessions work. Also added text in
commentary about Julia packages that sessions require. Fix
contributed by Stephen Eglen. See discussion:
https://stat.ethz.ch/pipermail/ess-help/2022-August/013113.html.
---
lisp/ob-julia.el | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lisp/ob-julia.el b/lisp/ob-julia.el
index 7f25fafad..a8a832cc4 100644
--- a/lisp/ob-julia.el
+++ b/lisp/ob-julia.el
@@ -26,6 +26,9 @@
;; Org-Babel support for evaluating julia code
;;
;; Based on ob-R.el by Eric Schulte and Dan Davison.
+;;
+;; Session support requires the installation of the DataFrames and CSV
+;; Julia packages.
;;; Code:
(require 'cl-lib)
@@ -280,6 +283,7 @@ last statement in BODY, as elisp."
(cl-case result-type
(value
(with-temp-buffer
+ (setq ess-local-customize-alist t)
(insert (org-babel-chomp body))
(let ((ess-local-process-name
(process-name (get-buffer-process session)))
--
2.30.2
^ permalink raw reply related [flat|nested] 24+ messages in thread
* Re: :session for Julia in org babel?
2022-08-16 12:52 ` Fraga, Eric
@ 2022-08-16 13:21 ` Ihor Radchenko
2022-08-16 16:06 ` Fraga, Eric
0 siblings, 1 reply; 24+ messages in thread
From: Ihor Radchenko @ 2022-08-16 13:21 UTC (permalink / raw)
To: Fraga, Eric; +Cc: Bill Burdick, Org Mode List
"Fraga, Eric" <e.fraga@ucl.ac.uk> writes:
>> Please report to ESS devs.
>
> After discussion with Stephen Eglen on the ESS mailing list, he gave me
> a single line of elisp to add to ob-julia.el for sessions to work and
> noted that the Julia installation must have two specific packages
> available (I'm not sure why that is). See attached patch (which
> includes a URL for the archive of the email thread).
Thanks!
Can you also update
https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-julia.html?
(https://git.sr.ht/~bzg/worg/)
> (value
> (with-temp-buffer
> + (setq ess-local-customize-alist t)
This will set the variable globally. You may want setq-local instead.
--
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: :session for Julia in org babel?
2022-08-16 13:21 ` Ihor Radchenko
@ 2022-08-16 16:06 ` Fraga, Eric
2022-08-16 21:16 ` Christopher M. Miles
` (2 more replies)
0 siblings, 3 replies; 24+ messages in thread
From: Fraga, Eric @ 2022-08-16 16:06 UTC (permalink / raw)
To: Ihor Radchenko; +Cc: Bill Burdick, Org Mode List
[-- Attachment #1: Type: text/plain, Size: 517 bytes --]
On Tuesday, 16 Aug 2022 at 21:21, Ihor Radchenko wrote:
> Can you also update [Worg]
I will do so, maybe tomorrow. I assume that's okay as it's a separate
repository? and as I do not have submit access, I'll post a patch here,
if that's okay?
> This will set the variable globally. You may want setq-local instead.
I've put the setting into the (let ...) and it seems to work just fine.
New patch attached.
thank you,
eric
--
: Eric S Fraga, with org release_9.5.4-737-gd3a9c4 in Emacs 29.0.50
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-lisp-ob-julia.el-Fix-session-support-for-Julia.patch --]
[-- Type: text/x-diff; name="0001-lisp-ob-julia.el-Fix-session-support-for-Julia.patch", Size: 1404 bytes --]
From dabcbd8005d5323d8a784f031b7fc5d1523b7b6d Mon Sep 17 00:00:00 2001
From: Eric S Fraga <e.fraga@ucl.ac.uk>
Date: Tue, 16 Aug 2022 17:03:33 +0100
Subject: [PATCH] lisp/ob-julia.el: Fix session support for Julia
* ob-julia.el (org-babel-julia-evaluate-session, commentary): Add line
to initialize ESS so that Julia sessions work. Also added text in
commentary about Julia packages that sessions require. Fix
contributed by Stephen Eglen. See discussion:
https://stat.ethz.ch/pipermail/ess-help/2022-August/013113.html.
---
lisp/ob-julia.el | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lisp/ob-julia.el b/lisp/ob-julia.el
index 7f25fafad..6b2f59354 100644
--- a/lisp/ob-julia.el
+++ b/lisp/ob-julia.el
@@ -26,6 +26,9 @@
;; Org-Babel support for evaluating julia code
;;
;; Based on ob-R.el by Eric Schulte and Dan Davison.
+;;
+;; Session support requires the installation of the DataFrames and CSV
+;; Julia packages.
;;; Code:
(require 'cl-lib)
@@ -281,7 +284,8 @@ last statement in BODY, as elisp."
(value
(with-temp-buffer
(insert (org-babel-chomp body))
- (let ((ess-local-process-name
+ (let ((ess-local-customize-alist t)
+ (ess-local-process-name
(process-name (get-buffer-process session)))
(ess-eval-visibly-p nil))
(ess-eval-buffer nil)))
--
2.30.2
^ permalink raw reply related [flat|nested] 24+ messages in thread
* Re: :session for Julia in org babel?
2022-08-16 16:06 ` Fraga, Eric
@ 2022-08-16 21:16 ` Christopher M. Miles
[not found] ` <62fc0be2.050a0220.306c1.e3baSMTPIN_ADDED_BROKEN@mx.google.com>
2022-08-20 5:56 ` :session for Julia in org babel? Ihor Radchenko
2 siblings, 0 replies; 24+ messages in thread
From: Christopher M. Miles @ 2022-08-16 21:16 UTC (permalink / raw)
To: Fraga, Eric; +Cc: Ihor Radchenko, Bill Burdick, emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 991 bytes --]
"Fraga, Eric" <e.fraga@ucl.ac.uk> writes:
> On Tuesday, 16 Aug 2022 at 21:21, Ihor Radchenko wrote:
>> Can you also update [Worg]
>
> I will do so, maybe tomorrow. I assume that's okay as it's a separate
> repository? and as I do not have submit access, I'll post a patch here,
> if that's okay?
>
>> This will set the variable globally. You may want setq-local instead.
>
> I've put the setting into the (let ...) and it seems to work just fine.
> New patch attached.
>
> thank you,
> eric
What about write a elisp function to automatic the installation of those
required two Julia packages? If not, at least raise a warning for user
to install those two packages after detection not exist. WDYT?
--
[ stardiviner ]
I try to make every word tell the meaning that I want to express without misunderstanding.
Blog: https://stardiviner.github.io/
IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner
GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* Show a warning/message when loading Org modules requiring external packages (was: :session for Julia in org babel?)
[not found] ` <62fc0be2.050a0220.306c1.e3baSMTPIN_ADDED_BROKEN@mx.google.com>
@ 2022-08-17 9:51 ` Ihor Radchenko
2022-08-17 11:45 ` Show a warning/message when loading Org modules requiring external packages Fraga, Eric
` (2 more replies)
0 siblings, 3 replies; 24+ messages in thread
From: Ihor Radchenko @ 2022-08-17 9:51 UTC (permalink / raw)
To: numbchild; +Cc: Fraga, Eric, Bill Burdick, emacs-orgmode
"Christopher M. Miles" <numbchild@gmail.com> writes:
> What about write a elisp function to automatic the installation of those
> required two Julia packages? If not, at least raise a warning for user
> to install those two packages after detection not exist. WDYT?
Installation is not a good idea because there are multiple alternative
package managers in Emacs. Some of them explicitly require user to add
code into init.el (I am referring to straight.el).
However, we may, indeed, show some helpful warning/message.
A reasonable place to implement such message is org-load-modules-maybe.
It might catch the relevant errors and show the message.
Patches are welcome!
--
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: :session for Julia in org babel?
2022-08-08 15:19 :session for Julia in org babel? Fraga, Eric
2022-08-08 15:49 ` Bill Burdick
@ 2022-08-17 10:16 ` Timothy
2022-08-17 11:50 ` Fraga, Eric
1 sibling, 1 reply; 24+ messages in thread
From: Timothy @ 2022-08-17 10:16 UTC (permalink / raw)
To: Fraga, Eric; +Cc: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 291 bytes --]
Hi Eric and Ihor,
The ob-julia code is in need of an overhaul, and it’s on my todo list but I have
no idea when I’ll get to it. In the meantime, I think
<https://github.com/nico202/ob-julia> (which Eric, I think you’ve tried?) should
be better to use.
All the best,
Timothy
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: Show a warning/message when loading Org modules requiring external packages
2022-08-17 9:51 ` Show a warning/message when loading Org modules requiring external packages (was: :session for Julia in org babel?) Ihor Radchenko
@ 2022-08-17 11:45 ` Fraga, Eric
2022-08-17 21:25 ` Show a warning/message when loading Org modules requiring external packages (was: :session for Julia in org babel?) Christopher M. Miles
[not found] ` <62fd5dc7.050a0220.96139.b7e7SMTPIN_ADDED_BROKEN@mx.google.com>
2 siblings, 0 replies; 24+ messages in thread
From: Fraga, Eric @ 2022-08-17 11:45 UTC (permalink / raw)
To: Ihor Radchenko; +Cc: numbchild@gmail.com, Bill Burdick, emacs-orgmode@gnu.org
On Wednesday, 17 Aug 2022 at 17:51, Ihor Radchenko wrote:
> "Christopher M. Miles" <numbchild@gmail.com> writes:
>> What about write a elisp function to automatic the installation of those
>> required two Julia packages? If not, at least raise a warning for user
>> to install those two packages after detection not exist. WDYT?
>
> Installation is not a good idea because there are multiple alternative
> package managers in Emacs. Some of them explicitly require user to add
> code into init.el (I am referring to straight.el).
And more importantly in this case, it is not Emacs that would be
affected but the Julia configuration. Julia has an interesting package
system but not one that I would want Emacs to manipulate behind the
scenes.
--
: Eric S Fraga, with org release_9.5.4-737-gd3a9c4 in Emacs 29.0.50
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: :session for Julia in org babel?
2022-08-17 10:16 ` Timothy
@ 2022-08-17 11:50 ` Fraga, Eric
0 siblings, 0 replies; 24+ messages in thread
From: Fraga, Eric @ 2022-08-17 11:50 UTC (permalink / raw)
To: Timothy; +Cc: emacs-orgmode@gnu.org, Stephen Eglen
On Wednesday, 17 Aug 2022 at 18:16, Timothy wrote:
> The ob-julia code is in need of an overhaul, and it’s on my todo list
> but I have no idea when I’ll get to it.
Stephen Eglen has suggested the same and also that maybe a few of us get
"together" to discuss what is needed etc. I have copied Stephen in.
> In the meantime, I think <https://github.com/nico202/ob-julia> (which
> Eric, I think you’ve tried?) should be better to use.
I have indeed tried it. It is better in some (many) respects but also
has some subtly different outcomes which affect my particular use case
as part of a large book writing project where I don't need any surprises
at this stage ;-). Once I'm finished with the book (soon -- famous last
words), I can consider switching over.
--
: Eric S Fraga, with org release_9.5.4-737-gd3a9c4 in Emacs 29.0.50
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: Show a warning/message when loading Org modules requiring external packages (was: :session for Julia in org babel?)
2022-08-17 9:51 ` Show a warning/message when loading Org modules requiring external packages (was: :session for Julia in org babel?) Ihor Radchenko
2022-08-17 11:45 ` Show a warning/message when loading Org modules requiring external packages Fraga, Eric
@ 2022-08-17 21:25 ` Christopher M. Miles
[not found] ` <62fd5dc7.050a0220.96139.b7e7SMTPIN_ADDED_BROKEN@mx.google.com>
2 siblings, 0 replies; 24+ messages in thread
From: Christopher M. Miles @ 2022-08-17 21:25 UTC (permalink / raw)
To: Ihor Radchenko; +Cc: numbchild, Fraga, Eric, Bill Burdick, emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 1404 bytes --]
Ihor Radchenko <yantar92@gmail.com> writes:
> "Christopher M. Miles" <numbchild@gmail.com> writes:
>
>> What about write a elisp function to automatic the installation of those
>> required two Julia packages? If not, at least raise a warning for user
>> to install those two packages after detection not exist. WDYT?
>
> Installation is not a good idea because there are multiple alternative
> package managers in Emacs. Some of them explicitly require user to add
> code into init.el (I am referring to straight.el).
>
> However, we may, indeed, show some helpful warning/message.
>
> A reasonable place to implement such message is org-load-modules-maybe.
> It might catch the relevant errors and show the message.
I found ~org-load-modules-maybe~ load modules from ~org-modules~, it's a
list of ob-* or ol-* elisp modules. Not Julia modules. I searched
~org-load-modules-maybe~ function invocation code in org-mode source
code, have not relative examples. Don't know how to use
~org-load-modules-maybe~ to detect whether Julia modules exist and raise
helpful warning message.
>
> Patches are welcome!
--
[ stardiviner ]
I try to make every word tell the meaning that I want to express without misunderstanding.
Blog: https://stardiviner.github.io/
IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner
GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: Show a warning/message when loading Org modules requiring external packages (was: :session for Julia in org babel?)
[not found] ` <62fd5dc7.050a0220.96139.b7e7SMTPIN_ADDED_BROKEN@mx.google.com>
@ 2022-08-19 6:02 ` Ihor Radchenko
2022-08-19 12:58 ` Christopher M. Miles
0 siblings, 1 reply; 24+ messages in thread
From: Ihor Radchenko @ 2022-08-19 6:02 UTC (permalink / raw)
To: Christopher M. Miles; +Cc: Fraga, Eric, Bill Burdick, emacs-orgmode
"Christopher M. Miles" <numbchild@gmail.com> writes:
> I found ~org-load-modules-maybe~ load modules from ~org-modules~, it's a
> list of ob-* or ol-* elisp modules. Not Julia modules. I searched
> ~org-load-modules-maybe~ function invocation code in org-mode source
> code, have not relative examples. Don't know how to use
> ~org-load-modules-maybe~ to detect whether Julia modules exist and raise
> helpful warning message.
That was what I was actually referring to. ob-julia also requires two
Elisp packages: julia-mode and ESS
(https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-julia.html)
Now I see that you were referring to the actual Julia packages. Those
may be caught by Julia session code (org-babel-prep-session:julia) and
then a warning may be displayed.
--
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: Show a warning/message when loading Org modules requiring external packages (was: :session for Julia in org babel?)
2022-08-19 6:02 ` Ihor Radchenko
@ 2022-08-19 12:58 ` Christopher M. Miles
0 siblings, 0 replies; 24+ messages in thread
From: Christopher M. Miles @ 2022-08-19 12:58 UTC (permalink / raw)
To: Ihor Radchenko
Cc: Christopher M. Miles, Fraga, Eric, Bill Burdick, emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 1294 bytes --]
Ihor Radchenko <yantar92@gmail.com> writes:
> "Christopher M. Miles" <numbchild@gmail.com> writes:
>
>> I found ~org-load-modules-maybe~ load modules from ~org-modules~, it's a
>> list of ob-* or ol-* elisp modules. Not Julia modules. I searched
>> ~org-load-modules-maybe~ function invocation code in org-mode source
>> code, have not relative examples. Don't know how to use
>> ~org-load-modules-maybe~ to detect whether Julia modules exist and raise
>> helpful warning message.
>
> That was what I was actually referring to. ob-julia also requires two
> Elisp packages: julia-mode and ESS
> (https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-julia.html)
Oh, I misunderstand your meaning.
> Now I see that you were referring to the actual Julia packages. Those
> may be caught by Julia session code (org-babel-prep-session:julia) and
> then a warning may be displayed.
Yes, that's what I mean. Well, if ob-julia session can display warning.
That's fine. I have not realized that scene.
--
[ stardiviner ]
I try to make every word tell the meaning that I want to express without misunderstanding.
Blog: https://stardiviner.github.io/
IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner
GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: :session for Julia in org babel?
2022-08-16 16:06 ` Fraga, Eric
2022-08-16 21:16 ` Christopher M. Miles
[not found] ` <62fc0be2.050a0220.306c1.e3baSMTPIN_ADDED_BROKEN@mx.google.com>
@ 2022-08-20 5:56 ` Ihor Radchenko
2022-08-22 9:30 ` Fraga, Eric
2 siblings, 1 reply; 24+ messages in thread
From: Ihor Radchenko @ 2022-08-20 5:56 UTC (permalink / raw)
To: Fraga, Eric; +Cc: Bill Burdick, Org Mode List
"Fraga, Eric" <e.fraga@ucl.ac.uk> writes:
> On Tuesday, 16 Aug 2022 at 21:21, Ihor Radchenko wrote:
>> Can you also update [Worg]
>
> I will do so, maybe tomorrow. I assume that's okay as it's a separate
> repository? and as I do not have submit access, I'll post a patch here,
> if that's okay?
Sure. You can submit the patch here, and I will apply it.
>> This will set the variable globally. You may want setq-local instead.
>
> I've put the setting into the (let ...) and it seems to work just fine.
> New patch attached.
Thanks!
Applied onto bugfix via 4dff42f6a adding a defvar to pacify the compiler
warnings.
--
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: :session for Julia in org babel?
2022-08-20 5:56 ` :session for Julia in org babel? Ihor Radchenko
@ 2022-08-22 9:30 ` Fraga, Eric
2022-08-22 12:12 ` Ihor Radchenko
0 siblings, 1 reply; 24+ messages in thread
From: Fraga, Eric @ 2022-08-22 9:30 UTC (permalink / raw)
To: Ihor Radchenko; +Cc: Bill Burdick, Org Mode List
[-- Attachment #1: Type: text/plain, Size: 222 bytes --]
On Saturday, 20 Aug 2022 at 13:56, Ihor Radchenko wrote:
> Sure. You can submit the patch here, and I will apply it.
Here it is. Thank you.
--
: Eric S Fraga, with org release_9.5.4-737-gd3a9c4 in Emacs 29.0.50
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-org-contrib-babel-languages-ob-doc-julia.org-Session.patch --]
[-- Type: text/x-diff; name="0001-org-contrib-babel-languages-ob-doc-julia.org-Session.patch", Size: 2323 bytes --]
From 2564c84b41de55d478ba249fa932c40ac62fe510 Mon Sep 17 00:00:00 2001
From: Eric S Fraga <e.fraga@ucl.ac.uk>
Date: Mon, 22 Aug 2022 10:27:52 +0100
Subject: [PATCH] org-contrib/babel/languages/ob-doc-julia.org: Sessions
requirements
* ob-doc-julia.org (Requirements, Sessions): Specify the extra Julia
packages required for sessions to work.
---
org-contrib/babel/languages/ob-doc-julia.org | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/org-contrib/babel/languages/ob-doc-julia.org b/org-contrib/babel/languages/ob-doc-julia.org
index 970f9232..65ba49b0 100644
--- a/org-contrib/babel/languages/ob-doc-julia.org
+++ b/org-contrib/babel/languages/ob-doc-julia.org
@@ -47,7 +47,7 @@ The documentation for Julia describes it as "a flexible dynamic language, approp
Julia code blocks can be used in Org to define functions, filter and analyze data, create graphics and figures, and produce reproducible research papers.
* Requirements and Setup
-Julia code blocks in Org require a working Julia installation. Julia is [[https://julialang.org/downloads/][available]] for FreeBSD on ARM, Linux on ARM or x86, macOS on ARM or x86, and Windows.
+Julia code blocks in Org require a working Julia installation. Julia is [[https://julialang.org/downloads/][available]] for FreeBSD on ARM, Linux on ARM or x86, macOS on ARM or x86, and Windows. See [[sessions][below]] for further requirements for sessions with Julia.
There is [[https://github.com/JuliaEditorSupport/julia-emacs][julia-mode]] in Melpa for Emacs. It requires [[https://ess.r-project.org/][Emacs Speaks Statistics]] (ESS).
@@ -67,8 +67,8 @@ Org mode can be configured to use Julia by creating an entry for it in =org-babe
Babel support for Julia defines two Julia-specific header arguments, =:width= and =:horizontal=.
-** Sessions
-Sessions are fully supported through ESS.
+** Sessions <<sessions>>
+Sessions are fully supported through ESS. Two Julia packages must be added to the Julia configuration to enable sessions to work: [[https://github.com/JuliaData/DataFrames.jl][DataFrames]] and [[https://github.com/JuliaData/CSV.jl][CSV]].
Sessions can be used to define functions, set up variables, and share code between source blocks.
* Examples of Use
--
2.30.2
^ permalink raw reply related [flat|nested] 24+ messages in thread
* Re: :session for Julia in org babel?
2022-08-22 9:30 ` Fraga, Eric
@ 2022-08-22 12:12 ` Ihor Radchenko
0 siblings, 0 replies; 24+ messages in thread
From: Ihor Radchenko @ 2022-08-22 12:12 UTC (permalink / raw)
To: Fraga, Eric; +Cc: Bill Burdick, Org Mode List
"Fraga, Eric" <e.fraga@ucl.ac.uk> writes:
> On Saturday, 20 Aug 2022 at 13:56, Ihor Radchenko wrote:
>> Sure. You can submit the patch here, and I will apply it.
>
> Here it is. Thank you.
Thanks!
Applied onto master via 56fd0591.
https://git.sr.ht/~bzg/worg/commit/56fd0591eed333771ddf7ab522bf8da2c2b4bd7b
--
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92
^ permalink raw reply [flat|nested] 24+ messages in thread
end of thread, other threads:[~2022-08-22 12:13 UTC | newest]
Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-08 15:19 :session for Julia in org babel? Fraga, Eric
2022-08-08 15:49 ` Bill Burdick
2022-08-08 16:28 ` Fraga, Eric
2022-08-08 16:51 ` Bill Burdick
2022-08-08 17:36 ` Fraga, Eric
2022-08-09 12:39 ` Ihor Radchenko
2022-08-09 12:53 ` Fraga, Eric
2022-08-09 12:54 ` Bill Burdick
2022-08-10 7:10 ` Ihor Radchenko
2022-08-10 7:56 ` Fraga, Eric
2022-08-16 12:52 ` Fraga, Eric
2022-08-16 13:21 ` Ihor Radchenko
2022-08-16 16:06 ` Fraga, Eric
2022-08-16 21:16 ` Christopher M. Miles
[not found] ` <62fc0be2.050a0220.306c1.e3baSMTPIN_ADDED_BROKEN@mx.google.com>
2022-08-17 9:51 ` Show a warning/message when loading Org modules requiring external packages (was: :session for Julia in org babel?) Ihor Radchenko
2022-08-17 11:45 ` Show a warning/message when loading Org modules requiring external packages Fraga, Eric
2022-08-17 21:25 ` Show a warning/message when loading Org modules requiring external packages (was: :session for Julia in org babel?) Christopher M. Miles
[not found] ` <62fd5dc7.050a0220.96139.b7e7SMTPIN_ADDED_BROKEN@mx.google.com>
2022-08-19 6:02 ` Ihor Radchenko
2022-08-19 12:58 ` Christopher M. Miles
2022-08-20 5:56 ` :session for Julia in org babel? Ihor Radchenko
2022-08-22 9:30 ` Fraga, Eric
2022-08-22 12:12 ` Ihor Radchenko
2022-08-17 10:16 ` Timothy
2022-08-17 11:50 ` Fraga, Eric
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.