🏠 Go home.

Mclient.el --- A Matrix.org frontend for Emacs

Published on

Update: This software is unmaintained. Sorry :(

Today I tagged version 0.1.0 of mclient, a Matrix.org client for Emacs and I opened a pull request to have it added to MELPA. I've been incredibly interested in Matrix as an RPC layer for my projects; a decentralized event stream that can be used for text Chat, signaling for WebRTC VoIP calls, and as a data layer for various projects surrounding my Core Computing Environment and Body Computing System. I've written a few toys with it, including a system to control my living room lights over Matrix, but this is a full blown API library and chat client written in pure Emacs Lisp using the wonderful Request.el library.


Figure 1: Matrix HQ's main chat room in Emacs

It comes in two parts matrix.el which is the actual API implementation, and mclient.el which provides matrix-client, an interactive function to launch an interactive chat.

The API library allows me to build, for example, an Org-mode "personal assistant" bot that can use prompt-based capture templates to interact with a remote Emacs instance from my Android.

The chat client is, well, a full chat client. It's really rough right now, and it's completely homebrew, but it works and is full of 🙏 Emoji 🙏, so make sure you have Symbola installed and configured to be used 😄. It doesn't support registration (yet!), so if you don't have a Matrix.org account head over to the Matrix site and get set up with an account or deploy your own homeserver by deploying Synapse.

The Matrix spec itself is a dream to work with, frankly, given how young it is. At its core is an HTTP polling Event Stream protocol which you can just request to and wait for a chunk of events to show up. Those events are individually quite rich with metadata, so the core of mclient itself is essentially a router to a set of event handlers, each of which is able to work with a given Matrix event type. The upshot of this is that the chat porcelain could be genericized enough to act as a chat client for anything that works similar to a comint stream, and as such could be used to build a UI on top of telegram-cli, for example.

Like I said at the top of this post, mclient will be available in MELPA soon, but if you can't wait, clone matrix.el.git and add the directory to your load-path.

Oh, and lastly, I am @rrix:whatthefuck.computer on Matrix. If you end up trying out mclient and experience any issues, come find me in #ft_kickass:whatthefuck.computer!

Respond to this note:

Ryan Rix is a privacy rights advocate and net-art wannabe. Reach them on the Fediverse as @rrix@cybre.space, twitter as @rrrrrrrix, via email to ryan@whatthefuck.computer or on Facebook or on Matrix as @rrix:whatthefuck.computer.