emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ag Ibragimov <agzam.ibragimov@gmail.com>
To: Kyle Meyer <kyle@kyleam.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Question on contributing to Org-mode
Date: Wed, 17 Jun 2020 18:32:01 -0700	[thread overview]
Message-ID: <m2v9jp40ry.fsf@gmail.com> (raw)
In-Reply-To: <871rmimrcj.fsf@kyleam.com>

[-- Attachment #1: Type: text/plain, Size: 666 bytes --]

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?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: ob-clojure-improvements-draft.patch --]
[-- Type: text/x-patch, Size: 1460 bytes --]

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)

[-- Attachment #3: Type: text/plain, Size: 1014 bytes --]


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	other threads:[~2020-06-18  1:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-13 21:58 Ag Ibragimov
2020-06-14  0:19 ` Kyle Meyer
2020-06-18  1:32   ` Ag Ibragimov [this message]
2020-06-18  6:50     ` stardiviner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2v9jp40ry.fsf@gmail.com \
    --to=agzam.ibragimov@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=kyle@kyleam.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).