From 46f9e53c3da53db662bf6ab94c02e50754eeae0a Mon Sep 17 00:00:00 2001 From: Filipp Gunbin Date: Mon, 13 Mar 2023 19:27:13 +0300 Subject: [PATCH] Fix import of keys in buffer created by epa-search-keys * lisp/epa-ks.el (epa-ks--query-url): Add operation parameter. (epa-ks--fetch-key, epa-search-keys): Use it. --- lisp/epa-ks.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lisp/epa-ks.el b/lisp/epa-ks.el index 77d896fa438..015bf910ac6 100644 --- a/lisp/epa-ks.el +++ b/lisp/epa-ks.el @@ -140,8 +140,8 @@ Keys are marked using `epa-ks-mark-key-to-fetch'." (epa-ks--fetch-key id))))) (tabulated-list-clear-all-tags)) -(defun epa-ks--query-url (query exact) - "Return URL for QUERY. +(defun epa-ks--query-url (query exact &optional operation) + "Return URL for QUERY and OPERATION (defaults to \"index\"). If EXACT is non-nil, don't accept approximate matches." (format "https://%s/pks/lookup?%s" (cond ((null epa-keyserver) @@ -154,13 +154,13 @@ If EXACT is non-nil, don't accept approximate matches." (url-build-query-string (append `(("search" ,query) ("options" "mr") - ("op" "index")) + ("op" ,(or operation "index"))) (and exact '(("exact" "on"))))))) (defun epa-ks--fetch-key (id) "Send request to import key with specified ID." (url-retrieve - (epa-ks--query-url (concat "0x" (url-hexify-string id)) t) + (epa-ks--query-url (concat "0x" (url-hexify-string id)) t "get") (lambda (status) (when (plist-get status :error) (error "Request failed: %s" @@ -236,7 +236,7 @@ enough, since keyservers have strict timeout settings." (erase-buffer)) (epa-ks-search-mode)) (url-retrieve - (epa-ks--query-url query exact) + (epa-ks--query-url query exact "index") (lambda (status) (when (plist-get status :error) (when buf -- 2.39.2