Gnus development mailing list
 help / color / mirror / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: Eric Abrahamsen <eric@ericabrahamsen.net>
Cc: ding@gnus.org
Subject: Re: Fixed bug with custom marks in registry
Date: Sat, 17 Nov 2018 16:01:33 +0100	[thread overview]
Message-ID: <87lg5rlpde.fsf@web.de> (raw)
In-Reply-To: <87wopch7bi.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Fri, 16 Nov 2018 16:32:49 -0800")

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.

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.

Would that approach be compatible with your proposal?


Michael.



  reply	other threads:[~2018-11-17 15:01 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 [this message]
2018-11-19 23:51             ` Eric Abrahamsen

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=87lg5rlpde.fsf@web.de \
    --to=michael_heerdegen@web.de \
    --cc=ding@gnus.org \
    --cc=eric@ericabrahamsen.net \
    /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).