mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-11-25 09:36:14 +01:00
640de3fb86
This reverts commit b673fb12c1
.
2.1 KiB
2.1 KiB
ement.el
(use-package password-store
:straight t)
(defun ement-connect-sentinel (process msg)
(when (memq (process-status process) '(exit signal))
(with-current-buffer " *ement-pass*"
(ement-connect
:uri-prefix "http://localhost:8008"
:password (string-trim (substring-no-properties (buffer-string)))
:user-id "@magic_rb:matrix.redalder.org")
(kill-buffer))))
(defun after-init-ement-connect ()
(set-process-sentinel (start-process "ement-pass" " *ement-pass*" "pass" "Matrix/@magic_rb:matrix.redalder.org") #'ement-connect-sentinel))
(use-package ement
:straight '(ement :type git :host github :repo "alphapapa/ement.el")
:after (password-store)
:custom
(ement-save-sessions t)
:config
(remove-hook 'ement-after-initial-sync-hook #'ement-room-list--after-initial-sync)
(add-hook 'after-init-hook #'after-init-ement-connect))
(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)
(vterm-send-C-c)))))
Enable message composition in Org Mode by default.
(setq ement-room-send-message-filter #'ement-room-send-org-filter)
Define an interactive command to open pantalaimon in Emacs.
(defun panctl (&optional name)
(interactive)
(let* ((name- (or name "panctl"))
(buffer (get-buffer name-))
(vterm-shell "panctl"))
(if buffer
(switch-to-buffer buffer)
(vterm name-)
(whitespace-mode -1))))