Gnus development mailing list
 help / color / mirror / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: ding@gnus.org
Subject: Re: gnus-group-change-level
Date: Thu, 22 Feb 2024 09:13:10 -0800	[thread overview]
Message-ID: <87y1bch17d.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <m38r3fcdoj.fsf@nitrogen.jhcloos.org>

James Cloos <cloos@jhcloos.com> writes:

>>>>>> "EA" == Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
> EA> (let ((level 55))
> EA>   (dolist (grp very-long-list-of-group-names)
> EA>     (when-let ((entry (gnus-group-entry grp)))
> EA>       (setcar (cdadr entry) level))))
>
> Ah.  Cool.  As a first step I tried out:
>
>  (cdadr (gnus-group-entry "nnimap+oxygen:ding@gnus.org"))
>
> since ding was at point and thus easy to copy-n-yank.
>
> It errored out that (listp 0) return nil.
>
> Some experimentation showed that:
>
>  (cadadr (gnus-group-entry "nnimap+oxygen:ding@gnus.org"))
>
> returned the cons (11 . 15), where 11 is the current level.
> (I'm not sure what that cons' cdr is.)

Ah, that's "rank". Once upon a time I knew what rank meant, but have
since forgotten.

> I see aroung 7% of the groups' lines in .newsrc.eld have just an integer
> at that point for level, whereas the others have such a cons.
>
> Eg this returns just the integer 11:
>
>  (cadadr (gnus-group-entry "nnimap+oxygen:GitHub-Torvalds"))
>
> I take it setcar will not do the right thing in such cases, yes?
> And something like a cl-typecase would be required?
>
> Is cadadr setf-able in emacs?

I'd also forgotten there are tools for reliably setting the level,
whether or not rank is involved. Specifically there's a
`gnus-info-level' that advertises itself as setf-able, so try:

(let ((level 55))
   (dolist (grp very-long-list-of-group-names)
     (when-let ((info (gnus-get-info grp)))
       (setf (gnus-info-level info) level))))

Note that now we're using `gnus-get-info', not `gnus-group-entry'. Sorry
I didn't (re-)discover this the first time around!

> P.S.  setting (nnimap-expunge never) or (nnimap-expunge 'never)
>       in an entry in gnus-secondary-select-methods doesn't seem
>       to do anything.  dovecot removes the files everytime gnus
>       quits the *Summary* buffer.  I want to set \Delete but not
>       to expunge...

Hmm, that ought to work -- how are you marking your messages for deletion?



  reply	other threads:[~2024-02-22 17:13 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-15  3:20 gnus-group-change-level James Cloos
2024-02-15 18:41 ` gnus-group-change-level Andreas Schwab
2024-02-15 18:51   ` gnus-group-change-level James Cloos
2024-02-18 17:46     ` gnus-group-change-level Eric Abrahamsen
2024-02-18 19:47       ` gnus-group-change-level James Cloos
2024-02-18 20:02       ` gnus-group-change-level James Cloos
2024-02-18 20:07         ` gnus-group-change-level Eric Abrahamsen
2024-02-19  1:26           ` gnus-group-change-level James Cloos
2024-02-19  2:31             ` gnus-group-change-level Eric Abrahamsen
2024-02-19  2:58               ` gnus-group-change-level James Cloos
2024-02-20  5:37                 ` gnus-group-change-level Eric Abrahamsen
2024-02-20 16:18                   ` gnus-group-change-level James Cloos
2024-02-22 17:13                     ` Eric Abrahamsen [this message]
2024-02-22 18:39                       ` gnus-group-change-level Andreas Schwab
2024-02-22 22:00                         ` gnus-group-change-level Eric Abrahamsen
2024-02-22 22:36                       ` gnus-group-change-level James Cloos
2024-02-19 10:57             ` gnus-group-change-level Eric S Fraga
2024-02-23  2:08               ` gnus-group-change-level 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=87y1bch17d.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).