[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/gnus-search 9eebc88 21/30: More comments, small im
From: |
Eric Abrahamsen |
Subject: |
[Emacs-diffs] scratch/gnus-search 9eebc88 21/30: More comments, small improvements |
Date: |
Thu, 1 Jun 2017 03:50:23 -0400 (EDT) |
branch: scratch/gnus-search
commit 9eebc881e93033cb19b326e29926c9e7c407b927
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>
More comments, small improvements
* lisp/gnus/gnus-search.el (gnus-search-transform-expression): Handle
the 'body term.
(gnus-search-transform-expression): Interpret more terms as
"author", handle 'body.
---
lisp/gnus/gnus-search.el | 55 ++++++++++++++++++++++++++++--------------------
1 file changed, 32 insertions(+), 23 deletions(-)
diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el
index c23a0f8..d43b0dc 100644
--- a/lisp/gnus/gnus-search.el
+++ b/lisp/gnus/gnus-search.el
@@ -20,14 +20,17 @@
;;; Commentary:
-;; This file defines a generalized search query language, and search
-;; engines that interface with various search programs. It is
-;; responsible for parsing the user's input, querying the search
-;; engines, and collecting results. It relies on the nnselect backend
-;; to create summary buffers displaying those results.
-
-;; This file was formerly known as nnir. Later, nnir became nnselect,
-;; and only the search functionality was left here.
+;; This file defines a generalized search language, and search engines
+;; that interface with various search programs. It is responsible for
+;; parsing the user's search input, sending that query to the search
+;; engines, and collecting results. Results are in the form of a
+;; vector of vectors, each vector representing a found article. The
+;; nnselect backend interprets that value to create a group containing
+;; the search results.
+
+;; This file was formerly known as nnir. Later, the backend parts of
+;; nnir became nnselect, and only the search functionality was left
+;; here.
;; See the Gnus manual for details of the search language. Tests are
;; in tests/gnus-search-test.el.
@@ -43,19 +46,20 @@
;; The general flow is:
-;; 1. The user calls one of `gnus-group-make-search-group',
-;; `gnus-group-make-permanent-search-group', or
-;; `gnus-group-make-preset-search-group'. These functions prompt for
-;; a search query, then create an nnselect group where the function is
-;; `gnus-search-run-query', and the args are the unparsed search
-;; query, and the groups to search.
-
-;; 2. `gnus-search-run-query' looks at the groups to search,
-;; categorizes them by server, and for each server finds the search
-;; engine to use. Each engine is then called using the generic method
-;; `gnus-search-run-search', with the query and groups passed as
-;; arguments, and the results collected and handed off to the nnselect
-;; group.
+;; 1. The user calls one of `gnus-group-make-search-group' or
+;; `gnus-group-make-permanent-search-group' (or a few other entry
+;; points). These functions prompt for a search query, and collect
+;; the groups to search, then create an nnselect group, setting an
+;; 'nnselect-specs group parameter where 'nnselect-function is
+;; `gnus-search-run-query', and 'nnselect-args is the search query and
+;; groups to search.
+
+;; 2. `gnus-search-run-query' is called with 'nnselect-args. It looks
+;; at the groups to search, categorizes them by server, and for each
+;; server finds the search engine to use. It calls each engine's
+;; `gnus-search-run-search' method with the query and groups passed as
+;; arguments, and the results are collected and handed off to the
+;; nnselect group.
;; For information on writing new search engines, see the Gnus manual.
@@ -1575,6 +1579,8 @@ absolute filepaths to standard out."
(cond
((listp (car expr))
(format "(%s)" (gnus-search-transform engine expr)))
+ ((eql (car expr) 'body)
+ (cadr expr))
;; I have no idea which fields namazu can handle. Just do these
;; for now.
((memq (car expr) '(subject from to))
@@ -2048,8 +2054,11 @@ Assume \"size\" key is equal to \"larger\"."
(cl-defmethod gnus-search-transform-expression ((_e gnus-search-gmane)
(expr list))
"The only keyword value gmane can handle is author, ie from."
- (when (memq (car expr) '(from sender author address))
- (format "author:%s" (cdr expr))))
+ (cond
+ ((memq (car expr) '(from sender author address))
+ (format "author:%s" (cdr expr)))
+ ((eql (car expr) 'body)
+ (cdr expr))))
;;; Util Code:
- [Emacs-diffs] scratch/gnus-search 32a328f 17/30: Fix for parsing delimited strings, (continued)
- [Emacs-diffs] scratch/gnus-search 32a328f 17/30: Fix for parsing delimited strings, Eric Abrahamsen, 2017/06/01
- [Emacs-diffs] scratch/gnus-search b086d9a 07/30: Handle regexp and wildcard search terms, Eric Abrahamsen, 2017/06/01
- [Emacs-diffs] scratch/gnus-search a4fe929 18/30: Notmuch query transformation improvements, Eric Abrahamsen, 2017/06/01
- [Emacs-diffs] scratch/gnus-search 2ae2549 24/30: Fix bum namazu search command, Eric Abrahamsen, 2017/06/01
- [Emacs-diffs] scratch/gnus-search 37e044f 19/30: Don't do any sorting at all in gnus-search, Eric Abrahamsen, 2017/06/01
- [Emacs-diffs] scratch/gnus-search 9c57f16 15/30: Some refactoring of gnus-search-run-query, Eric Abrahamsen, 2017/06/01
- [Emacs-diffs] scratch/gnus-search 09aff52 26/30: Do result limiting in the indexed engine process, Eric Abrahamsen, 2017/06/01
- [Emacs-diffs] scratch/gnus-search 371748d 22/30: Switch base massage-output method for indexed search engines, Eric Abrahamsen, 2017/06/01
- [Emacs-diffs] scratch/gnus-search 6a4dc13 09/30: WIP on documentation, Eric Abrahamsen, 2017/06/01
- [Emacs-diffs] scratch/gnus-search 79b5546 25/30: Add gnus-search-grep abstract engine, Eric Abrahamsen, 2017/06/01
- [Emacs-diffs] scratch/gnus-search 9eebc88 21/30: More comments, small improvements,
Eric Abrahamsen <=
- [Emacs-diffs] scratch/gnus-search e39079c 08/30: Remove Hyrex search engine, Eric Abrahamsen, 2017/06/01
- [Emacs-diffs] scratch/gnus-search fcf327b 10/30: Add Mairix search engine, Eric Abrahamsen, 2017/06/01
- [Emacs-diffs] scratch/gnus-search 7f21251 29/30: Don't parse the address: key, Eric Abrahamsen, 2017/06/01
- [Emacs-diffs] scratch/gnus-search 64bf8de 27/30: Messed up rebase, Eric Abrahamsen, 2017/06/01
- [Emacs-diffs] scratch/gnus-search 8ea8644 23/30: Refactor parsing of indexed search engine output, Eric Abrahamsen, 2017/06/01
- [Emacs-diffs] scratch/gnus-search a43c410 13/30: Refactor parsing/no parsing of queries, Eric Abrahamsen, 2017/06/01
- [Emacs-diffs] scratch/gnus-search a1cfb38 01/30: WIP on a generalized search query language for Gnus, Eric Abrahamsen, 2017/06/01
- [Emacs-diffs] scratch/gnus-search 66a7735 20/30: WIP on rebase, Eric Abrahamsen, 2017/06/01
- [Emacs-diffs] scratch/gnus-search 9965b9b 28/30: Restore IMAP ability to short-circuit message-id searches, Eric Abrahamsen, 2017/06/01
- [Emacs-diffs] scratch/gnus-search 039df5e 30/30: Provide a bit more backward-compatibility, Eric Abrahamsen, 2017/06/01