skip to content

Babble, [2025-09-15 Mon 09:19], Properly installing Fennel on my Omnibook

The last time I "installed Fennel", it was just by "installing" TAB. This go around I'd like to more properly get it set up as accessible from my user's shell, so I can use it like a proper interpreter across GnoponEmacs.

So I don't forget, there's this wonderful post from Andrey Listopadov about using Fennel in Emacs. I'll be using that, the Fennel docs, and the documentation for fennel-mode to navigate through this process. My goal is to be able to use Fennel anywhere I might use another language with Org-babel, but skimming through Andrey's blog post, I suspect I can do more than that.

Following the install instructions for the Fennel script works great, so I can move on to integrating it into GnoponEmacs, starting with fennel-mode.

The following are the use-package declarations I'm starting with.

  (use-package lua-mode
  :straight t
  :mode ("\\.lua\\'" . lua-mode))

(use-package eglot
  :straight t
  :commands (eglot eglot-ensure))

(use-package fennel-mode
  :straight (:host sourcehut :repo "technomancy/fennel-mode")
  :mode ("\\.fnl\\'" . fennel-mode)
  :commands (fennel-mode fennel-repl)
  :init
  (setq inferior-lisp-program "fennel")
  (autoload 'fennel-proto-repl-minor-mode "fennel-proto-repl" nil t)
  (autoload 'antifennel-mode "antifennel" nil t)
  (with-eval-after-load 'org
    (require 'ob-fennel))
  :hook
  (fennel-mode . fennel-proto-repl-minor-mode)
  (fennel-mode . eglot-ensure)
  (lua-mode . antifennel-mode)
  :config
  (with-eval-after-load 'eglot
    (add-to-list 'eglot-server-programs
                 '(fennel-mode . ("fennel-ls")))))

Opening a new buffer in fennel-mode and running (print "test') asks me about starting up a Fennel proto-REPL, so I do, and it works fine. Lets see if it works for code blocks:

(+ 2 2)

From my end, that looks perfect, even if doesn't render right upon publishing.

Now, lets see… how things relate: does setting a variable in the fennel-mode buffer make it accessible here? Like… I don't know/understand the underlying tech stack here, but I'm curious because of MUD plans.

foo

So, no, it doesn't look like they share a REPL - that's fine and dandy, just good to know. What about within the same file?

(local bing "baff!")
bing
bing

Seems like yes.

With just that, it seems like I have access to enough of the Fennel REPL to be able to do some limited literate programming…

And this sets me up well to read through Andrey's blog post at a future point, and start considering how to do Fennel-encoding of the various entries in my research notes, as a means of moving toward a MUD engine/library.

Backlinks

Created: 2025-10-05 Sun 17:40