From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/87477 Path: news.gmane.org!.POSTED!not-for-mail From: Andrew Cohen Newsgroups: gmane.emacs.gnus.general Subject: Testers wanted: New gnus backend nnselect Date: Mon, 24 Apr 2017 11:02:13 +0800 Organization: Boston University Message-ID: <87pog233uy.fsf@hanan> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1493002995 24307 195.159.176.226 (24 Apr 2017 03:03:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 24 Apr 2017 03:03:15 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) To: ding@gnus.org Original-X-From: ding-owner+m35695@lists.math.uh.edu Mon Apr 24 05:03:12 2017 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from mxfilter-048034.atla03.us.yomura.com ([107.189.48.34]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d2UHO-0006Bz-L6 for ding-account@gmane.org; Mon, 24 Apr 2017 05:03:10 +0200 X-Yomura-MXScrub: 1.0 Original-Received: from lists1.math.uh.edu (unknown [129.7.128.208]) by mxfilter-048034.atla03.us.yomura.com (Halon) with ESMTPS id 8eab0313-289a-11e7-8ed1-b499baa2b07a; Mon, 24 Apr 2017 03:03:14 +0000 (UTC) Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by lists1.math.uh.edu with smtp (Exim 4.87) (envelope-from ) id 1d2UGn-0006fv-Jr; Sun, 23 Apr 2017 22:02:33 -0500 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by lists1.math.uh.edu with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87) (envelope-from ) id 1d2UGk-0006fL-3U for ding@lists.math.uh.edu; Sun, 23 Apr 2017 22:02:30 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtps (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.87) (envelope-from ) id 1d2UGi-0006ma-Pk for ding@lists.math.uh.edu; Sun, 23 Apr 2017 22:02:29 -0500 Original-Received: from [195.159.176.226] (helo=blaine.gmane.org) by quimby.gnus.org with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1d2UGh-0006fA-AX for ding@gnus.org; Mon, 24 Apr 2017 05:02:27 +0200 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1d2UGa-00059f-4X for ding@gnus.org; Mon, 24 Apr 2017 05:02:20 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 113 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:3nBxZ7To3Ywy4+I52PVpFLGcSPA= List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:87477 Archived-At: 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 ())) Replace 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