From c3d9f9b1b1ccb1018e66b6767ee5cb0b191858d0 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Sat, 17 Feb 2024 21:56:26 +0200 Subject: Add gnosis-git--process --- gnosis.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gnosis.el b/gnosis.el index 0750e87..49f917d 100644 --- a/gnosis.el +++ b/gnosis.el @@ -1025,6 +1025,18 @@ Used to reveal all clozes left with `gnosis-face-cloze-unanswered' face." (funcall func-name id))) (error "Malformed note type: '%s'" type)))) +(defun gnosis-git--process (command) + "Start a git process with COMMAND." + (let ((proc (start-process "*git-gnosis*" nil "git" command))) + ;; Filter for password prompt + (set-process-filter proc (lambda (proc string) + (when (string-match "Password\\|password\\|passphrase" string) + (process-send-string proc (read-passwd "Password: "))))) + ;; Set sentinel to delete process when done + (set-process-sentinel proc (lambda (proc event) + (when (eq 'exit (process-status proc)) + (unless (process-live-p proc) + (delete-process proc))))))) (defun gnosis-review-commit (note-num) "Commit review session on git repository. -- cgit v1.2.3