swift-emacs / swift-mode

Emacs support for Apple's Swift programming language.
GNU General Public License v3.0
363 stars 47 forks source link

No org-babel-execute for swift! in Org-mode swift code block #142

Closed kandelvijaya closed 4 years ago

kandelvijaya commented 6 years ago

Hi guys,

I use org-mode for most of my note taking and journaling. I have bunch of swift code blocks and I wanted to execute them on the org file itself via C-c C-c with point inside the swift code block.

And I see this message: no org-babel-execute function for swift!

I would love to have such feature. I am fairly new to emacs and elisp so any pointers to implement this would be great.

taku0 commented 6 years ago

I have little knowledge of org-mode or org-babel. I could not find a documentation about how to add a language. However, contrib/lisp/ob-*.el in https://code.orgmode.org/bzg/org-mode.git may help you. Grepping code also revails that org-babel-execute-src-block seeks a function named org-babel-execute:swift:

      (let* ((lang (nth 0 info))
         ...
         (cmd (intern (concat "org-babel-execute:" lang)))
         ...)
        (unless (fboundp cmd)
          (error "No org-babel-execute function for %s!" lang))
rudedogg commented 6 years ago

Not sure, but https://github.com/zweifisch/ob-swift may work