2022-09-26 18:39:53 +02:00
|
|
|
:PROPERTIES:
|
|
|
|
:ID: cfb02bea-f9a2-4c7c-8971-d082feedab22
|
|
|
|
:END:
|
|
|
|
#+title: ement.el
|
|
|
|
#+filetags: emacs-load
|
2022-10-01 19:53:16 +02:00
|
|
|
|
2022-09-26 18:39:53 +02:00
|
|
|
#+begin_src emacs-lisp
|
2022-10-07 22:05:31 +02:00
|
|
|
(use-package password-store
|
|
|
|
:straight t)
|
2022-09-26 18:39:53 +02:00
|
|
|
(use-package ement
|
2022-10-07 22:05:31 +02:00
|
|
|
:straight '(ement :type git :host github :repo "alphapapa/ement.el")
|
2022-10-07 22:34:42 +02:00
|
|
|
:after (password-store)
|
2022-10-07 22:05:31 +02:00
|
|
|
:config
|
2022-10-29 21:44:51 +02:00
|
|
|
(setq ement-save-sessions t)
|
2022-10-07 22:05:31 +02:00
|
|
|
(ement-connect
|
|
|
|
:uri-prefix "http://localhost:8008"
|
|
|
|
:password (password-store-get "Matrix/@magic_rb:matrix.redalder.org")
|
|
|
|
:user-id "@magic_rb:matrix.redalder.org"))
|
2022-09-26 18:39:53 +02:00
|
|
|
#+end_src
|
2022-10-27 14:07:02 +02:00
|
|
|
|
2022-10-31 00:52:06 +01:00
|
|
|
#+begin_src emacs-lisp
|
|
|
|
(defun ement-send-anyways ()
|
|
|
|
(interactive)
|
|
|
|
(when (ement-room-p ement-room)
|
|
|
|
(let ((ement-room- ement-room)
|
|
|
|
(ement-session- ement-session))
|
|
|
|
(save-excursion
|
|
|
|
(panctl "*panctl-temp-send-anyway*")
|
|
|
|
(vterm-insert "send-anyways " (ement-user-id (ement-session-user ement-session-)) " " (ement-room-id ement-room-))
|
|
|
|
(vterm-send-return)
|
2022-11-10 22:40:19 +01:00
|
|
|
(vterm-send-C-c)))))
|
2022-10-31 00:52:06 +01:00
|
|
|
#+end_src
|
|
|
|
|
|
|
|
Enable message composition in [[id:986ca7a5-d225-49bb-9e35-f2dffafe8aee][Org Mode]] by default.
|
2022-10-27 14:07:02 +02:00
|
|
|
|
|
|
|
#+begin_src emacs-lisp
|
|
|
|
(setq ement-room-send-message-filter #'ement-room-send-org-filter)
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
Define an interactive command to open [[https://github.com/matrix-org/pantalaimon][pantalaimon]] in Emacs.
|
|
|
|
|
|
|
|
#+begin_src emacs-lisp
|
2022-10-31 00:52:06 +01:00
|
|
|
(defun panctl (&optional name)
|
2022-10-27 14:07:02 +02:00
|
|
|
(interactive)
|
2022-10-31 00:52:06 +01:00
|
|
|
(let* ((name- (or name "panctl"))
|
|
|
|
(buffer (get-buffer name-))
|
|
|
|
(vterm-shell "panctl"))
|
2022-10-27 14:07:02 +02:00
|
|
|
(if buffer
|
|
|
|
(switch-to-buffer buffer)
|
2022-10-31 00:52:06 +01:00
|
|
|
(vterm name-)
|
2022-10-27 14:07:02 +02:00
|
|
|
(whitespace-mode -1))))
|
|
|
|
#+end_src
|
|
|
|
|