Gnus development mailing list
 help / color / mirror / Atom feed
* Testers wanted: New gnus backend nnselect
@ 2017-04-24  3:02 Andrew Cohen
  2017-04-24 20:52 ` Eric Abrahamsen
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Andrew Cohen @ 2017-04-24  3:02 UTC (permalink / raw)
  To: ding



TLDR: Please test the new feature found on the git repository at
feature/gnus-select.

As you may have seen from some posts from me earlier, I have implemented
a new backend in gnus (nnselect) that allows an arbitrary list of
messages to form a group. Such groups can be ephemeral, or they can be
permanent (with all the rights and responsibilities of permanent
groups.) These messages can be from multiple "real" groups, on multiple
servers, and multiple backend types. (For example I have created groups
including messages from 2 different imap servers and several gmane
groups).  This works especially well (but is not limited to) searching.

Here are some examples of a few permanent groups that I use:

1. All messages received (on 3 different imap servers) in the last 2
   days.
2. All flagged messages (on 2 different imap servers)
3. All unseen messages (on 3 different imap servers)
4. All messages from some domain.
5. A list of "exceptional" messages that I just want to keep together in
   a prominent place.

and I'm sure you get the idea.

I have been using much of this code for several years, but only recently
put aside the time to clean it up a bit, and add some missing
functionality. Its a pretty invasive change to gnus so it needs
testing before pushing it to the main repository.

Why is it invasive? It is a generalization of the code I wrote many
years ago re-working the nnir backend. Consequently in this new format
nnir has CEASED to be a backend and is now just some code for searching
indices. Searching in gnus now works by creating an ephemeral nnselect
group where the list of articles is obtained from nnir.

I have so far mostly tested this with imap. Since it is essentially
backend independent it should just work, but this needs to be tested.

So please, please, give it some testing. The new code can be found in a
branch, feature/gnus-select, in the emacs git repository. Just check it
out, make, and give it a whirl.

Ideally if you just continue searching as you have always done you won't
notice much of a difference (except that referring threads is a bit
different---more on that later). This is the first thing that needs
testing.

Once you are confident that this is working you can try new
things. Firstly make some permanent nnselect groups. You do this as you
would for any group: start with "G m" (gnus-group-make-group) from the
Group buffer; give it a name; choose the method "nnselect"; it will then
query for a function; and then an argument. The function will be applied
to the argument (with funcall) to generate the list of articles. A good
choice for the function is nnir-run-query, and the argument can be an
appropriate search query (some examples below). It can also be any
function that returns a vector, each entry of which is a 3-vector formed
from [Group, Number, Score] (the group containing the actual article;
the number of the article in that group; a score, which is supposed to
help in sorting but is largely unused at this point---just set it to 1
if you are unsure). So for a silly example the function could be the
identity, and the arg this vector.

Here are some ready-made functions and args (sorry for the arcane
input---this will get simplified later):

function: nnir-run-query
args: ((nnir-query-spec
       (query . "FLAGGED")
       (criteria . ""))
      (nnir-group-spec
       (<server>)))

Replace <server> with the server you want to search in double quotes
(e.g. "nnimap:junk"). If you want to restrict to some groups or use
multiple servers see the front-matter in nnir.el for the syntax of
nnir-group-spec.

(NB: Inputting this from the minibuffer can be a pain. You can always
edit it later in the group parameters by using, e.g., "G p" on a group
line in the Group buffer.)

Here is a function for taking a number of days and performing a search
for articles from the past days on a couple of imap servers:

(defun my-recent-email (days)
  (let ((query-spec
         (list
          (cons 'query
                (format-time-string "SINCE %d-%b-%Y"
                                    (time-subtract (current-time)
                                                   (days-to-time days))))
          (cons 'criteria "")))
        (group-spec  (list (list "nnimap:server1") (list "nnimap:server2"))))
    (nnir-run-query   (cons 'nnir-specs
                            (list (cons 'nnir-query-spec query-spec)
                                  (cons 'nnir-group-spec group-spec))))))

To use it make an nnselect group with

Function: my-recent-email
Arg: 2

or change the 2 to however many days you prefer.


OK, this is long enough. I'll send a subsequent email with more info,
but let me know if you need assistance.

Best,
Andy





^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-04-11 19:44 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-24  3:02 Testers wanted: New gnus backend nnselect Andrew Cohen
2017-04-24 20:52 ` Eric Abrahamsen
2017-04-25  0:09   ` Andrew Cohen
2017-04-25  1:01     ` Andrew Cohen
2017-04-25 15:33     ` Eric Abrahamsen
2017-04-27 16:03 ` Harry Putnam
2017-04-27 18:24   ` Eric Abrahamsen
2017-04-28 14:53     ` Harry Putnam
2017-04-28 15:23       ` Eric Abrahamsen
2017-04-28 15:44         ` Harry Putnam
     [not found] ` <8eff03d9274e4d0fa58c85a87381706f@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
     [not found]   ` <87vapp6izc.fsf@delle7240>
2017-04-28 15:34     ` Eric Abrahamsen
2018-04-11 19:44 ` Lars Ingebrigtsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).