Xapian-quoting based batch-tagging.
David Bremner
david at tethera.net
Wed Dec 26 05:23:00 PST 2012
Mark Walters <markwalters1009 at gmail.com> writes:
> I am unclear about how this is going to deal with queries containing
> newlines. For dump/restore I think this is not a problem (as Austin and
> others have said), but for batch tagging I think it could be; for
> example the query could be for a tag containing a newline.
Yes, that's true, this patch series does not support queries with tags
with embedded newlines. They can still be removed (and added) via either
batch tagging or the command line. We could just live with this, or
- The current syntax allows for detecting options at the start of the
line; perhaps a future fix would be to have the batch tagging and
command line tagging accept an optionally hex encoded query, something
like:
--hex +found%20it -- tag:%22stupid%0Atag%22
- Alternatively, we could add hex decoding on top of xapian quoting for
queries. One UI downside is that people have to remember that % are
special.
+found%25it -- tag:lost%25it
Another is that quoting is still (surprisingly) necessary for encoded
spaces
+found%20it -- tag:"lost%20it"
Introducing yet another escape format, e.g. "\n" would require more
code, and not really much benefit afaict versus re-using hex-encoding.
Offhand I don't see how to avoid this without some level of query
pre-processing a-la
id:1356313183-9266-1-git-send-email-david at tethera.net
d
More information about the notmuch
mailing list