emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: stardiviner <numbchild@gmail.com>
To: Ag Ibragimov <agzam.ibragimov@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Question on contributing to Org-mode
Date: Thu, 18 Jun 2020 14:50:55 +0800	[thread overview]
Message-ID: <87k104zx2o.fsf@gmail.com> (raw)
In-Reply-To: <m2v9jp40ry.fsf@gmail.com>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256


Ag Ibragimov <agzam.ibragimov@gmail.com> writes:

> 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

I like this idea, currently ob-clojure has many different backends support now,
Use a header argument will be helpful for situations like use different backends
in one org file and other cases.

> 2) Header argument for additional parameters so you could do things like this:

I would like propose header argument name ":backend" or ":clojure". ob-scheme.el
has similar header argument named ":scheme". But I prefer ":backend", because
it's more general.

>
> #+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.


- -- 
[ stardiviner ]
       I try to make every word tell the meaning that I want to express.

       Blog: https://stardiviner.github.io/
       IRC(freenode): stardiviner, Matrix: stardiviner
       GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
-----BEGIN PGP SIGNATURE-----

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7rDs8UHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsMWVQf/YlHZw3Yga3dTlLPU0Xg0f+tJ0JJR
oigjt4oOBsaMGshHny+4QBnO/QJTVWpYEm6j2oFp0Cb1CUn5TiTRDDyRVcX+I15u
W4T+UqsamKQQoRoJccPN3apraQlwiYbwLzN5Qy0hefOkj+E285PNf4Uq1VMwy9sL
n2zqY+cm+lrhv3wG08xXxWckg+Jx76s1M6j9QQH7nGNovYSl3YzpjtOPc2VE2ayv
8FQQX6PSH4gEW7ItyfYd18vYtIn65Zkum+L80d8+HtDVPkw0yDIq6uIkUbR5jCCY
tdbUsl6EeZlb9CkjY9WtOsIGe2FzIHjjhFSYvamgarqs5GGd+GazSPUVKQ==
=4JBP
-----END PGP SIGNATURE-----


      reply	other threads:[~2020-06-18  6:51 UTC|newest]

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

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=87k104zx2o.fsf@gmail.com \
    --to=numbchild@gmail.com \
    --cc=agzam.ibragimov@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).