From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Filipp Gunbin Newsgroups: gmane.emacs.help Subject: Re: problems importing keys via epa-search-keys Date: Sun, 12 Mar 2023 02:04:21 +0300 Message-ID: References: <87zg8mz998.fsf@xelera.eu> <83mt4jycxt.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38998"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: help-gnu-emacs@gnu.org To: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Mar 12 00:05:00 2023 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pb8Go-0009q1-O4 for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 12 Mar 2023 00:05:00 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pb8GP-0001lX-Pr; Sat, 11 Mar 2023 18:04:33 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pb8GN-0001kx-Qw for help-gnu-emacs@gnu.org; Sat, 11 Mar 2023 18:04:31 -0500 Original-Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pb8GL-0001ao-U4; Sat, 11 Mar 2023 18:04:31 -0500 Original-Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 3D0F632008FD; Sat, 11 Mar 2023 18:04:26 -0500 (EST) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Sat, 11 Mar 2023 18:04:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1678575865; x=1678662265; bh=i8 a3haCxsnQize2QkDwX+ZuWAZGebUQX4wz1CgQ3Ers=; b=KoBa8YQvaujN5Dx5QG S48NSVCpBx9rzYpZ0MCsrdYzV1+TpiGpEex2Jj+sIcM9RUC1/QtAxY1ia6QbwJKm hkrAeILPHJ6KnhRq5fiLDZZ6rS+kml7s71szeR5Eh3odGVgLZvTqcaeQy3rdauG1 PKxcA2mGuT48eg2hn1jdw7ZC3nmJqY10lVvwd8VwC+btc79aGGAZNBGKHcaLvLPx TS2baOQZfocMLzMJuHm+FdKBiipcuhzZGC3+1Lp+cW5tI5QEb/3PsPppiC1ursu2 YsEwNus+L9sO4BlsyWGLDGUoYHGO2mNsjOWYh05ncAQa9x+HffLlq2ymbhFZfena KNmg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1678575865; x=1678662265; bh=i8a3haCxsnQiz e2QkDwX+ZuWAZGebUQX4wz1CgQ3Ers=; b=UYdGRBdiRE7YxCpOZz0bzxklOR8Tb PiSrGkx5XcnMqRgJAcbsf6JTOxTQhUqZauiZ9bY9uDPPJj17Cj4rjwIZ3djjSZUQ JX0yn//2TghZLwfvae2ccMV/aRzM1/fHDJF3fcmIiUp4XgZ1pYUyJcEMkYWPHxjo 6vIHproNM0fPYQ5w7aAA43fQEGkdMOKCobyDQLOSuBbKfbztFHNMWz701kLI4NM/ azJ14tPSchp0yMzghG1/56pFN9BJz++EJgj/8EX3d4pr6TKH4YJ31wPw70uvx9S6 hBQG0Q+36fupZs01tVAvCPp0Mmejvlek+D+VOLR1ho2r1nHWoN1PdP70w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvddvuddgtdehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefujghffgffkfggtgesthdtredttdertdenucfhrhhomhephfhilhhi phhpucfiuhhnsghinhcuoehfghhunhgsihhnsehfrghsthhmrghilhdrfhhmqeenucggtf frrghtthgvrhhnpeffhfejveeiieeiudetgfehffelieevfeeffedtkeelheeludefueeu udehveeiffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehfghhunhgsihhnsehfrghsthhmrghilhdrfhhm X-ME-Proxy: Feedback-ID: id48c41f1:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 11 Mar 2023 18:04:24 -0500 (EST) In-Reply-To: <83mt4jycxt.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 11 Mar 2023 09:17:18 +0200") Mail-Followup-To: Eli Zaretskii , help-gnu-emacs@gnu.org Received-SPF: pass client-ip=64.147.123.24; envelope-from=fgunbin@fastmail.fm; helo=wout1-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:142990 Archived-At: On 11/03/2023 09:17 +0200, Eli Zaretskii wrote: >> From: Filipp Gunbin >> Cc: help-gnu-emacs@gnu.org, Philip Kaludercic , Eli >> Zaretskii >> Date: Sat, 11 Mar 2023 01:58:43 +0300 >> >> Yes, broken since 23b6cd41f55b833e8a562c51642d36b5211a510b, the patch is >> below. >> >> Eli, would this be OK for emacs-29? This is clearly a regression. > > It's a regression that existed since Emacs 28.1, right? So its fix > should try to avoid changing APIs. Therefore, please try to make a > change that leaves the signature of epa-ks--query-url unchanged, I > think it should be easy in this case. (Yes, I know it's an internal > function, but that doesn't mean we can change the signature when we > can avoid that.) Yes, since 28.1. The updated patch is below. But why an internal function is part of API? Don't we assume that anyone using them is doing so at their own risk? In this case the default for operation is "index" (to preserve compatibility), but it's better here to not have the default value at all. > P.S. And why are you posting patches and their discussion here, not on > the bug tracker? Because OP wrote here? And we didn't open a bug for this. Should we, even for such simple fixes? Thanks. 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 @@ epa-ks-do-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 @@ epa-ks--query-url (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 @@ epa-search-keys (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