diff --git a/emacs-lisp/ement_el.org b/emacs-lisp/ement_el.org index 217e6f5..6258dc2 100644 --- a/emacs-lisp/ement_el.org +++ b/emacs-lisp/ement_el.org @@ -13,11 +13,15 @@ (with-current-buffer " *ement-pass*" (ement-connect :uri-prefix "http://localhost:8008" - :password (string-trim (substring-no-properties (buffer-string))) + :password (let ((password (string-trim (substring-no-properties (buffer-string))))) + (if (not (equal (process-exit-status process) 0)) + (read-passwd "Ement password: ") + password)) :user-id "@magic_rb:matrix.redalder.org") (kill-buffer)))) (defun after-init-ement-connect () + (interactive) (set-process-sentinel (start-process "ement-pass" " *ement-pass*" "pass" "Matrix/@magic_rb:matrix.redalder.org") #'ement-connect-sentinel)) (use-package ement @@ -27,7 +31,7 @@ (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)) + (setf ement-sessions (ement--read-sessions))) #+end_src #+begin_src emacs-lisp