Gnus development mailing list
 help / color / mirror / Atom feed
From: Andrew Cohen <acohen@ust.hk>
To: ding@gnus.org
Subject: Re: useful things with nnselect
Date: Wed, 09 Sep 2020 14:41:14 +0800	[thread overview]
Message-ID: <87eenblaet.fsf@ust.hk> (raw)
In-Reply-To: <87blifpixx.fsf@ucl.ac.uk>

>>>>> "ESF" == Eric S Fraga <e.fraga@ucl.ac.uk> writes:

[...]

    ESF> Thank you for this.  Very interesting.  I have a setup that has
    ESF> some similarity to yours, but obviously without using nnselect:
    ESF> using virtual groups and some splitting.  I will check nnselect
    ESF> out.

Before nnselect that is probably very similar to what I did. With
nnselect I can be much more fine-grained than I can with splitting and
combining, and I can do it on the fly. Let me know how it goes and if
you need any tips.

Oh, forgot to mention that (not surprisingly) nnselect can replace
nnvirtual. You just make an nnselect group with an nnselect-function
like the following (just hacked this together but it worked in one
simple test :)) and nnselect-args containing the groups you want to
combine:

(defun my-virtual (groups)
    (let ((limit 1000))
      (apply #'vconcat
	     (mapcar
	      #'(lambda (group)
		  (pcase-let ((`(,min . ,max) (gnus-active group))
			      (value))
		    (when (> (- max min) limit) (setq min (- max limit)))
		    (dotimes (number (1+ (- max min)) value)
		      (push  (vector group (+ min number) 1)
			     value))
		    (nreverse value)))
	      groups))))

(I have put an artificial limit on the size of the group since some of
my groups have hundreds of thousands of messages, and loading this many
headers is unbearably slow. But you can easily increase this beyond 1000
without too much trouble). 



  reply	other threads:[~2020-09-09  6:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-08  1:41 Andrew Cohen
2020-09-09  3:05 ` Eric Abrahamsen
2020-09-09  3:26   ` Andrew Cohen
2020-09-09 18:12     ` Eric Abrahamsen
2020-09-09  6:23 ` Eric S Fraga
2020-09-09  6:41   ` Andrew Cohen [this message]
2020-09-09 11:31     ` Eric S Fraga
2020-09-11  0:00       ` Andrew Cohen
2020-09-11  8:25         ` Eric S Fraga

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87eenblaet.fsf@ust.hk \
    --to=acohen@ust.hk \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).