-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable concatenation of search queries (split by " / ") #1537
base: master
Are you sure you want to change the base?
Enable concatenation of search queries (split by " / ") #1537
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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).
@@ -92,3 +97,6 @@ def _get_next_item(self): | |||
|
|||
def get_lines(self): | |||
return self.lines | |||
|
|||
def append(self, iterableWalker): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pazz LGTM. I would be happy if we can have some tests for this. But if you want to push this PR you can "overrule" this request for tests :)
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
' / '
.