From 2975c7da1b6028209c9a3dad05914d0d9d585a74 Mon Sep 17 00:00:00 2001 From: Correl Date: Tue, 30 May 2023 00:37:46 -0400 Subject: [PATCH] [emacs] Improve the Matrix experience --- .doom.d/config.org | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/.doom.d/config.org b/.doom.d/config.org index 39eb9b3..122f2e9 100644 --- a/.doom.d/config.org +++ b/.doom.d/config.org @@ -1231,7 +1231,29 @@ Prefer sending HTML-formatted messages with plain text as a fallback option *** Matrix #+begin_src emacs-lisp (use-package! ement - :commands 'ement-connect) + :commands 'ement-connect + :init + (defvar +matrix-workspace-name "*Matrix*") + (defvar +matrix--old-wconf nil) + (defun +matrix () + (interactive) + (if (modulep! :ui workspaces) + (+workspace/new +matrix-workspace-name) + (setq +matrix--old-wconf (current-window-configuration)) + (delete-other-windows) + (switch-to-buffer (doom-fallback-buffer))) + (call-interactively #'ement-connect)) + (defun +matrix/quit () + (interactive) + (ement-disconnect (mapcar #'cdr ement-sessions)) + (when (modulep! :ui workspaces) + (+workspace/delete +matrix-workspace-name)) + (when +matrix--old-wconf + (set-window-configuration +matrix--old-wconf) + (setq +matrix--old-wconf nil))) + :config + (when (modulep! :ui popup) + (set-popup-rule! "\\*Ement " :ignore t))) #+end_src ** Music Configure EMMS for playing music files on my computer.