From 3a7429456c41279c9872be7b2f98bb832ad00839 Mon Sep 17 00:00:00 2001 From: djcb Date: Mon, 9 May 2016 23:14:36 +0300 Subject: [PATCH] mu4e: parenthesize narrowing term When narrowing search results, parenthesize the narrowing term, so terms with AND/OR etc. don't lead to surprising results. Fixes #846. --- mu4e/mu4e-headers.el | 2 +- mu4e/mu4e.texi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mu4e/mu4e-headers.el b/mu4e/mu4e-headers.el index 65265e77..f45d7b4a 100644 --- a/mu4e/mu4e-headers.el +++ b/mu4e/mu4e-headers.el @@ -1381,7 +1381,7 @@ query (effectively, 'widen' it), with `mu4e-headers-query-prev'." (unless mu4e~headers-last-query (mu4e-warn "There's nothing to filter")) (mu4e-headers-search - (format "(%s) AND %s" mu4e~headers-last-query filter))) + (format "(%s) AND (%s)" mu4e~headers-last-query filter))) (defun mu4e-headers-change-sorting (&optional field dir) diff --git a/mu4e/mu4e.texi b/mu4e/mu4e.texi index 4ce797fd..3a4cb9ff 100644 --- a/mu4e/mu4e.texi +++ b/mu4e/mu4e.texi @@ -2021,7 +2021,7 @@ asks for an additional search pattern, which is appended to the current search query, in effect getting you the subset of the currently shown headers that also match this extra search pattern. @key{\} takes you back to the previous query, so, effectively 'widens' the search. Technically, narrowing the results -of query @t{x} with expression @t{y} implies doing a search @t{(x) AND y}. +of query @t{x} with expression @t{y} implies doing a search @t{(x) AND (y)}. Note that messages that were not in your original search results because of @code{mu4e-headers-results-limit} may show up in the narrowed query.