Gnus development mailing list
 help / color / mirror / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: ding@gnus.org
Subject: Re: Fixed bug with custom marks in registry
Date: Mon, 19 Nov 2018 15:51:51 -0800	[thread overview]
Message-ID: <878t1o8w2w.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <87lg5rlpde.fsf@web.de>

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> Right now the thing that makes the most sense to me is:
>>
>> 1. Make a new group parameter that matches the "display" parameter that
>>    you can set for individual groups. Ie, we'd have a
>>    `gnus-parameter-display-alist' variable.
>> 2. Allow that parameter to take more than just a number to display: it
>>    should be a list, and allow pre-set symbols (like 'registry-marked,
>>    'registry-precious), and maybe functions? I haven't thought it all
>>    the way through.
>> 3. Consult that parameter when constructing Summary buffers.
>>
>> How's that sound?
>
> I guess it makes sense.  I don't use Gnus parameters much.

They're pretty handy!

> The approach that came to my mind would be to just factor out common
> parts and provide them as predefined functions.  For example, we could
> provide
>
> #+begin_src emacs-lisp
> (defun gnus-alter-articles-to-read-create-function (f)
>   (lambda (group-name article-list)
>     (cl-union
>      (delq nil
>            (mapcar (lambda (id) (cdr (gnus-request-head id group-name)))
>                    (cl-loop for key being the hash-keys of (oref gnus-registry-db data)
>                             using (hash-values v)
>                             when (funcall f v)
>                             collect key))))))
> #+end_src
>
>
> and the user could do
>
> #+begin_src emacs-lisp
> (add-function
>  :around gnus-alter-articles-to-read-function
>  (defun my-gnus-to-read-add-marked (orig-f group-name article-list)
>    (cl-union (funcall (gnus-alter-articles-to-read-create-function
>                        (lambda (v) (cdr (assoc 'mark v))))
>                       group-name article-list)
>              (funcall orig-f group-name article-list))))
> #+end_src
>
> The advantage would be that this doesn't require knowledge about
> database internals, and would provide a maximum of configurability.

But this seems to require just enough knowledge of the database
internals (and Gnus internals) to be offputting to regular users, while
not saving expert users all that much effort.

> Would that approach be compatible with your proposal?

I guess what I want is an approach that works earlier in the process and
adds/filters efficiently, altering the list of articles to read *before*
requesting heads (or at least not requesting redundant heads then doing
`cl-union' afterwards), and also providing a list of no-brainer default
options.

Then `gnus-alter-articles-to-read-function' could be applied on top of
this, but it would be understood to be for expert users to do custom
tweaking with -- and probably not very performantly.

E




      reply	other threads:[~2018-11-19 23:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-11 18:26 Eric Abrahamsen
2018-10-11 18:44 ` Emanuel Berg
2018-10-11 21:00 ` Ted Zlatanov
2018-11-06  0:54 ` Michael Heerdegen
2018-11-06  4:56   ` Michael Heerdegen
2018-11-06  6:01   ` Eric Abrahamsen
2018-11-06 23:33     ` Michael Heerdegen
2018-11-07  5:00       ` Eric Abrahamsen
2018-11-17  0:32         ` Eric Abrahamsen
2018-11-17 15:01           ` Michael Heerdegen
2018-11-19 23:51             ` Eric Abrahamsen [this message]

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=878t1o8w2w.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --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).