Add custom function to start ement.el without prompts
Inspired by https://github.com/alphapapa/ement.el/issues/32#issuecomment-902539093.
This commit is contained in:
parent
441db75ae2
commit
0f43b7303f
1
init.el
1
init.el
@ -358,6 +358,7 @@
|
||||
db/scratch
|
||||
db/find-user-init-file
|
||||
db/run-or-hide-ansi-term
|
||||
db/ement-connect
|
||||
db/hex-to-ascii
|
||||
db/text-to-hex
|
||||
turn-on-lispy-when-available
|
||||
|
||||
@ -20,6 +20,16 @@
|
||||
:group 'personal-settings
|
||||
:type 'string)
|
||||
|
||||
(defcustom db/matrix-user-id ""
|
||||
"Main Matrix User ID."
|
||||
:group 'personal-settings
|
||||
:type 'string)
|
||||
|
||||
(defcustom db/matrix-password-store-entry ""
|
||||
"Password Store entry for Matrix User ID in `db/matrix-user-id'."
|
||||
:group 'personal-settings
|
||||
:type 'string)
|
||||
|
||||
(defcustom db/important-documents-path "~/Documents/library/"
|
||||
"Path to look for documents that can be listed in extended
|
||||
search commands like `db/helm-shortcuts’."
|
||||
|
||||
@ -105,6 +105,16 @@ With ARG, switch to `default-directory' of the current buffer first."
|
||||
(insert (format "cd '%s'" current-dir))
|
||||
(comint-send-input)))))
|
||||
|
||||
(defun db/ement-connect ()
|
||||
"Connect to my matrix account."
|
||||
(interactive)
|
||||
(require 'ement)
|
||||
(let ((password (password-store-get db/matrix-password-store-entry)))
|
||||
(unless password
|
||||
(user-error "No pass entry for Matrix password at “%s”" db/matrix-password-store-entry))
|
||||
(ement-connect :user-id db/matrix-user-id
|
||||
:password password)))
|
||||
|
||||
|
||||
;;; General Utilities
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user