From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jan Stranik via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#49926: [PATCH] Fix NNIMAP search command in the gnus Date: Sat, 7 Aug 2021 00:52:30 -0400 Message-ID: <20210807045230.23998-1-jan@stranik.org> Reply-To: Jan Stranik Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19808"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Jan Stranik To: 49926@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 07 15:49:42 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 1mCMhq-0004zJ-2y for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 07 Aug 2021 15:49:42 +0200 Original-Received: from localhost ([::1]:50620 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mCMhp-0007FJ-2V for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 07 Aug 2021 09:49:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43040) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mCMhC-0005tl-H2 for bug-gnu-emacs@gnu.org; Sat, 07 Aug 2021 09:49:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40639) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mCMhC-0002H7-9g for bug-gnu-emacs@gnu.org; Sat, 07 Aug 2021 09:49:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mCMhC-0005it-3E for bug-gnu-emacs@gnu.org; Sat, 07 Aug 2021 09:49:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jan Stranik Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 07 Aug 2021 13:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 49926 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.162834411221946 (code B ref -1); Sat, 07 Aug 2021 13:49:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 7 Aug 2021 13:48:32 +0000 Original-Received: from localhost ([127.0.0.1]:52183 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mCMgf-0005hn-15 for submit@debbugs.gnu.org; Sat, 07 Aug 2021 09:48:32 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:48556) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mCEK9-0003uj-4g for submit@debbugs.gnu.org; Sat, 07 Aug 2021 00:52:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33308) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mCEK8-0003rq-9N for bug-gnu-emacs@gnu.org; Sat, 07 Aug 2021 00:52:40 -0400 Original-Received: from stranik.org ([95.216.183.163]:45407) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mCEK6-0008A1-ON for bug-gnu-emacs@gnu.org; Sat, 07 Aug 2021 00:52:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=stranik.org ; s=2020nix; h=Subject:To:From; bh=7nYLKAN90IFFejvaujiKefXlDGmkS9ekcwK2MXIIEDw=; b=ds2lCV1vL9js6ODLqAvrxUnYEz Uk8HXMjr+4w2IzZ0SaCB0HrkqNKTd9CY8IIp4RXqcrchZ1m5C71GbqD5Yd1KHSgpofvu9AUmRgQmH YihnKF3q0C+vz4dnTSbYbzCFX4AtD34YjZT1eGeSiiHm6FQ8w0A7IGwloi2AVwPXPw5Y=; Original-Received: from ool-2f14047c.dyn.optonline.net ([47.20.4.124] helo=localhost) by stranik.org with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mCEK0-0005oV-8H; Sat, 07 Aug 2021 04:52:32 +0000 X-Mailer: git-send-email 2.31.1 Received-SPF: pass client-ip=95.216.183.163; envelope-from=jan@stranik.org; helo=stranik.org X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sat, 07 Aug 2021 09:48:26 -0400 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:211379 Archived-At: 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..33bd6ee5a8 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