From: Austin Clements <amdragon@MIT.EDU>
To: Pieter Praet <pieter@praet.org>
Cc: Notmuch Mail <notmuch@notmuchmail.org>
Subject: Re: [PROTO] possible solution for "Race condition for '*' command"
Date: Mon, 04 Jul 2011 13:56:26 -0400 [thread overview]
Message-ID: <e8c5fbf4-4dfa-461a-8f5c-6c696291a270@email.android.com> (raw)
In-Reply-To: <1309762318-4530-1-git-send-email-pieter@praet.org>
[-- Attachment #1: Type: text/plain, Size: 2042 bytes --]
Ah, this is subtler than I thought. You're right that, for the '*' command, you want only the matched ID's. Tagging a region, however, operates on entire threads. I think it's important to retain this behavior because threads are what the user sees and selects in the search buffer (*, on the other hand, doesn't have a strong visual analogue).
(This also means * is not, in fact, equivalent to expanding the region the the entire buffer and then tagging the region.)
I should probably emit two lists per thread: one of matched IDs and one of unmatched IDs. Tagging a region can then operate on the concatenation of these, while * can operate only on the matched lists. This should be easy to do. I'll send an updated patch when I'm back at a computer.
--
Sent from my Android. Please excuse my brevity.
Pieter Praet <pieter@praet.org> wrote:
Thanks Austin!
Unfortunately, your patch causes *all* Message-Id's in the thread to be
appended, as opposed to only the ones matching the query:
#+BEGIN_EXAMPLE
$ notmuch search tag:inbox AND from:amdragon@mit.edu
thread:0000000000002777 Yest. 19:17 [1/3] Austin Clements| Pieter Praet;
[PATCH 2/2] [RFC] possible solution for "Race condition for '*' command"
(inbox replied sent to-me x/notmuch)
id:"CAH-f9WticM4EN8F1_ik_-mcBcBtrXwSpO+Drbtp7=UN7McECrg@mail.gmail.com"
or id:"87zkkwydag.fsf@praet.org" or id:"20110703171743.GL15901@mit.edu"
#+END_EXAMPLE
As you can see, according to matched/total ("[1/3]") only a single
message matches the query, yet all 3 MsgId's are returned.
If this were to be corrected (probably a trivial change, but I'm pretty
much oblivious as to the what and where of it), the following patch
series should work as intended.
The "--stdin" option works as expected (and ARG_MAX is indeed a very
valid concern with this particular use case), but I haven't yet gotten
around to making use of it from the Emacs UI as this would require some
screwing around with `notmuch-tag' and `notmuch-call-notmuch-process',
and it's still pretty early I-).
Peace
--
Pieter
[-- Attachment #2: Type: text/html, Size: 2575 bytes --]
next prev parent reply other threads:[~2011-07-04 17:56 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-01 16:37 [PATCH 2/2] [RFC] possible solution for "Race condition for '*' command" Austin Clements
2011-07-02 14:20 ` Pieter Praet
2011-07-03 17:17 ` Austin Clements
2011-07-04 6:51 ` [PROTO] " Pieter Praet
2011-07-04 6:51 ` [PATCH 1/5] emacs: add property "matched-msgids" to each search result Pieter Praet
2011-07-04 6:51 ` [PATCH 2/5] emacs: add some functions to fetch the matched-msgids of a (region of) search result(s) Pieter Praet
2011-07-04 6:51 ` [PATCH 3/5] emacs: stashing (a region of) matched-msgids Pieter Praet
2011-07-04 6:51 ` [PATCH 4/5] test: emacs: add/remove tags from all matching messages with `notmuch-search-operate-all' Pieter Praet
2011-07-04 6:51 ` [PATCH 5/5] emacs: make `notmuch-search-operate-all' use matched-msgids instead of the original query string Pieter Praet
2011-07-04 17:56 ` Austin Clements [this message]
2011-07-04 18:48 ` [PROTO] possible solution for "Race condition for '*' command" Pieter Praet
2011-07-05 19:04 ` Pieter Praet
2011-07-05 21:42 ` Austin Clements
2011-07-10 14:11 ` [PATCH] emacs: bad regexp @ `notmuch-search-process-filter' Pieter Praet
2011-07-11 20:43 ` [PATCH v2] " Pieter Praet
2011-07-11 21:05 ` Austin Clements
2011-07-13 14:16 ` Pieter Praet
2011-07-13 14:47 ` David Edmondson
2011-07-13 18:57 ` Austin Clements
2011-07-16 15:07 ` Pieter Praet
2011-07-20 4:50 ` servilio
2011-07-20 20:50 ` JSON parsing performance (was Re: [PATCH v2] emacs: bad regexp @ `notmuch-search-process-filter') Austin Clements
2011-08-12 8:07 ` [PATCH v2] emacs: bad regexp @ `notmuch-search-process-filter' Sebastian Spaeth
2011-08-12 8:28 ` Austin Clements
2011-08-03 20:47 ` [PROTO] possible solution for "Race condition for '*' command" Austin Clements
2011-08-03 21:42 ` Jameson Graef Rollins
2011-08-03 22:21 ` Austin Clements
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=e8c5fbf4-4dfa-461a-8f5c-6c696291a270@email.android.com \
--to=amdragon@mit.edu \
--cc=notmuch@notmuchmail.org \
--cc=pieter@praet.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.
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).