From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.bugs Subject: bug#49926: [PATCH] Fix NNIMAP search command in the gnus Date: Sat, 06 Nov 2021 07:55:29 -0700 Message-ID: <87mtmh49lq.fsf@ericabrahamsen.net> References: <20210807045230.23998-1-jan@stranik.org> <87tuk097of.fsf@ericabrahamsen.net> <8735rjeqo5.fsf@stranik.org> <87eeb391qz.fsf@ericabrahamsen.net> <87ilx6aty0.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11501"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Jan Stranik , 49926@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 06 15:56:15 2021 Return-path: Envelope-to: geb-bug-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 1mjN75-0002d3-L2 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 06 Nov 2021 15:56:11 +0100 Original-Received: from localhost ([::1]:37114 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjN73-0005Lw-Ox for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 06 Nov 2021 10:56:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38966) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjN6w-0005Ix-NC for bug-gnu-emacs@gnu.org; Sat, 06 Nov 2021 10:56:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38576) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mjN6w-0004ss-Er for bug-gnu-emacs@gnu.org; Sat, 06 Nov 2021 10:56:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mjN6w-000739-5o for bug-gnu-emacs@gnu.org; Sat, 06 Nov 2021 10:56:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 06 Nov 2021 14:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49926 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch moreinfo Original-Received: via spool by 49926-submit@debbugs.gnu.org id=B49926.163621054027069 (code B ref 49926); Sat, 06 Nov 2021 14:56:02 +0000 Original-Received: (at 49926) by debbugs.gnu.org; 6 Nov 2021 14:55:40 +0000 Original-Received: from localhost ([127.0.0.1]:50122 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mjN6a-00072X-6w for submit@debbugs.gnu.org; Sat, 06 Nov 2021 10:55:40 -0400 Original-Received: from mail.ericabrahamsen.net ([52.70.2.18]:54878) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mjN6Y-00072K-Ef for 49926@debbugs.gnu.org; Sat, 06 Nov 2021 10:55:39 -0400 Original-Received: from localhost (c-71-197-232-156.hsd1.wa.comcast.net [71.197.232.156]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 1364EFA02C; Sat, 6 Nov 2021 14:55:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1636210531; bh=g9Kx6wPPuGVlLnbVo+JQBzOVN4r0Xv4WnKfL/vRX2yM=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=grOLiLHLDoLXLz3yUtLw0DrEHcHWPaUefkN3DcqZE+XdZ1bB5xr/za0hwhVGAoUVz g0buTUmZVBq/Shli7JqSrGVE2YN/6e8MKlFtC9tQl3tVjteA2prvGWNgDNbiF5FHMw CcDFKpF4hjwjyLMYsZZxpqlQ/AXXLnHEQcWxZfdY= In-Reply-To: <87ilx6aty0.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sat, 06 Nov 2021 03:39:35 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:219107 Archived-At: --=-=-= Content-Type: text/plain On 11/06/21 03:39 AM, Lars Ingebrigtsen wrote: > Eric Abrahamsen writes: > >> (Putting debbugs back in the cc) > > [...] > >>> New patch attached. > > The new version of the patch didn't make it to the bug tracker. Could > you re-send it, Jan? He sent that directly to me, attached here. I guess I don't see any problem with it. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Fix-NNIMAP-search-command-in-the-gnus.patch >From 7f877856766b3e6b668ce4dc52130a3367f5dc6f Mon Sep 17 00:00:00 2001 From: Jan Stranik Date: Sat, 7 Aug 2021 00:17:03 -0400 Subject: [PATCH] Fix NNIMAP search command in the gnus In the version 27.2 of emacs, the nnimap search commands stopped working in gnus. Good example is a command AT to find a referred thread in the summary buffer. The observed behaviour was that the search command returned no error. The problem turned out to be in the way how imap query is sent to the server. The function nnimap-make-thread-query used a format function with foramt specifier %S. For string values with formatting the string returned is in the format #("string" ....). The result was tha the query sent to the server looked like: 23:52:00 [stranik.org] 1980 UID SEARCH (OR HEADER REFERENCES #("<87pmurac3u.fsf@stranik.org>" 0 28 (ws-butler-chg chg)) HEADER Message-Id #("<87pmurac3u.fsf@stranik.org>" 0 28 (ws-butler-chg chg))) which is an invalid query. The change formats the string with %s specifier which discards text properties. --- lisp/gnus/nnimap.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index 3cf65453f3..6e3c411bf2 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -2295,11 +2295,11 @@ Return the server's response to the SELECT or EXAMINE command." ""))) (value (format - "(OR HEADER REFERENCES %S HEADER Message-Id %S)" + "(OR HEADER REFERENCES \"%s\" HEADER Message-Id \"%s\")" id id))) (dolist (refid refs value) (setq value (format - "(OR (OR HEADER Message-Id %S HEADER REFERENCES %S) %s)" + "(OR (OR HEADER Message-Id \"%s\" HEADER REFERENCES \"%s\") %s)" refid refid value))))) -- 2.31.1 --=-=-=--