Browse Source

Fix to adapt to khard 0.15

The new version of khard requires a few changes to the library.
tags/v0.2.0^2
Damien Cassou 1 month ago
parent
commit
e5971358ca
Signed by: Damien Cassou <damien@cassou.me> GPG Key ID: B68746238E59B548
1 changed files with 9 additions and 3 deletions
  1. +9
    -3
      khardel.el

+ 9
- 3
khardel.el View File

@@ -42,6 +42,11 @@
"Hook run when a contact edition is completed."
:type 'hook)

(defcustom khardel-vcard-version "3.0"
"Version of the vcard format used.
This is passed to \"vcard new\".'"
:type 'string)

(defvar khardel--emails nil
"Cache a list of strings of the form \"Name <email>\".")

@@ -98,7 +103,7 @@ If nil, the buffer represents a new contact.")
(interactive (list (khardel-choose-contact)))
(let ((buffer (generate-new-buffer (format "*khardel<%s>*" (cdr contact)))))
(with-current-buffer buffer
(call-process "khard" nil t nil "export" "--uid" (car contact))
(call-process "khard" nil t nil "show" "--format" "yaml" "--uid" (car contact))
(goto-char (point-min))
(khardel-edit-mode)
(setq-local khardel-edit-contact contact))
@@ -112,7 +117,7 @@ If nil, the buffer represents a new contact.")
(interactive)
(let ((buffer (generate-new-buffer "*khardel<new>*")))
(with-current-buffer buffer
(call-process "khard" nil t nil "export" "--empty-contact-template")
(call-process "khard" nil t nil "template")
(khardel-edit-mode)
(setq-local khardel-edit-contact nil))
(switch-to-buffer buffer)
@@ -137,7 +142,8 @@ If nil, the buffer represents a new contact.")
"--uid" ,(car khardel-edit-contact)
"--input-file" ,filename)
`("new"
"--input-file" ,filename))))
"--input-file" ,filename
"--vcard-version" ,khardel-vcard-version))))
(write-region (point-min) (point-max) filename)
(when (equal 0 (apply
#'call-process-region

Loading…
Cancel
Save