[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/pcmpl-args 593811a570 29/33: Reimplemented listing of gpg
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/pcmpl-args 593811a570 29/33: Reimplemented listing of gpg keys in e-lisp |
Date: |
Mon, 31 Jan 2022 11:59:28 -0500 (EST) |
branch: elpa/pcmpl-args
commit 593811a5709f241680ec7ae21e77fbd66c280a8c
Author: Valeriy Litkovskyy <vlr.ltkvsk@protonmail.com>
Commit: Troy Hinckley <t.macman@gmail.com>
Reimplemented listing of gpg keys in e-lisp
---
pcmpl-args.el | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/pcmpl-args.el b/pcmpl-args.el
index e42dffe147..6b7a25a21a 100644
--- a/pcmpl-args.el
+++ b/pcmpl-args.el
@@ -3485,20 +3485,20 @@ return only directories."
This list is filtered based on `ARGS', which is an alist with
inserted command line argument. If some gpg key was already
entered, it will be removed from returned list."
- ;; Should we use epg-list-keys to get keys?
- (let ((rx "^\\(?:[^:]*:\\)\\{9\\}\\([^:]*\\).*?$"))
- (with-temp-buffer
- (pcmpl-args-process-file "gpg2" "--list-secret-keys" "--with-colons")
- (goto-char (point-min))
- (save-match-data
- (while (search-forward-regexp rx nil t)
- (replace-match "\\1")))
- (forward-line 1)
- (let (lines)
- (while (progn (forward-line -1)
- (push (string-trim-right (thing-at-point 'line t)) lines)
- (not (bobp))))
- (cl-set-difference lines (cadr (assq '* args)) :test #'string=)))))
+ ;; Dirty hack
+ (unless (boundp 'epa-protocol)
+ (require 'epa))
+
+ (let* ((context (epg-make-context epa-protocol))
+ (keys (epg-list-keys context nil 'secret))
+ (extract-fingerprints
+ (lambda (key)
+ (append
+ (mapcar #'epg-user-id-string (epg-key-user-id-list key))
+ (mapcar #'epg-sub-key-fingerprint (epg-key-sub-key-list key))))))
+ (cl-set-difference (mapcan extract-fingerprints keys)
+ (cadr (assq '* args))
+ :test #'string=)))
(defun pcmpl-args-pass-subcommand-specs (subcommand)
"Return specs for pass `SUBCOMMAND'."
- [nongnu] elpa/pcmpl-args 7bc360c2e5 10/33: Don't throw an error when man page is missing, (continued)
- [nongnu] elpa/pcmpl-args 7bc360c2e5 10/33: Don't throw an error when man page is missing, ELPA Syncer, 2022/01/31
- [nongnu] elpa/pcmpl-args 0b8a05fc6e 13/33: Add additional README formatting, ELPA Syncer, 2022/01/31
- [nongnu] elpa/pcmpl-args 83f43d0f6f 12/33: Reformat README, ELPA Syncer, 2022/01/31
- [nongnu] elpa/pcmpl-args e6957896b0 15/33: Add shell-quote-argument to name, ELPA Syncer, 2022/01/31
- [nongnu] elpa/pcmpl-args a04b9f0308 14/33: Filter out backspace character in default man function output, ELPA Syncer, 2022/01/31
- [nongnu] elpa/pcmpl-args 6d45d2d7c1 16/33: Fixed too many subcommmands for git completions, ELPA Syncer, 2022/01/31
- [nongnu] elpa/pcmpl-args 02ae18bda3 33/33: Revert "Fix expansion of $PREFIX in most commands", ELPA Syncer, 2022/01/31
- [nongnu] elpa/pcmpl-args 0b4d9bb8ce 25/33: Implemented col -b in elisp, ELPA Syncer, 2022/01/31
- [nongnu] elpa/pcmpl-args 4c299e8f64 27/33: Added missing subr-x dependency and bumped emacs version, ELPA Syncer, 2022/01/31
- [nongnu] elpa/pcmpl-args 5f2943fd70 30/33: Bump version after moving minimum Emacs to 25.1, ELPA Syncer, 2022/01/31
- [nongnu] elpa/pcmpl-args 593811a570 29/33: Reimplemented listing of gpg keys in e-lisp,
ELPA Syncer <=
- [nongnu] elpa/pcmpl-args d911fddfa2 26/33: Fixed formatting and tabs, ELPA Syncer, 2022/01/31
- [nongnu] elpa/pcmpl-args ec71fe5813 28/33: Reimplemented pass find in e-lisp, ELPA Syncer, 2022/01/31
- [nongnu] elpa/pcmpl-args 604ea27bdf 17/33: Use cl-lib instead of cl, ELPA Syncer, 2022/01/31
- [nongnu] elpa/pcmpl-args c162469e41 18/33: Minor fixes, ELPA Syncer, 2022/01/31
- [nongnu] elpa/pcmpl-args e51aae79a7 32/33: Fix expansion of $PREFIX in most commands, ELPA Syncer, 2022/01/31
- [nongnu] elpa/pcmpl-args c812b254ba 23/33: Fixed docstrings, ELPA Syncer, 2022/01/31