diff options
author | Eric Abrahamsen <eric@ericabrahamsen.net> | 2018-11-19 10:03:16 -0800 |
---|---|---|
committer | Eric Abrahamsen <eric@ericabrahamsen.net> | 2018-11-21 08:38:37 -0800 |
commit | e01d030723aef2f90a2fc53a0b5251f29df94527 (patch) | |
tree | 0a96b35f32c45951c8e1e5ce9479bab8960ce913 /lisp/gnus/nnir.el | |
parent | d15d72b27de3db2f7e49398c7d3da9465b774398 (diff) | |
download | emacs-e01d030723aef2f90a2fc53a0b5251f29df94527.tar.gz |
Fix "Allow use of Gnus search groups as notmuch path: search term"
* lisp/gnus/nnir.el (nnir-notmuch-filter-group-names-function):
Default to nil -- getting correct behavior requires user
intervention too often to have this enabled by default.
* lisp/gnus/nnir.el (nnir-run-notmuch): If the user has turned this
on, then also hardcode `gnus-group-short-name' as a filter -- things
will never work without it. Also move leading space to before the
opening parenthesis.
* doc/misc/gnus.texi: Document option.
(Bug#33122)
Diffstat (limited to 'lisp/gnus/nnir.el')
-rw-r--r-- | lisp/gnus/nnir.el | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/lisp/gnus/nnir.el b/lisp/gnus/nnir.el index ea7257d0c9b..084b154e8a1 100644 --- a/lisp/gnus/nnir.el +++ b/lisp/gnus/nnir.el @@ -518,18 +518,16 @@ that it is for notmuch, not Namazu." :type '(regexp) :group 'nnir) -(defcustom nnir-notmuch-filter-group-names-function - #'gnus-group-short-name +(defcustom nnir-notmuch-filter-group-names-function nil "Whether and how to use Gnus group names as \"path:\" search terms. When nil, the groups being searched in are not used as notmuch :path search terms. It's still possible to use \"path:\" terms manually within the search query, however. -When a function, map this function over all the group names. By -default this runs them through `gnus-group-short-name', and it is -recommended to use this transform, at least. Further -transforms (for instance, converting \".\" to \"/\") can be -added like so: +When a function, map this function over all the group names. To +use the group names unchanged, set to (lambda (g) g). Multiple +transforms (for instance, converting \".\" to \"/\") can be added +like so: \(add-function :filter-return nnir-notmuch-filter-group-names-function @@ -1541,14 +1539,15 @@ construct path: search terms (see the variable ":[0-9]+" "^[0-9]+$")) (groups (when nnir-notmuch-filter-group-names-function - (mapcar nnir-notmuch-filter-group-names-function - groups))) + (delq nil + (mapcar nnir-notmuch-filter-group-names-function + (mapcar #'gnus-group-short-name groups))))) (pathquery (when groups - (concat "(" - (mapconcat (lambda (g) - (format " path:%s" g)) - groups " or") - ")"))) + (concat " (" + (mapconcat (lambda (g) + (format "path:%s" g)) + groups " or") + ")"))) artno dirnam filenam) (when (equal "" qstring) |