Re: gnus-group-change-level

Eric Abrahamsen <[email protected]>
Newsgroups gmane.emacs.gnus.general
Message-ID <[email protected]>
James Cloos <[email protected]> writes:

>>>>>> "EA" == Eric Abrahamsen <[email protected]> writes:
>
> EA> Oh wow, I've never seen anyone do this before. How long has this setup
> EA> been functioning?
>
> A couple of decades.

Well that's good news in general!

> EA> Is your current issue with changing the level of this
> EA> group something that's come up recently, and only for this group?
>
> I never tried to call gnus-group-change-level directly before, only S L
> in the *Groups* buffer, and that as I wrote works fine.
>
> I'm only attempting this because after my previous workstation's
> mainboard failed, I ended up using a different imapd on an existing
> headless node here.  And so the group names have a different hostname.
>
> I want to get the levels back to how I had them on the previous setup,
> but w/o manually calling SL thousands of times.  Or even just hundreds.
> (I used to split some large lists very narrowly; that led to *lots* of
> groups.  I've chosen not to split them that narrowly this time.)

Sorry, you did mention originally that you were doing this
programmatically.

[...]

> EA> In current Emacs master, the level should be changed on line 1327:
>
> EA> (setcar (cdadr entry) level)
>
> EA> Do you not reach that line?
>
> I saw that line, but do not recall what edebug showed in the non-working
> attempts.
>
> I'll have to re-test.  I had to restart gnus in the interim.  I'll do
> that later tonight.

Another thing to try is edebugging `gnus-group-change-level', then using
"S L", and when edebug starts up make note of all the values of the
arguments. Then you can call the function yourself with those values.

Provided you give it a value for "oldlevel", and provided that level is
less than `gnus-level-zombie', the setting of the level should be
relatively straightforward, since you're not "bringing the group back
from the dead", as far as Gnus is concerned.

Last but not least, if you're doing this programmatically, you might as
well just get straight to the meat of it. Like I said, if you're not
resurrecting dead groups, all the auxiliary structures will already
contain your group and all should be well. It should be enough to do:

(let ((level 55))
  (dolist (grp very-long-list-of-group-names)
    (when-let ((entry (gnus-group-entry grp)))
      (setcar (cdadr entry) level))))

Then refresh Gnus with "g".

Back up your .newsrc.eld first!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.