[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Update topic unread counts on group exit?
From: |
Eric Abrahamsen |
Subject: |
Re: Update topic unread counts on group exit? |
Date: |
Wed, 04 May 2022 12:51:22 -0700 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
Adam Sjøgren <asjo@koldfront.dk> writes:
> Adam writes:
>
>> Eric writes:
>>
>>> It looks to me like you could add a function to
>>> `gnus-summary-exit-hook', which calls
>>> `gnus-topic-update-topics-containing-group' on the value of
>>> `gnus-newsgroup-name'. At that stage in summary exit,
>>> `gnus-newsgroup-name' won't have been cleared yet, so it should still
>>> hold the name of the group you're coming out of.
>
> [...]
>
>> I will see if I can get your suggestion going after dinner :-)
>
> This is what I did:
>
> (defun asjo-update-topics ()
> (gnus-topic-update-topics-containing-group gnus-newsgroup-name))
>
> (add-hook 'gnus-summary-exit-hook 'asjo-update-topics)
>
> But simpler than my hack - but nothing is updated.
>
> When I edebug-defun it, I can see that gnus-newsgroup-name is indeed the
> full newsgroup name, e.g. "nntp+gm:gmane.emacs.gnus.user", but the topic
> counts aren't updated.
And if I'd looked at that function before recommending it, I would have
immediately seen that it's buggy! That and `gnus-topic-update-topic'
check to see if the major-mode is 'gnus-topic-mode, which of course it
never is, because gnus-topic-mode is a minor mode.
In fact, gnus-topic.el already thinks it's doing what you want --
updating topic lines on group exit -- but because of the bug in
`gnus-topic-update-topic', the update never happens.
Lars added that major-mode check as part of a larger commit last year, I
have to assume it was a mistake. I'll remove the checks now.
Eric
- Update topic unread counts on group exit?, Adam Sjøgren, 2022/05/04
- Re: Update topic unread counts on group exit?, Eric Abrahamsen, 2022/05/04
- Re: Update topic unread counts on group exit?, Adam Sjøgren, 2022/05/04
- Re: Update topic unread counts on group exit?, Adam Sjøgren, 2022/05/04
- Re: Update topic unread counts on group exit?,
Eric Abrahamsen <=
- Re: Update topic unread counts on group exit?, Adam Sjøgren, 2022/05/04
- Re: Update topic unread counts on group exit?, Adam Sjøgren, 2022/05/04
- Re: Update topic unread counts on group exit?, Eric Abrahamsen, 2022/05/04
- Re: Update topic unread counts on group exit?, Adam Sjøgren, 2022/05/05
- Re: Update topic unread counts on group exit?, Eric Abrahamsen, 2022/05/04