emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question on contributing to Org-mode


From: Ag Ibragimov
Subject: Re: Question on contributing to Org-mode
Date: Wed, 17 Jun 2020 18:32:01 -0700
User-agent: mu4e 1.4.10; emacs 28.0.50

Can someone help me please to improve ob-clojure for the next release.

I'd like to add bababashka and clojure-cmd support.

I've experimented with the code that's currently in master I so far I got to 
this.

What I would like to propose:

1) Ability to override `org-babel-clojure-backend` with a src-block header 
parameter
2) Header argument for additional parameters so you could do things like this:

#+begin_src clojure :args "-Sdeps '{:deps {inflections {:mvn/version 
"0.13.2"}}}'"
 (use 'inflections.core)
 (plural "word")
#+end_src

However, I don't know what's current convention about header parameters - 
naming, etc.
What your thoughts about all that?

diff --git a/lisp/ob-clojure.el b/lisp/ob-clojure.el
index 299a326e4..de005c32b 100644
--- a/lisp/ob-clojure.el
+++ b/lisp/ob-clojure.el
@@ -224,6 +224,14 @@ (defun ob-clojure-eval-with-slime (expanded params)
        ,(buffer-substring-no-properties (point-min) (point-max)))
      (cdr (assq :package params)))))
 
+(defun ob-clojure-eval-with-babashka (expanded params)
+  "Evaluate EXPANDED code block with PARAMS using babashka."
+  (org-babel-execute:shell (format "bb -e \"%s\"" expanded) params))
+
+(defun ob-clojure-eval-with-clj (expanded params)
+  "Evaluate EXPANDED code block with PARAMS using clojure-cli."
+  (org-babel-execute:shell (format "clj -e \"%s\"" expanded) params))
+
 (defun org-babel-execute:clojure (body params)
   "Execute a block of Clojure code with Babel."
   (unless org-babel-clojure-backend
@@ -238,7 +246,11 @@ (defun org-babel-execute:clojure (body params)
           ((eq org-babel-clojure-backend 'cider)
            (ob-clojure-eval-with-cider expanded params))
           ((eq org-babel-clojure-backend 'slime)
-           (ob-clojure-eval-with-slime expanded params))))
+           (ob-clojure-eval-with-slime expanded params))
+          ((eq org-babel-clojure-backend 'babashka)
+           (ob-clojure-eval-with-babashka expanded params))
+          ((eq org-babel-clojure-backend 'clj-cli)
+           (ob-clojure-eval-with-clj expanded params))))
     (org-babel-result-cond result-params
       result
       (condition-case nil (org-babel-script-escape result)

On Sat 13 Jun 2020 at 17:19, Kyle Meyer <kyle@kyleam.com> wrote:

Ag Ibragimov writes:

M-x emacs-version and org-version report:

GNU Emacs 28.0.50 (build 1, x86_64-apple-darwin19.5.0, NS appkit-1894.50 
Version 10.15.5 (Build 19F101)) of 2020-06-07
Org mode version 9.3.7 (9.3.7-2-g706970-elpaplus @ 
~/.emacs.d/elpa/28.0/develop/org-plus-contrib-20200608/)

Now I'm confused, what's in master of bzg/org-mode?

It contains what will be the next feature release (9.4, at the moment).

Notice that your reported version above contains a git revision: 706970.
If you look that up in the repo, you'll find that it's a few commits
back from the current tip of the maint branch.  The maint branch is the
source for the ELPA builds and is where bug fix releases are cut from.

And if someone wants to send patches, which branch it should be based
of?

Bug fixes that apply to maint should ideally be based off of maint, and
master is usually appropriate for everything else.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]