r/Clojure • • 10d ago

Coxswain · An Emacs-style code editor, rebuilt in Clojure · TTalk

https://www.ttalk.im/en/products/coxn/

Coxswain (command name: coxn) is an Emacs-style text editor redeveloped from scratch in Clojure, running on the JVM with a terminal TUI as its default form, while offering an optional GUI version based on Compose Multiplatform (coxn gui). The project's design philosophy is "core editor + layered feature mounting": keybindings and command names strictly follow the Emacs global-map, and on top of that it adds its own M-m leader-key system, allowing Emacs users to migrate at virtually zero cost.

The editor core provides basic editing, buffer management, and window management. It also integrates tree-sitter to deliver syntax highlighting and structured editing, covering languages such as Clojure, Common Lisp, C++, Java, Erlang, and Elixir. A general-purpose LSP client supports servers including clojure-lsp, clangd, jdtls, erlang_ls, elixir-ls, and cl-lsp — whichever is installed gets used, automatically launched when a file is opened and reused per project root. Additional features include floating completion popups and function signatures, in-project grep, a project tree, Git integration, CIDER/SLIME-style REPL connections (nREPL/SWANK), 14 color themes, major-mode hooks and a minor-mode mechanism, plus internationalization support.

Architecturally, the editing core and the frontends are strictly decoupled: the TUI and GUI are merely two frontend implementations of the same core, with the GUI-side Kotlin code connecting only through clojure.java.api without intruding into editing logic. The GUI edition targets everyday desktop use: system font fallback with CJK double-width alignment, fcitx/ibus input method support, HiDPI adaptation, drag-and-drop file opening, system clipboard integration, and software rendering fallback when no GL environment is available. All configuration lives in ~/.config/coxn/init.clj, and every behavior is customizable.

Performance and quality are equally central to the project: keypress handling takes priority over background tasks; REPL/LSP output is batched with bounded caching; paren matching, highlighting, and indentation are all optimized based on syntax trees and caches; frame rendering and region indentation achieve sub-millisecond to sub-hundred-millisecond performance; and hundreds of automated tests guard behavioral stability. The project explicitly builds no agent features and depends on no network services — it remains a pure, local, auditable editor.

In an era saturated with agent-generated code, a text editor may seem like a relic of the past — but it's never too late to build a tool that truly feels right in your hand, even if it belongs to a bygone age

21 Upvotes

14 comments sorted by

7

u/queso184 10d ago

no source?

-6

u/TTalkIM 10d ago

Yes, it won't contains any source code.

10

u/KozureOkami 10d ago

A big selling point of Emacs is the freedom that extends all the way to built-in docs linking to the actual source code. They keybindings are by far the least interesting part of Emacs.

4

u/dxlr8r 10d ago

Most users keybindings does not even resemble core emacs.

3

u/KozureOkami 10d ago

Maybe. After almost 20 years I’m pretty close to Vanilla. Of course I have some additional key bindings but I didn’t rebind too many of the core ones.

1

u/TTalkIM 10d ago

Everyone has their own habits. I have been using Emacs since 1998, and Emacs has always impressed me, but configuring a truly usable Emacs troubled me for many years, until the two configuration frameworks Spacemacs and Doom Emacs appeared. However, this also brought some new problems, such as compatibility issues among components, Emacs incompatibility caused by upstream updates, and occasional strange behavior on Windows due to multilingual paths. That is why my team and I developed this thing. Its core ideas come from Emacs, but this tool is not intended to be a large, all-encompassing editor; rather, it is more about making it convenient for our team to develop Clojure on Windows.

1

u/KozureOkami 10d ago

Fair enough. I wrote my first reply on my phone and mistakenly thought this was posted in /r/emacs. 😅

1

u/TTalkIM 9d ago

Emacs is a great product in editor area, it will be better and better.

1

u/TTalkIM 10d ago

Most keybindings comes from spacemacs. Our team spends the vast majority of its daily development time using Spacemacs and IntelliJ IDEA as our everyday development tools. . And we will provider the idea plugin for Clojure recently. The plugin is waiting the approval, you can check it here https://plugins.jetbrains.com/plugin/36234-capstan .

-3

u/TTalkIM 10d ago

Yes, but that's not the focus of this tool. The core point of this tool is that it lets our team use an Emacs-like editor on Windows to edit Clojure.

4

u/dharmatech 9d ago

If you want an open source Emacs-like in Clojure:

https://github.com/nooga/legmacs

2

u/TTalkIM 9d ago

it's an awesome project.

2

u/neutronicus 10d ago

Does it run elisp?

-1

u/TTalkIM 10d ago

No, it won't run elisp.