Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: info-gnus-english@gnu.org
Subject: Re: How to search for ticked articles
Date: Sat, 21 Oct 2023 12:03:04 -0700	[thread overview]
Message-ID: <87edhn6bo7.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <87il702gso.fsf@free.fr>

Julien Cubizolles <j.cubizolles@free.fr> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> Julien Cubizolles <j.cubizolles@free.fr> writes:
>>
>>> I used to use the "mark:flag" search query to look for ticked articles
>>> with gnus-search. I recently noticed that it doesn't return any articles
>>> anymore in groups with ticked articles.
>>>
>>> What exactly does the "flag" mark represent, and is there a better way
>>> to look for dormant or ticked articles ?
>>
>> These things are all search-engine dependent. Notmuch will turn
>> "mark:flag" into "tag:flag", and IMAP will turn it into "FLAGGED".
>>
>> What search engine are you using in this case? The first thing to try
>> is always shutting off search parsing (either fully, by setting
>> `gnus-search-use-parsed-queries' to nil, or temporarily, using the
>> prefix argument). Then get the search working using the search engine's
>> native syntax. Then come back here and tell me how it went :)
>
> I'm using the imap search engine. When I shut off search parsing,
> the "FLAGGED" search query does indeed return the ticked articles, when
> "mark:flag" didn't. But I tried again (with search parsing on) with the
> query "mark:flagged" and it works ! 

Hmm, that doesn't seem right; you can see that both "mark:flag" and
"mark:flagged" get transformed into the same IMAP search term, namely
"FLAGGED".

(let ((srv (make-instance 'gnus-search-imap))
      (flag (gnus-search-parse-query "mark:flagged"))
      (flagged (gnus-search-parse-query "mark:flag")))
  (format
   "%s == %s"
   (gnus-search-transform srv flag)
   (gnus-search-transform srv flagged))) => "FLAGGED == FLAGGED"

I just tried it with an IMAP server, and all of "mark:flag",
"mark:flagged", and "mark:!" were transformed into "FLAGGED" and
produced the right search results.

If you have a moment, you could try edebugging the
`gnus-search-imap-search-command' function, and seeing what's happening
there. The QUERY parameter should already be "FLAGGED" at that point.

Thanks,
Eric



  reply	other threads:[~2023-10-21 19:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-20  9:02 Julien Cubizolles
2023-10-20 14:46 ` Eric Abrahamsen
2023-10-21 14:25   ` Julien Cubizolles
2023-10-21 19:03     ` Eric Abrahamsen [this message]
2023-10-22 14:32     ` Julien Cubizolles
2023-10-23 14:19       ` Eric Abrahamsen
2023-10-24  8:05         ` Julien Cubizolles

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87edhn6bo7.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=info-gnus-english@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).