tools/password-store: fix emacs 26 compatibility

This commit is contained in:
Henrik Lissner 2017-12-10 15:37:01 -05:00
parent 41751aca44
commit 3bc0b18184
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 30 additions and 18 deletions

View file

@ -10,14 +10,19 @@
(t
(pass))))
;;;###autoload
(defalias '+pass--get-entry
(if (featurep 'auth-store-pass)
#'auth-source-pass-parse-entry
#'auth-pass-parse-entry))
;;;###autoload
(defun +pass-get-field (entry fields)
(unless noninteractive
(if-let* ((data (if (listp entry) entry (auth-pass-parse-entry entry))))
(cl-loop for key in (doom-enlist fields)
when (assoc key data)
return (cdr it))
(error "Couldn't find entry: %s" entry))))
(if-let* ((data (if (listp entry) entry (+pass--get-entry entry))))
(cl-loop for key in (doom-enlist fields)
when (assoc key data)
return (cdr it))
(error "Couldn't find entry: %s" entry)))
;;;###autoload
(defun +pass-get-user (entry)
@ -35,7 +40,7 @@
(error "Username not found.")))
(defun +pass-ivy-action--get-field (item)
(let* ((data (auth-pass-parse-entry item))
(let* ((data (+pass--get-entry item))
(field (if data (completing-read "Field: " (mapcar #'car data) nil t))))
(if data
(progn