From: Austin Clements <amdragon@MIT.EDU>
To: Tomi Ollila <tomi.ollila@iki.fi>, notmuch@notmuchmail.org
Subject: Re: [PATCH 0/2] Escape message ID queries in Emacs
Date: Tue, 27 Mar 2012 03:01:52 -0400 [thread overview]
Message-ID: <87aa32h6hr.fsf@awakening.csail.mit.edu> (raw)
In-Reply-To: <m2sjgutuck.fsf@guru.guru-group.fi>
On Tue, 27 Mar 2012, Tomi Ollila <tomi.ollila@iki.fi> wrote:
> On Tue, Mar 27 2012, Austin Clements wrote:
>
>> Currently, Emacs does not escape message ID queries and is
>> inconsistent about quoting them. This patch centralizes this in one
>> function that always produces a properly quoted and escaped message ID
>> query.
>>
>> With this, Emacs no longer gets confused by Tomi's crazy message,
>> id:"id:""1332281811-24710-2b-git-send-email-tomi.ollila@iki.fi"""
>
> LGTM. Things work!
>
>
> One observation, though:
>
> In search bar the following queries return one match:
>
> id:id:"1332281811-24710-2b-git-send-email-tomi.ollila@iki.fi"
> id:"id:""1332281811-24710-2b-git-send-email-tomi.ollila@iki.fi"""
>
> but
>
> id:"id:"1332281811-24710-2b-git-send-email-tomi.ollila@iki.fi""
>
> return 0 matches.
>
> It looks like the (above) search strings goes verbatim to command line
>
> i.e. 'notmuch' 'search' '--sort=oldest-first' 'id:...'
>
> can be used to compare... so that would be CLI issue if there
> is ever need to do do anything with it.
I'm not sure I would consider this a CLI "issue". It may not be
intuitive, but it is an intentional part of the Xapian query parser's
grammar. If a boolean prefix is followed immediately by a quote, then
the term is between that quote and the next quote, modulo an escaping
rule that lets you include a literal quote in the term by doubling it in
the query string. Together, these rules let you reliably put anything
in a boolean search term.
> +1
>
> Thanks for fixing this.
>
> Tomi
next prev parent reply other threads:[~2012-03-27 7:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-27 1:37 [PATCH 0/2] Escape message ID queries in Emacs Austin Clements
2012-03-27 1:37 ` [PATCH 1/2] test: Add Emacs test for messages with quotes in their message ID Austin Clements
2012-03-27 1:37 ` [PATCH 2/2] emacs: Escape all message ID queries Austin Clements
2012-03-27 6:45 ` [PATCH 0/2] Escape message ID queries in Emacs Tomi Ollila
2012-03-27 7:01 ` Austin Clements [this message]
2012-03-29 1:49 ` Jameson Graef Rollins
2012-03-31 0:31 ` David Bremner
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
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87aa32h6hr.fsf@awakening.csail.mit.edu \
--to=amdragon@mit.edu \
--cc=notmuch@notmuchmail.org \
--cc=tomi.ollila@iki.fi \
/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.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.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).