Enable concatenation of search queries (split by " / ")#1537
Enable concatenation of search queries (split by " / ")#1537MaxGyver83 wants to merge 4 commits intopazz:masterfrom
Conversation
|
Hi @pazz , I don't think that Travis CI failed because of my PR. The job log says: |
|
This was an issue with notmuch master. It is fixed now.
Could you squash the two commits?
Quoting Max (2020-07-16 19:40:19)
… Hi @pazz , I don't think that Travis CI failed because of my PR. The job log
says:
./configure: 1558: ./configure: WITH_PYTHON_DOCS: parameter not set
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.*
|
7c20949 to
c0ca7f0
Compare
Sure, they are squashed now. |
|
@lucc: opinions? |
|
This is really wonky. It breaks my hooks (search returns double messages or no messages at all) and the result count is wrong. |
lucc
left a comment
There was a problem hiding this comment.
Is it possible to add some test for the new query syntax? I can imagine there are some corner cases that are worth testing (see inline comment).
| def get_lines(self): | ||
| return self.lines | ||
|
|
||
| def append(self, iterableWalker): |
There was a problem hiding this comment.
What happens if this is called after somebody started iterating over the IterableWalker already? Is that a case we have to think about? Even if this method is trivial it might be worth it to add a docstring to mention such constrains (if there are some).
There was a problem hiding this comment.
Good question. I'll try to test that case somehow.
@mmartin: Thanks for testing this PR. I have fixed the wrong result count. Could you give an example for a search that returns double messages? |
@mmartin: I could reproduce that behavior. Fixed in 5cf9bdf. |
|
I couldn't find any search related tests. Probably because you need real e-mails for that. |
|
I don't know if slash is a good query divider. Maybe the word |
|
I agree that adding tests should be good. Conceptually, what bugs me about this series is that it diverges from notmuch's query syntax, at least it looks like it does, which is something that I've so far tried to avoid. One way to get around that would be not to have a single "meta query" but something like the 'refine' command, which allows to stepwise append result lists for individual, valid notmuch queries. |
Sure, this sounds good to me. If I understand you right, you prefer something like |
|
I started working on the requested change and it looks like it's a big one! Adding a new command to For me it's okay to finish this task but first I want to check if you are okay with such extensive changes to the code. @pazz: What do you think about this? |
Implements #1536.
This PR enables the concatenation of two or more search queries. They will be split at ' / ' (a slash surrounded by spaces).
Example:
This gives you first all flagged e-mails, then all e-mails tagged inbox (not repeating the flagged ones).
Possible problem: I don't know how you would search for a string containing
' / '.