Emacs
Emacs

Emacs

Meet Rary

Contents
  1. What can you do with it?
  2. Try it
  3. Why “Rary”?
  4. Thanks
The Rary mark: a round piece of woven tsihyRary

Since the Emacs Carnival of August, I keep saying how great it would be to have something like Excalidraw inside Emacs.

And people are cooking interesting stuff with the canvas: excali-mode (Excalidraw inside Emacs 32), Pale and emacs-reader.

It makes me want more. I crave visual novelty in Emacs, and I said so on Reddit, in a thread about what is left of Emacs for heavy LLM users. I explained that I went down the path of building a custom control room, because I need something visual that I can grasp at a glance. And I wondered if we could just tell the agent to draw dashboards, cockpits and control rooms on the canvas.

One of the reasons I built Vakana was my need for a visual tool. And with the rapid surge of LLMs, my brain wants something other than text all day long.
I went far away from Emacs, my preferred tool, and built a custom tool that is more visual and close to my workflow (more on that in a future article).

I was planning to let things happen naturally, and to wait for someone to build a framework around the Emacs canvas first. But I couldn’t take it anymore. So I started to build something that I (and maybe others) can build different things on.

Meet Rary:

A Rary board on Emacs 32: a new node opened in its editor, a hint card and the minimapRary on Emacs 32

Rary is a node canvas for Emacs, similar to React Flow: boards of cards and edges that you move, link and zoom. The scene, the interactions and the undo are in Emacs Lisp. A Rust module draws the board, with Cairo and Pango, into the canvas image type of Emacs 32.

What can you do with it?

  • Boards: cards with Org or Markdown text, labeled edges, a minimap and undo. A board is a .rary file that diffs well.
  • Live nodes: a shell, a log file, an Org Babel result or any buffer, inside a node. Double click it to type.
  • Org note graph: M-x rary-org-graph shows your Org notes and their links.
  • Agenda kanban: M-x rary-org-agenda puts your TODOs in columns. Drag a card to change its state.
  • Your own tools: a public Lisp API. The repo has three examples: a mind map, a require graph and a flow editor.

I built Rary for the last one: a base for your own tools. A dashboard, a cockpit, a control room, whatever your brain needs to see at a glance.

Try it

You’ll have to build your own Emacs 32, but a script does it for you. You only need Rust 1.92 or later with cargo (install it with rustup). Then:

1
2
3
4
git clone https://github.com/donovan-ratefison/rary
cd rary
scripts/install.sh --deps
make showcase

On Debian 12 or Ubuntu 22.04 and later, the script builds a pinned Emacs 32 with the canvas image type into ~/.local/opt/emacs-canvas, then the Rary module. The Emacs of your system stays as it is. It takes 10 to 13 minutes on a machine with 8 cores.

make showcase plays a film of about 50 seconds: Rary draws the call graph of its own source code. Press any key to stop it and get a normal board.

Why “Rary”?

Time for another little Malagasy lesson (the last one was Alamino).

Rary means “plait”, “weave” or “lay out neatly”. It is the plaiting that is everywhere in Malagasy life: a pattern held in the fingers, built up unit by unit into a whole. For example:

  • Mandrary: the act of weaving straw.
  • Rarivato: a pavement (vato means stone).

I told the story of my grandmother’s hands moving through woven straw. That was mandrary.

A board grows the same way: a card here, a link there, another card. So the name was obvious.

Thanks

A big thanks to Daniel Mendler for the canvas patch, and to the people who brought the canvas image type into Emacs master. Without it, Rary would not exist.

A shout-out to the people cooking interesting visual stuff on the canvas: yibie with excali-mode, MonadicSheep with Pale and emacs-reader, and all the others. I read excali-mode as a reference for the canvas techniques. I used no code from it.


Rary is not perfect, but it goes in the direction I want for Emacs, the one that keeps me sane. It’s already good enough for me.

By sharing it, I hope to unlock the creativity of other people, and to see even more visual tools that work well with everything else in Emacs. Let’s build more awesome stuff.

Feel free to try it out. You can read the code, build it, fork it, and send issues or pull requests.