diff options
author | Filipp Gunbin <fgunbin@fastmail.fm> | 2023-03-13 19:27:13 +0300 |
---|---|---|
committer | Filipp Gunbin <fgunbin@fastmail.fm> | 2023-03-13 20:37:53 +0300 |
commit | 46f9e53c3da53db662bf6ab94c02e50754eeae0a (patch) | |
tree | 08285e0332ac3a998c72193c62c2393bdfab942e /lisp/epa-ks.el | |
parent | 36ade0704e1829fd27970e8d478cf4b52deed517 (diff) | |
download | emacs-46f9e53c3da53db662bf6ab94c02e50754eeae0a.tar.gz emacs-46f9e53c3da53db662bf6ab94c02e50754eeae0a.tar.bz2 emacs-46f9e53c3da53db662bf6ab94c02e50754eeae0a.zip |
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.
Diffstat (limited to 'lisp/epa-ks.el')
-rw-r--r-- | lisp/epa-ks.el | 10 |
1 files 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 |