emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [SUGGESTION] separate ob-clojure.el into Clojure part ob-clojure.el


From: Christopher M. Miles
Subject: Re: [SUGGESTION] separate ob-clojure.el into Clojure part ob-clojure.el and ClojureScript part ob-clojurescript.el
Date: Mon, 20 Mar 2023 19:36:35 +0800
User-agent: mu4e 1.8.14; emacs 30.0.50

Ihor Radchenko <yantar92@posteo.net> writes:

> stardiviner <numbchild@gmail.com> writes:
>
>> For now, ob-clojure.el contains lot of code for ClojureScript. Only some
>> code has same functionality. Like CIDER backend. In the future,
>> ClojureScript part code will increase and different. So I suggest
>> separate them into two source code files.
>>
>> WDYT?
>
> The only downside is that people might need to
> (require 'ob-clojurescript)
> I am thinking if ob-core.el should try to automatically guess the
> correct library to be loaded.

I think this is an good idea. It let user don't need to load
ob-<lang>.el before user really need it. The ob-core.el will
automatically load <lang> related libraries. For now I have to configure
ob-<lang>.el like bellowing to defer loading:

#+begin_src emacs-lisp
(use-package ob-clojure
  :custom (org-babel-clojurescript-backend 'cider)
  :commands (org-babel-execute:clojurescript)
  :config
  (add-to-list 'org-babel-load-languages '(clojurescript . t))
  (org-babel-do-load-languages 'org-babel-load-languages 
org-babel-load-languages)
  ;; let `ob-clojurescript' babel source blocks allow evaluation.
  (add-to-list 'org-babel-default-header-args:clojurescript '(:eval . "yes"))
  (add-to-list 'org-babel-default-header-args:clojurescript '(:noweb . "yes")))
#+end_src

The duplicated part code bellowing is repeated for every <lang>:

#+begin_src emacs-lisp
(add-to-list 'org-babel-load-languages '(clojurescript . t))
(org-babel-do-load-languages 'org-babel-load-languages org-babel-load-languages)
#+end_src

>
> Otherwise, I am neutral towards this split.
>
> Up to Daniel.


-- 

[ 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: signature.asc
Description: PGP signature


reply via email to

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