* ob-clojure with tangling current broken
@ 2019-01-21 20:05 Frederick Giasson
2019-01-22 7:52 ` stardiviner
0 siblings, 1 reply; 4+ messages in thread
From: Frederick Giasson @ 2019-01-21 20:05 UTC (permalink / raw)
To: Org-mode
[-- Attachment #1: Type: text/plain, Size: 987 bytes --]
Hi,
I updated org-mode to latest dev version recently and I was wondering why I
was seeing namespaces appended to each [clojure] code block I was tangling
(which generates unusable tangled Clojure source files)
It turns out that the culprit is the following line:
https://code.orgmode.org/bzg/org-mode/src/master/lisp/ob-clojure.el#L108
I am wondering why is there such code injection in
"org-babel-expand-body:clojure". It looks like to be related to the Clojure
code block execution, but it also appears to be called from the tangling
function. Clearly those two different use cases needs to be properly
handled at the level of "ob-clojure.el"
I didn't follow all the changes to the "ob-clojure" mode in the last year
or so, so please pardon my ignorance if the module is taking a different
direction than I am used to. Is there a rational behind this behaviour or
is there a new feature that I am not aware of which properly handle those
two use cases?
Thanks,
Take care,
Fred
[-- Attachment #2: Type: text/html, Size: 1389 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: ob-clojure with tangling current broken
2019-01-21 20:05 ob-clojure with tangling current broken Frederick Giasson
@ 2019-01-22 7:52 ` stardiviner
2019-01-22 13:01 ` Frederick Giasson
0 siblings, 1 reply; 4+ messages in thread
From: stardiviner @ 2019-01-22 7:52 UTC (permalink / raw)
To: emacs-orgmode
Frederick Giasson <fred@curbside.com> writes:
> Hi,
>
> I updated org-mode to latest dev version recently and I was wondering why I was
> seeing namespaces appended to each [clojure] code block I was tangling (which
> generates unusable tangled Clojure source files)
That's why I added a patch recently. Now Nicolas already applied my
patch. You should already seen it now.
>
> It turns out that the culprit is the following line:
> https://code.orgmode.org/bzg/org-mode/src/master/lisp/ob-clojure.el#L108
>
> I am wondering why is there such code injection in
> "org-babel-expand-body:clojure". It looks like to be related to the Clojure code
> block execution, but it also appears to be called from the tangling function.
> Clearly those two different use cases needs to be properly handled at the level
> of "ob-clojure.el"
>
Expanding clojure code is necessary to tangling, because when user have
noweb reference etc in source block, expanding here is necessary.
> I didn't follow all the changes to the "ob-clojure" mode in the last year or so,
> so please pardon my ignorance if the module is taking a different direction than
> I am used to. Is there a rational behind this behaviour or is there a new feature
> that I am not aware of which properly handle those two use cases?
>
Which part you don't understand, I might can answer your question,
because I did most of those changes in last year.
> Thanks,
>
> Take care,
>
> Fred
--
[ stardiviner ]
I try to make every word tell the meaning what I want to express.
Blog: https://stardiviner.github.io/
IRC(freenode): stardiviner, Matrix: stardiviner
GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: ob-clojure with tangling current broken
2019-01-22 7:52 ` stardiviner
@ 2019-01-22 13:01 ` Frederick Giasson
2019-01-23 6:38 ` stardiviner
0 siblings, 1 reply; 4+ messages in thread
From: Frederick Giasson @ 2019-01-22 13:01 UTC (permalink / raw)
To: numbchild; +Cc: Org-mode
[-- Attachment #1: Type: text/plain, Size: 1867 bytes --]
Hi,
That's why I added a patch recently. Now Nicolas already applied my
> patch. You should already seen it now.
>
Yeah I just received that email right after I sent mine. Didn't know it was
in the pipeline, I just re-subscribed to the mailing list.
> >
> > It turns out that the culprit is the following line:
> > https://code.orgmode.org/bzg/org-mode/src/master/lisp/ob-clojure.el#L108
> >
> > I am wondering why is there such code injection in
> > "org-babel-expand-body:clojure". It looks like to be related to the
> Clojure code
> > block execution, but it also appears to be called from the tangling
> function.
> > Clearly those two different use cases needs to be properly handled at
> the level
> > of "ob-clojure.el"
> >
>
> Expanding clojure code is necessary to tangling, because when user have
> noweb reference etc in source block, expanding here is necessary.
>
Yes, that is right. What I was referring to I guess is to handle that case
(tangling vs. code block execution within Emacs), which is what this patch
is about, thanks!
>
> > I didn't follow all the changes to the "ob-clojure" mode in the last
> year or so,
> > so please pardon my ignorance if the module is taking a different
> direction than
> > I am used to. Is there a rational behind this behaviour or is there a
> new feature
> > that I am not aware of which properly handle those two use cases?
> >
>
> Which part you don't understand, I might can answer your question,
> because I did most of those changes in last year.
>
The only thing I meant here is that the last time I looked into this code,
it was quite different, you guys appears to have worked a lot on it.
Another thing I discovered is the =ob-clojure-literate=, but even after
reading its [sparse] doc and its code, I am not sure what it concretely
adds to =ob-clojure=
Thanks for this work!
Take care,
Fred
[-- Attachment #2: Type: text/html, Size: 2863 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: ob-clojure with tangling current broken
2019-01-22 13:01 ` Frederick Giasson
@ 2019-01-23 6:38 ` stardiviner
0 siblings, 0 replies; 4+ messages in thread
From: stardiviner @ 2019-01-23 6:38 UTC (permalink / raw)
To: Frederick Giasson; +Cc: Org-mode
Frederick Giasson <fred@curbside.com> writes:
> Hi,
>
> That's why I added a patch recently. Now Nicolas already applied my
> patch. You should already seen it now.
>
> Yeah I just received that email right after I sent mine. Didn't know it was in the pipeline, I just re-subscribed to the mailing list.
>
> >
> > It turns out that the culprit is the following line:
> > https://code.orgmode.org/bzg/org-mode/src/master/lisp/ob-clojure.el#L108
> >
> > I am wondering why is there such code injection in
> > "org-babel-expand-body:clojure". It looks like to be related to the Clojure code
> > block execution, but it also appears to be called from the tangling function.
> > Clearly those two different use cases needs to be properly handled at the level
> > of "ob-clojure.el"
> >
>
> Expanding clojure code is necessary to tangling, because when user have
> noweb reference etc in source block, expanding here is necessary.
>
> Yes, that is right. What I was referring to I guess is to handle that case (tangling vs. code block execution within Emacs), which is what this patch is about,
> thanks!
>
>
> > I didn't follow all the changes to the "ob-clojure" mode in the last year or so,
> > so please pardon my ignorance if the module is taking a different direction than
> > I am used to. Is there a rational behind this behaviour or is there a new feature
> > that I am not aware of which properly handle those two use cases?
> >
>
> Which part you don't understand, I might can answer your question,
> because I did most of those changes in last year.
>
> The only thing I meant here is that the last time I looked into this code, it was quite different, you guys appears to have worked a lot on it.
>
> Another thing I discovered is the =ob-clojure-literate=, but even after reading its [sparse] doc and its code, I am not sure what it concretely adds to =ob-clojure=
>
> Thanks for this work!
Well, about this, you can read related things, here is the original
repo: https://github.com/stardiviner/ob-clojure-literate. In the README,
I describe my motivation.
Before CIDER added "sesman" session manager, CIDER was not able to
manage sessions easily. But ob-clojure need a session. So I created it,
then I added some thing that I need for Clojure literate programming in
Org Mode.
About this extra library, here is what I think, keep it for a while,
until no one or very rare use it, I will remove it from Org Mode
contrib. Until now, no one except you asked me about what it is.
BTW, I migrated some features into core/ob-clojure.el already, like
session initialization. Specify session.
Here is the list I collate right now.
- [X] auto start REPL if necessary
- [X] It's taken by CIDER sesman [Commit 2c5df17ed]
- [X] use default session
- [X] It's taken by CIDER sesman, now can easily switch session.
- [ ] specify session in header argument :session, Org Babel has =[C-c C-v C-j]=
by default.
- [ ] provide interactive completion candidates of CIDER REPL connections
- [X] initiate session =[C-c C-v z]= [Commit 4456dc880]
- [X] CIDER use sesman to manage REPL session now.
- [ ] support ob-core.el switch to corresponding session REPL buffer =[C-c C-v z]=
- [X] dynamic clojure ns [Commit d7e12d1df]
- [X] implemented with ~:ns~ header argument [Commit d7e12d1df]
- [X] generate plot image in specific directory
- [X] pass dir as variable into Clojure code
- [X] org babel support graphics image file link as result [Commit b088389c6]
- [X] I add this header argument value in commit already. [Commit 296b0de4e]
If you want to read ob-clojure-literate.el source code, I suggest you
read one commit by one. It will be much clear. You can search my name
"stardiviner" and filter commits with "ob-clojure,ob-clojure-literate"
in log.
>
> Take care,
>
> Fred
Hope this will help you, Regards.
--
[ stardiviner ]
I try to make every word tell the meaning what I want to express.
Blog: https://stardiviner.github.io/
IRC(freenode): stardiviner, Matrix: stardiviner
GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-01-23 6:34 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-21 20:05 ob-clojure with tangling current broken Frederick Giasson
2019-01-22 7:52 ` stardiviner
2019-01-22 13:01 ` Frederick Giasson
2019-01-23 6:38 ` stardiviner
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).