• This repository has been archived on 14/Mar/2023
  • Stars
    star
    241
  • Rank 162,492 (Top 4 %)
  • Language
    Emacs Lisp
  • License
    GNU General Publi...
  • Created almost 7 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Matrix client for Emacs! (deprecated in favor of Ement.el)

images/logo64.png matrix-client.el

https://img.shields.io/matrix/matrix-client.el:matrix.org.svg?label=%23matrix-client.el:matrix.org

This is a fork of the original matrix.el client with the intent of maintaining it further, fixing bugs, and providing long-term goals for the project.

Deprecation

This client is deprecated in favor of Ement.el, a newer Matrix client for Emacs. This client will probably receive no further updates.

Contents

Screenshots

images/notifications-buffer-and-room-list_spacemacs-dark.png

Of course, since it’s Emacs, you can use any Emacs theme you like. Here’s django without scroll bars or fringes. Note the syntax highlighting in the pasted code, which respects the HTML sent by the client, rather than overriding it like Riot–for better or worse, you decide. ;)

images/django.png

And here’s the default Emacs theme:

images/frame-purpose-example.png

Installation

There are two ways to use the client:

  1. In a separate Emacs instance as a “standalone client.” This provides easy access to the dedicated-frame and other UI features, and it isolates the client from your main Emacs process (the main benefit of which is to avoid delays while processing large initial sync responses, which can take a little time, depending on how many rooms you’re in and how large they are).
  2. In an existing Emacs process and configuration, like any other Emacs package.

Notes:

  • This client is not available on MELPA. See this discussion for more information.
  • Emacs 26 or later is required.

Standalone client

The standalone client is launched with the script matrix-client-standalone.el.sh (GitHub link). To use, download the script, make it executable, and run it separately–not from within Emacs. If any packages are missing, it uses Emacs’s built-in package.el to install quelpa from MELPA, and quelpa then installs this client package and its dependencies. Then it runs the “standalone client” as a separate Emacs process.

The script accepts these options (use --help for full list):

  • --debug: Enable debug-on-error in the Emacs session.
  • --upgrade: Upgrade the client to the latest version before connecting. (This also upgrades the script in the package directory, but any changes to it won’t take effect until the next time it’s run.)

The script doesn’t load any standard Emacs user configuration files, so it’s almost like a clean Emacs config. However, it uses the default Emacs packages directory (e.g. ~/.emacs.d/elpa): all packages will be installed and read from there, which means that you can load any packages that you already have installed in Emacs, including themes (and after installation you can load the client in your main Emacs config, as well). It also loads and saves its own user-init-file at ~/.config/matrix-client-standalone.el, which preserves customized variables and faces; you can add your own code to it, just as you would to your regular Emacs .emacs or init.el file, which gives you a config mostly independent from your main Emacs config.

To make switching room buffers easy, the default completion settings are improved, and these key bindings are in effect by default:

  • C-<tab>: Switch room buffer.
  • F1: Show only Notifications buffer.
  • M-/: Expand text before point with hippie-expand. Helpful for the /upload command as it dynamically expands filename paths.

There’s also a context menu available in the sidebar by right-clicking rooms.

Of course, all this is an unorthodox way of installing and using an Emacs package, so if you are uncomfortable with this method, please do inspect the code yourself, or use another installation method.

Existing Emacs configuration

matrix-client is not available on MELPA, so it’s recommended to install it with with Quelpa.

  1. Install Quelpa and quelpa-use-package (which can be installed directly from MELPA).
  2. Add this form to your init file:
(use-package matrix-client
  :quelpa (matrix-client :fetcher github :repo "alphapapa/matrix-client.el"
                         :files (:defaults "logo.png" "matrix-client-standalone.el.sh")))

After installation, upgrading can be done through quelpa, e.g. with this command.

Manual installation

  1. Install all dependency packages, which are listed in the Package-Requires header in matrix-client.el.
  2. Put this repo’s directory onto your load-path, and veal (require 'matrix-client).

Usage

If you don’t already have a Matrix account, you can register on a public homeserver such as matrix.org. matrix-client.el doesn’t currently support registration, but you can use another client like Riot to register an account.

Then run the command matrix-client-connect or matrix-client-frame to connect. Customization options are available in the matrix-client group.

Commands

  • List room commands: /help
  • Membership
    • Join a room: /join #room:server
    • Leave the current room: /leave
    • List room users: /who
  • Room settings
    • Set room priority: /priority
    • List or set user-tags: /tags
    • Add user-tags: /tag
    • Delete user-tags: /untag
    • Set notification settings: /notify
      • Note: Notification settings are local to Emacs and do not integrate with the API spec.
  • Sending messages:
    • Send Org-formatted messages: /org
      • Note: Sending Org-formatted messages is the default. You can disable it by changing the option matrix-client-send-as-org-by-default, after which Org messages can be sent with the /org command.
      • You can send almost any Org syntax, including simple emphasis like bold and italic, one-line code blocks with : at the beginning of a line, code emphasis with ~, even Org tables and complete #+BEGIN_SRC lang ... #+END_SRC blocks! Emacs will even send the code blocks colorized according to your theme, and other matrix-client.el users will see the colors!
      • Press C-c ' (or whatever you may have bound org-edit-special to) to edit the current message in a dedicated Org buffer, then save it back to the room input line with C-x C-s (or whatever you may have bound save-buffer to).
    • Send unformatted messages: /raw
      • When matrix-client-send-as-org-by-default is enabled, this sends messages without Org formatting.
    • Send HTML messages: /html
  • Upload a file: /upload PATH-OR-URL, or drag-and-drop files or URLs onto the room buffer
  • Enable pretty colors: /rainbow
  • Other:
    • Reply to messages: With point on a message, r, or R to reply with quote.
    • Complete usernames and IDs: TAB (with point at prompt)
    • Move point between messages: TAB/S-TAB
    • Return point to input prompt: RET (with point before prompt)
    • Open room in a new frame: Middle-click or press <C-return> in the room list.
    • Switch to the notifications buffer: C-c C-n
    • Show room list: /rooms

Notifications buffer

The *Matrix Notifications* buffer displays notifications from all rooms, acting as a sort of meta-buffer. By setting a room’s notifications to always, silent, or silent-unless-mention, you can monitor all messages from that room in the notifications buffer. Press C-c C-n from a room buffer to show the notifications buffer.

You can also reply to messages directly from the notifications buffer. Just as in a room’s buffer, press TAB/S-TAB to navigate between messages, then press r on a message, type your reply, and send by pressing RET. Note that this only allows replies to messages; to send a non-reply message, do so from the room’s buffer.

To jump to a message in the room’s buffer, press RET with point on the message.

Here’s an example of following multiple, related conversations across multiple rooms in the notifications buffer:

images/notifications-buffer.png

Room list

Open the room list by pressing C-c C-r or calling command matrix-client-room-list. Just like in the dedicated frame’s room-list sidebar, you can click rooms to show their buffers, right-click rooms to change their settings, and middle-click rooms to open them in a new frame.

Missing features

matrix-client is very usable, but it does not implement all Matrix features, so it may be necessary to perform some actions from Riot or another client.

Invitations
Room invitations are not currently supported, so they must be sent and accepted elsewhere (this could be fixed with a little work).
Room encryption (E2EE)
Room encryption is not supported, and it probably will not be supported natively, because libolm is not usable from Emacs. However, the Pantalaimon E2EE proxy may be a good solution, and perhaps some integration for it could be added.

Contributing

Contributions are welcome! Please feel free to submit an issue or pull request.

For discussion, feel free to join us in #matrix-client.el:matrix.org.

Authors

  • Ryan Rix: The original author of matrix-client.
  • Adam Porter: Rewrote most of the client and added new features.
  • Jay Kamat: Contributes maintenance and reviews.

License

GPLv3.

More Repositories

1

org-super-agenda

Supercharge your Org daily/weekly agenda by grouping items
Emacs Lisp
1,182
star
2

org-ql

An Org-mode query language, including search commands and saved views
Emacs Lisp
1,159
star
3

emacs-package-dev-handbook

An Emacs package development handbook. Built with Emacs, by Emacs package developers, for Emacs package developers.
JavaScript
987
star
4

magit-todos

Show source files' TODOs (and FIXMEs, etc) in Magit status buffer
Emacs Lisp
601
star
5

org-web-tools

View, capture, and archive Web pages in Org-mode
Emacs Lisp
519
star
6

org-sidebar

A helpful sidebar for Org mode
Shell
492
star
7

org-rifle

Rifle through your Org-mode buffers and acquire your target
Emacs Lisp
488
star
8

org-protocol-capture-html

Capture HTML from the browser selection into Emacs as org-mode content
Emacs Lisp
442
star
9

bufler.el

A butler for your buffers. Group buffers into workspaces with programmable rules, and easily switch to and manipulate them.
Emacs Lisp
378
star
10

ement.el

Matrix client for Emacs
Emacs Lisp
354
star
11

unpackaged.el

A collection of useful Emacs Lisp code that isn't substantial enough to be packaged
Emacs Lisp
345
star
12

solarized-everything-css

A collection of Solarized user-stylesheets for...everything?
CSS
277
star
13

burly.el

Save and restore frames and windows with their buffers in Emacs
Emacs Lisp
252
star
14

prism.el

Disperse Lisp forms (and other languages) into a spectrum of colors by depth
Emacs Lisp
228
star
15

org-graph-view

View Org buffers as a clickable, graphical mind-map
Emacs Lisp
190
star
16

pocket-reader.el

Emacs client for Pocket reading list (getpocket.com)
Emacs Lisp
188
star
17

yequake

Drop-down Emacs frames, like Yakuake
Emacs Lisp
175
star
18

ts.el

Emacs timestamp and date-time library
Emacs Lisp
159
star
19

dogears.el

Never lose your place in Emacs again
Emacs Lisp
154
star
20

with-emacs.sh

Script to easily run Emacs with specified configurations
Shell
142
star
21

makem.sh

Makefile-like script for building and testing Emacs Lisp packages
Shell
128
star
22

plz.el

An HTTP library for Emacs
Emacs Lisp
126
star
23

bucket

A bucket for your shell (like a set of registers, or a clipboard manager)
Shell
118
star
24

restic-runner

Configure and run Restic more easily
Shell
108
star
25

hammy.el

Programmable, interactive interval timers (e.g. for working/resting)
Emacs Lisp
103
star
26

org-sticky-header

Show off-screen Org heading at top of window
Emacs Lisp
103
star
27

alpha-org

A powerful Org configuration
Emacs Lisp
100
star
28

org-make-toc

Automatic tables of contents for Org files
Shell
83
star
29

taxy.el

Programmable taxonomical hierarchies for arbitrary objects
Emacs Lisp
82
star
30

transclusion-in-emacs

Resources about implementing transclusion in Emacs
79
star
31

topsy.el

Simple sticky header showing definition beyond top of window
Emacs Lisp
77
star
32

org-bookmark-heading

Emacs bookmark support for Org-mode
Emacs Lisp
75
star
33

snow.el

Let it snow in Emacs!
Emacs Lisp
72
star
34

org-now

Conveniently show current Org tasks in a sidebar window
Emacs Lisp
50
star
35

bashcaster

An actually simple screen recorder for Linux
Shell
48
star
36

org-recent-headings

Go to recently used Org headings
Shell
47
star
37

obvious.el

Who needs comments when the code is so obvious
Emacs Lisp
46
star
38

frame-purpose.el

Purpose-specific frames for Emacs
Emacs Lisp
46
star
39

org-almanac

Almanac for Org mode
43
star
40

mosey.el

Mosey around inside your Emacs buffer
Emacs Lisp
37
star
41

org-html-theme-darksun

A Solarized Dark version of the Bigblow Org HTML export theme
JavaScript
36
star
42

salv.el

Local minor mode to save a buffer when Emacs is idle
Emacs Lisp
33
star
43

sword-to-org

Convert Sword modules to Org-mode outlines
Emacs Lisp
33
star
44

org-auto-expand

Automatically expand certain Org headings
Shell
28
star
45

mangle

Mangle man pages to show just the parts you need (suitable for aliasing to "man")
Shell
26
star
46

magit.sh

Run Magit in a separate Emacs instance
Shell
26
star
47

org-notely

Pop to new Org headings for quick notetaking
Shell
26
star
48

scrollkeeper.el

Configurable scrolling commands with visual guidelines, for Emacs
Emacs Lisp
22
star
49

ap.el

A simple, Emacs Lisp-focused Emacs config
Emacs Lisp
21
star
50

highlight-function-calls

Highlight function/macro calls in Emacs
Emacs Lisp
21
star
51

org-quick-peek

Quick inline peeks at agenda items and linked nodes in Org-mode
Emacs Lisp
21
star
52

defrepeater.el

Easily define repeatable Emacs commands
Emacs Lisp
20
star
53

pocket-lib.el

Emacs library for the getpocket.com API
Emacs Lisp
19
star
54

org-pocket

Tools to use Pocket with Org-mode
Emacs Lisp
16
star
55

elexandria

Alexandria-like library for Emacs Lisp
Emacs Lisp
13
star
56

sword-converter

Convert SWORD modules to JSON and SQLite and search the converted files
Emacs Lisp
13
star
57

frecency.el

Library to sort items by "frecency" in Emacs
Emacs Lisp
11
star
58

chromatext.el

Apply color gradients to lines of text in Emacs (possibly increasing legibility)
Emacs Lisp
9
star
59

plamix

Mix together M3U playlists, optionally with a desired duration, outputting either a list of files to STDOUT, or writing an M3U playlist to a file
Python
9
star
60

pyza

A command-line/terminal/console Songza player, using VLC or MPD to play audio
Python
8
star
61

melpa-stats

Stats tools for MELPA
Emacs Lisp
6
star
62

org-books

Tools for books in Org-mode
Emacs Lisp
5
star
63

rubbish.py

WIP: A CLI to the XDG trash bin in Python
Python
5
star
64

tp.el

Emacs text-property convenience library
Emacs Lisp
5
star
65

org-search-goto

org-search-goto
Emacs Lisp
5
star
66

buffer-groups.el

A lightweight, automatic grouping rule-based buffer grouper and switcher
Emacs Lisp
5
star
67

ibuffer-auto-groups

Automatically make groups for ibuffer
Emacs Lisp
5
star
68

ampd-tools

A small collection of MPD-related tools
Python
4
star
69

reddit-emacs-css

CSS for /r/emacs
CSS
4
star
70

ox-elisp

Export Org buffers to Emacs Lisp comments
Emacs Lisp
3
star
71

dbg.el

Simple debugging macros
Emacs Lisp
3
star
72

tabtint

Firefox extension which tints Firefox tabs to match color of web page
JavaScript
3
star
73

ya-solarized.el

Yet Another Solarized theme for Emacs
Emacs Lisp
2
star
74

overwatch-formula76

A racing custom game type for Overwatch
C
2
star
75

overwatch-custom-games

A collection of custom games for Overwatch
Emacs Lisp
2
star
76

listen.el

Audio/music player for Emacs
Emacs Lisp
2
star
77

unsplash.hy

Hy
1
star
78

helm-swish

Like helm-swoop, but a little bit faster
Emacs Lisp
1
star
79

greek-hebrew-emacs

How to set up Emacs to easily type Greek and Hebrew
1
star
80

source-status-linker

Turns output of Source engine's status command into links to Steam user profiles
Python
1
star
81

github-solarized

A Solarized user stylesheet for GitHub made with Stylus
CSS
1
star
82

pentadactyl-tabmattach

JavaScript
1
star