unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#49926: [PATCH] Fix NNIMAP search command in the gnus
@ 2021-08-07  4:52 Jan Stranik via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-08-07 23:06 ` Eric Abrahamsen
  0 siblings, 1 reply; 7+ messages in thread
From: Jan Stranik via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-08-07  4:52 UTC (permalink / raw)
  To: 49926; +Cc: Jan Stranik

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






^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-11-06 19:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-07  4:52 bug#49926: [PATCH] Fix NNIMAP search command in the gnus Jan Stranik via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-08-07 23:06 ` Eric Abrahamsen
     [not found]   ` <8735rjeqo5.fsf@stranik.org>
2021-08-08 19:26     ` Eric Abrahamsen
2021-11-06  2:39       ` Lars Ingebrigtsen
2021-11-06 14:55         ` Eric Abrahamsen
2021-11-06 18:26           ` Lars Ingebrigtsen
2021-11-06 19:14             ` Eric Abrahamsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).