From 73889a69dfe47cb7d710e44e7b5b382fcd59cb7e Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Sun, 15 Oct 2023 14:22:54 -0700 Subject: [PATCH] Fix khard.el --- elisp/khard.el | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/elisp/khard.el b/elisp/khard.el index 1a9b3ec..4aaedb8 100644 --- a/elisp/khard.el +++ b/elisp/khard.el @@ -51,19 +51,6 @@ For info on PROC and STATUS, see `set-process-sentinel'." (shell-command-set-point-after-cmd (process-buffer proc)) (message "khard: %s." (substring status 0 -1)))) -(defun khard-edit (uid) - "Edit the contact with UID. -When called interactively, prompt the user." - (interactive (list (cdr-safe (khard--prompt-contact "Edit Contact ")))) - (let ((with-editor-shell-command-use-emacsclient nil)) - (make-process :name "khard edit" - :command - `("khard" "edit" "--edit" - ,(format "uid:%s" (cdr-safe contact))) - :buffer nil - :filter #'with-editor-process-filter - :sentinel #'khard--process-sentinel))) - (defun khard-delete (contact no-confirm) "Delete CONTACT, which is of the form (name . uid). When called interactively, prompt the user. @@ -75,7 +62,7 @@ If NO-CONFIRM is nil, do not ask the user." :command `("khard" "delete" "--force" ,(format "uid:%s" (cdr-safe contact))) - :buffer nil + :buffer "*khard output*" :sentinel #'khard--process-sentinel))) (defun khard--prompt-address-book () @@ -110,10 +97,22 @@ When called interactively, prompt for ABOOK." :command `("env" ,(concat "EDITOR=" with-editor-sleeping-editor) "khard" "new" "--edit" "-a" ,abook) - :buffer nil + :buffer "*khard output*" :filter #'khard--new-process-filter :sentinel #'khard--process-sentinel)))) +(defun khard-edit (uid) + "Edit the contact with UID. +When called interactively, prompt the user." + (interactive (list (cdr-safe (khard--prompt-contact "Edit Contact ")))) + (make-process :name "khard edit" + :command + `("env" ,(concat "EDITOR=" with-editor-sleeping-editor) + "khard" "edit" "--edit" ,(format "uid:%s" uid)) + :buffer "*khard output*" + :filter #'khard--new-process-filter + :sentinel #'khard--process-sentinel)) + (defun khard--parse-email-list (list-str) "Parse LIST-STR, a python dictionary and array string of emails." (if-let ((length (length list-str))