ement.el

ement.el

Emacs平台上的功能丰富Matrix客户端

Ement.el是专为GNU Emacs开发的Matrix客户端,具有简洁快速、功能丰富、稳定可靠等特点。它支持多会话连接、房间管理、消息编辑、文件传输等功能,并提供特殊缓冲区查看多房间事件。Ement.el可通过Pantalaimon代理使用加密房间,并可从GNU ELPA等包管理器安装。该客户端与Emacs自然集成,为用户提供流畅的Matrix聊天体验。

Ement.elMatrix客户端EmacsGNU ELPA聊天软件Github开源项目

#+TITLE: Ement.el

#+PROPERTY: LOGGING nil

Export options.

#+OPTIONS: broken-links:t *:t num:1 toc:1

Info export options.

#+EXPORT_FILE_NAME: ement.texi #+TEXINFO_DIR_CATEGORY: Emacs #+TEXINFO_DIR_TITLE: Ement: (ement) #+TEXINFO_DIR_DESC: Matrix client for Emacs

Note: This readme works with the org-make-toc https://github.com/alphapapa/org-make-toc package, which automatically updates the table of contents.

#+HTML: <img src="images/logo-128px.png" align="right">

ELPA badge image.

[[https://elpa.gnu.org/packages/ement.html][https://elpa.gnu.org/packages/ement.svg]]

Ement.el is a [[http://www.matrix.org/][Matrix]] client for [[https://www.gnu.org/software/emacs/][GNU Emacs]]. It aims to be simple, fast, featureful, and reliable, while integrating naturally with Emacs.

Feel free to join us in the chat room: [[https://matrix.to/#/#ement.el:matrix.org][https://img.shields.io/matrix/ement.el:matrix.org.svg?label=%23ement.el:matrix.org]]

  • Contents :noexport: :PROPERTIES: :TOC: :include siblings :END: :CONTENTS:
  • [[#installation][Installation]]
  • [[#usage][Usage]]
    • [[#bindings][Bindings]]
    • [[#tips][Tips]]
    • [[#encrypted-room-support-through-pantalaimon][Encrypted room support through Pantalaimon]]
  • [[#changelog][Changelog]]
  • [[#development][Development]] :END:
  • Screenshots :noexport: :PROPERTIES: :ID: d818f690-5f22-4eb0-83e1-4d8ce16c9e5b :END:

The default formatting style resembles IRC clients, with each message being prefixed by the username (which enables powerful Emacs features, like using Occur to show all messages from or mentioning a user). Alternative, built-in styles include an Element-like one with usernames above groups of messages, as well as a classic, no-margins IRC style. Messages may be optionally displayed with unique colors for each user (with customizable contrast), making it easier to follow conversations. Timestamp headers are optionally displayed where a certain amount of time passes between events, as well as where the date changes.

[[images/ement-for-twim.png]]

/Two rooms shown in side-by-side buffers, showing inline images, reactions, date/time headings, room avatars, and messages colored by user (using the modus-vivendi Emacs theme)./

[[images/emacs-with-fully-read-line.png]]

/#emacs:libera.chat showing colored text from IRC users, replies with quoted parts, messages colored by user, addressed usernames colored by their user color, highlighted mentions, and the fully-read marker line (using the modus-vivendi Emacs theme)./

[[images/screenshot5.png]]

/Four rooms shown at once, with messages colored by user, in the default Emacs theme./

[[images/screenshot2.png]]

/A room at the top in the "Elemental" display style, with sender names displayed over groups of messages, and only self-messages in an alternate color. The lower window shows an earlier version of the rooms list./

[[images/reactions.png]]

/Reactions displayed as color emojis (may need [[#displaying-symbols-and-emojis][proper Emacs configuration]])./

  • Installation :PROPERTIES: :TOC: :depth 0 :END:

** GNU ELPA

Ement.el is published in [[http://elpa.gnu.org/][GNU ELPA]] as [[https://elpa.gnu.org/packages/ement.html][ement]], so it may be installed in Emacs with the command M-x package-install RET ement RET. This is the recommended way to install Ement.el, as it will install the current stable release.

The latest development build may be installed from [[https://elpa.gnu.org/devel/ement.html][ELPA-devel]] or from Git (see below).

** GNU Guix

Ement.el is available in [[https://guix.gnu.org/][GNU Guix]] as [[https://packages.guix.gnu.org/packages/emacs-ement/][emacs-ement]].

** Debian, Ubuntu

Ement.el is available in [[https://packages.debian.org/elpa-ement][Debian as elpa-ement]] and in [[https://packages.ubuntu.com/search?suite=default&section=all&arch=any&keywords=elpa-ement&searchon=names][Ubuntu as elpa-ement]].

** Nix

Ement.el is available in [[https://nixos.org/][NixOS]] as [[https://search.nixos.org/packages?channel=23.05&show=emacsPackages.ement&from=0&size=50&sort=relevance&type=packages&query=ement][emacsPackages.ement]].

** Other distributions

Ement.el is also available in some other distributions. See [[https://repology.org/project/emacs:ement/related][Repology]] for details.

** Git master

The master branch of the Git repository is intended to be usable at all times; only minor bugs are expected to be found in it before a new stable release is made.

To install, it is recommended to use [[https://github.com/quelpa/quelpa-use-package][quelpa-use-package]], like this (using [[https://github.com/alphapapa/unpackaged.el#upgrade-a-quelpa-use-package-forms-package][this helpful command]] for upgrading versions):

#+BEGIN_SRC elisp ;; Install and load `quelpa-use-package'. (package-install 'quelpa-use-package) (require 'quelpa-use-package)

;; Install Ement. (use-package ement :quelpa (ement :fetcher github :repo "alphapapa/ement.el")) #+END_SRC

One might also use systems like [[https://github.com/progfolio/elpaca][Elpaca]] or [[https://github.com/radian-software/straight.el][Straight]] (which is also used by [[https://github.com/doomemacs/doomemacs][DOOM]]), but the author cannot offer support for them.

** Manual

Ement.el is intended to be installed with Emacs's package system, which will ensure that the required autoloads are generated, etc. If you choose to install it manually, you're on your own.

  • Usage :PROPERTIES: :TOC: :include descendants :depth 1 :END: :CONTENTS:
  • [[#bindings][Bindings]]
  • [[#tips][Tips]]
  • [[#encrypted-room-support-through-pantalaimon][Encrypted room support through Pantalaimon]] :END:
  1. Call command ement-connect to connect. Multiple sessions are supported: call the command again with a C-u universal prefix to connect to another account.
  2. Wait for initial sync to complete (which can take a few moments--initial sync JSON responses can be large).
  3. Use these commands (room-related commands may be called with universal prefix to prompt for the room):
    • ement-list-rooms to view the list of joined rooms.
    • ement-view-room to view a room's buffer, selected with completion.
    • ement-create-room to create a new room.
    • ement-create-space to create a space.
    • ement-invite-user to invite a user to a room.
    • ement-join-room to join a room.
    • ement-leave-room to leave a room.
    • ement-forget-room to forget a room.
    • ement-tag-room to toggle a tag on a room (including favorite/low-priority status).
    • ement-list-members to list members in a room.
    • ement-send-direct-message to send a direct message to a user (in an existing direct room, or creating a new one automatically).
    • ement-room-edit-message to edit a message at point.
    • ement-room-send-file to send a file.
    • ement-room-send-image to send an image.
    • ement-room-set-topic to set a room's topic.
    • ement-room-occur to search in a room's known events.
    • ement-room-override-name to override a room's display name.
    • ement-ignore-user to ignore a user (or with interactive prefix, un-ignore).
    • ement-room-set-message-format to set a room's message format buffer-locally.
    • ement-room-toggle-space to toggle a room's membership in a space (a way to group rooms in Matrix).
    • ement-directory to view a room directory.
    • ement-directory-search to search a room directory.
  4. Use these special buffers to see events from multiple rooms (you can also reply to messages from these buffers!):
    • See all new events that mention you in the =Ement Mentions= buffer.
    • See all new events in rooms that have open buffers in the =Ement Notifications= buffer.

** Bindings

These bindings are common to all of the following buffer types:

  • Switch to a room buffer: M-g M-r
  • Switch to the room list buffer: M-g M-l
  • Switch to the mentions buffer: M-g M-m
  • Switch to the notifications buffer: M-g M-n

*** Room buffers

Note that if global minor mode ement-room-self-insert-mode is enabled (by default it is disabled), typing any of the common printable ascii characters (such as letters) in a room buffer will start a new message, and most of the following bindings are instead accessed via a prefix key. See the minor mode docstring for details. (The ? binding is an exception; by default it opens the command menu regardless of this minor mode.)

  • Show command menu: ?

[[images/transient.png]]

Movement

  • Next event: n
  • Previous event: p
  • End of buffer: N
  • Scroll up and mark read: SPC
  • Scroll down: S-SPC
  • Jump to fully-read marker: M-g M-p
  • Move read markers to point: m
  • Load older messages: at top of buffer, scroll contents up (i.e. S-SPC, M-v or mwheel-scroll)

Switching

  • List rooms: M-g M-l
  • Switch to other room: M-g M-r
  • Switch to mentions buffer: M-g M-m
  • Switch to notifications buffer: M-g M-n
  • Quit window: q

Messages

  • Write message: RET
  • Compose message in buffer: M-RET (while writing in minibuffer: C-c '‍). Customize the option ement-room-compose-method to make RET and the other message bindings use a compose buffer by default. Use command ement-room-compose-org to activate Org mode in the compose buffer.
  • Write reply to event at point: S-<return>
  • Edit message: <insert>
  • Delete message: C-k
  • Send reaction to event at point, or send same reaction at point: s r
  • Send emote: s e
  • Send file: s f
  • Send image: s i
  • View event source: v
  • Complete members and rooms at point: C-M-i (standard completion-at-point command). (Type an @ prefix for a member mention, a # prefix for a room alias, or a ! prefix for a room ID.)

Images

  • Toggle scale of image (between fit-to-window and thumbnail): mouse-1
  • Show image in new buffer at full size: double-mouse-1

Users

  • Send direct message: u RET
  • Invite user: u i
  • Ignore user: u I

Room

  • Occur search in room: M-s o
  • List members: r m
  • Set topic: r t
  • Set message format: r f
  • Set notification rules: r n
  • Override display name: r N
  • Tag/untag room: r T

Room membership

  • Create room: R c
  • Join room: R j
  • Leave room: R l
  • Forget room: R F
  • Toggle room's spaces: R s

Other

  • Sync new messages (not necessary if auto sync is enabled; with prefix to force new sync): g

*** Room list buffer

  • Show buffer of room at point: RET

  • Show buffer of next unread room: SPC

  • Move between room names: TAB / <backtab>

  • Kill room's buffer: k

  • Toggle room's membership in a space: s

*** Directory buffers

  • View/join a room: RET / mouse-1
  • Load next batch of rooms: +

*** Mentions/notifications buffers

  • Move between events: TAB / <backtab>
  • Go to event at point in its room buffer: RET
  • Write reply to event at point (shows the event in its room while writing): S-<return>

** Tips

TODO: Show sending messages in Org format.

  • Desktop notifications are enabled by default for events that mention the local user. They can also be shown for all events in rooms with open buffers.
  • Send messages in Org mode format by customizing the option ement-room-send-message-filter (which enables Org format by default), or by calling ement-room-compose-org in a compose buffer (which enables it for a single message). Then Org-formatted messages are automatically converted and sent as HTML-formatted messages (with the Org syntax as the plain-text fallback). You can send syntax such as:
    • Bold, italic, underline, strikethrough
    • Links
    • Tables
    • Source blocks (including results with :exports both)
    • Footnotes (okay, that might be pushing it, but you can!)
    • And, generally, anything that Org can export to HTML
    • Note that the default org-export-preserve-breaks value causes singular line breaks to be exported as spaces. To preserve the line breaks, indentation, and blank lines in a region, but otherwise use normal formatting, you can use the verse block type. Refer to (info "(org) Paragraphs") and (info "(org) Structure Templates") for details.
  • Starting in the room list buffer, by pressing SPC repeatedly, you can cycle through and read all rooms with unread buffers. (If a room doesn't have a buffer, it will not be included.)
  • Room buffers and the room-list buffer can be bookmarked in Emacs, i.e. using =C-x r m=. This is especially useful with [[https://github.com/alphapapa/burly.el][Burly]]: you can arrange an Emacs frame with several room buffers displayed at once, use =burly-bookmark-windows= to bookmark the layout, and then you can restore that layout and all of the room buffers by opening the bookmark, rather than having to manually arrange them every time you start Emacs or change the window configuration.
  • Images and other files can be uploaded to rooms using drag-and-drop.
  • Mention members by typing a @ followed by their displayname or Matrix ID. (Members' names and rooms' aliases/IDs may be completed with completion-at-point commands.)
  • Customize ement-room-use-variable-pitch to render messages using proportional fonts.
  • You can customize settings in the ement group.
    • Note: setq should not be used for certain options, because it will not call the associated setter function. Users who have an aversion to the customization system may experience problems.

*** Displaying symbols and emojis

Emacs may not display certain symbols and emojis well by default. Based on [[https://emacs.stackexchange.com/questions/62049/override-the-default-font-for-emoji-characters][this question and answer]], you may find that the simplest way to fix this is to install an appropriate font, like [[https://www.google.com/get/noto/#emoji-zsye][Noto Emoji]], and then use this Elisp code:

#+BEGIN_SRC elisp (setf use-default-font-for-symbols nil) (set-fontset-font t 'unicode "Noto Emoji" nil 'append) #+END_SRC

** Encrypted room support through Pantalaimon

Ement.el doesn't support encrypted rooms natively, but it can be used transparently with the E2EE-aware reverse proxy daemon [[https://github.com/matrix-org/pantalaimon/][Pantalaimon]]. After configuring it according to its documentation, call ement-connect with the appropriate hostname and port, like:

#+BEGIN_SRC elisp (ement-connect :uri-prefix "http://localhost:8009") #+END_SRC

  • Changelog :PROPERTIES: :TOC: :depth 0 :END:

** 0.16-pre

Changes

Fixes

** 0.15.1

Fixes

编辑推荐精选

TRAE编程

TRAE编程

AI辅助编程,代码自动修复

Trae是一种自适应的集成开发环境(IDE),通过自动化和多元协作改变开发流程。利用Trae,团队能够更快速、精确地编写和部署代码,从而提高编程效率和项目交付速度。Trae具备上下文感知和代码自动完成功能,是提升开发效率的理想工具。

AI工具TraeAI IDE协作生产力转型热门
蛙蛙写作

蛙蛙写作

AI小说写作助手,一站式润色、改写、扩写

蛙蛙写作—国内先进的AI写作平台,涵盖小说、学术、社交媒体等多场景。提供续写、改写、润色等功能,助力创作者高效优化写作流程。界面简洁,功能全面,适合各类写作者提升内容品质和工作效率。

AI辅助写作AI工具蛙蛙写作AI写作工具学术助手办公助手营销助手AI助手
问小白

问小白

全能AI智能助手,随时解答生活与工作的多样问题

问小白,由元石科技研发的AI智能助手,快速准确地解答各种生活和工作问题,包括但不限于搜索、规划和社交互动,帮助用户在日常生活中提高效率,轻松管理个人事务。

热门AI助手AI对话AI工具聊天机器人
Transly

Transly

实时语音翻译/同声传译工具

Transly是一个多场景的AI大语言模型驱动的同声传译、专业翻译助手,它拥有超精准的音频识别翻译能力,几乎零延迟的使用体验和支持多国语言可以让你带它走遍全球,无论你是留学生、商务人士、韩剧美剧爱好者,还是出国游玩、多国会议、跨国追星等等,都可以满足你所有需要同传的场景需求,线上线下通用,扫除语言障碍,让全世界的语言交流不再有国界。

讯飞智文

讯飞智文

一键生成PPT和Word,让学习生活更轻松

讯飞智文是一个利用 AI 技术的项目,能够帮助用户生成 PPT 以及各类文档。无论是商业领域的市场分析报告、年度目标制定,还是学生群体的职业生涯规划、实习避坑指南,亦或是活动策划、旅游攻略等内容,它都能提供支持,帮助用户精准表达,轻松呈现各种信息。

AI办公办公工具AI工具讯飞智文AI在线生成PPTAI撰写助手多语种文档生成AI自动配图热门
讯飞星火

讯飞星火

深度推理能力全新升级,全面对标OpenAI o1

科大讯飞的星火大模型,支持语言理解、知识问答和文本创作等多功能,适用于多种文件和业务场景,提升办公和日常生活的效率。讯飞星火是一个提供丰富智能服务的平台,涵盖科技资讯、图像创作、写作辅助、编程解答、科研文献解读等功能,能为不同需求的用户提供便捷高效的帮助,助力用户轻松获取信息、解决问题,满足多样化使用场景。

热门AI开发模型训练AI工具讯飞星火大模型智能问答内容创作多语种支持智慧生活
Spark-TTS

Spark-TTS

一种基于大语言模型的高效单流解耦语音令牌文本到语音合成模型

Spark-TTS 是一个基于 PyTorch 的开源文本到语音合成项目,由多个知名机构联合参与。该项目提供了高效的 LLM(大语言模型)驱动的语音合成方案,支持语音克隆和语音创建功能,可通过命令行界面(CLI)和 Web UI 两种方式使用。用户可以根据需求调整语音的性别、音高、速度等参数,生成高质量的语音。该项目适用于多种场景,如有声读物制作、智能语音助手开发等。

咔片PPT

咔片PPT

AI助力,做PPT更简单!

咔片是一款轻量化在线演示设计工具,借助 AI 技术,实现从内容生成到智能设计的一站式 PPT 制作服务。支持多种文档格式导入生成 PPT,提供海量模板、智能美化、素材替换等功能,适用于销售、教师、学生等各类人群,能高效制作出高品质 PPT,满足不同场景演示需求。

讯飞绘文

讯飞绘文

选题、配图、成文,一站式创作,让内容运营更高效

讯飞绘文,一个AI集成平台,支持写作、选题、配图、排版和发布。高效生成适用于各类媒体的定制内容,加速品牌传播,提升内容营销效果。

热门AI辅助写作AI工具讯飞绘文内容运营AI创作个性化文章多平台分发AI助手
材料星

材料星

专业的AI公文写作平台,公文写作神器

AI 材料星,专业的 AI 公文写作辅助平台,为体制内工作人员提供高效的公文写作解决方案。拥有海量公文文库、9 大核心 AI 功能,支持 30 + 文稿类型生成,助力快速完成领导讲话、工作总结、述职报告等材料,提升办公效率,是体制打工人的得力写作神器。

下拉加载更多