From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: ding@gnus.org
Subject: Re: gnus-exit-group-hook
Date: Mon, 18 Dec 2017 10:20:38 -0800 [thread overview]
Message-ID: <87bmivlwy1.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <87h8sohfx8.fsf@bobnewell.net>
Bob Newell <bobnewell@bobnewell.net> writes:
> Aloha
>
> When exiting the summary buffer, gnus-exit-group-hook is run unless the
> summary buffer is exited in a non-updating manner (such as with Q
> instead of q).
>
> But I note that the hook is called in gnus-sum.el as follows:
>
> (unless quit-config
> (gnus-run-hooks 'gnus-exit-group-hook)
> (gnus-summary-update-info))
>
> Note that the hook is called before the summary info is updated. I was
> relying on this hook to determine and save the number of still unread
> articles in the group, but I don't get that, I get the number of unread
> articles at the time of group entry, not exit.
>
> Shouldn't the hook run after the update? Or am (quite typically) I
> missing something here?
I guess it's just a matter of what you might want to use the hook for.
Some people might want to use it to short-circuit the update process.
I'm surprised you can't get the number you want, though -- the local
variable `gnus-newsgroup-unreads' should be updated in real time as you
read articles. If all you want is to do something with the number of
unreads, can't you take the `length' of that?
Eric
next prev parent reply other threads:[~2017-12-18 18:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-18 3:29 gnus-exit-group-hook Bob Newell
2017-12-18 18:20 ` Eric Abrahamsen [this message]
2017-12-18 19:46 ` gnus-exit-group-hook Emanuel Berg
2017-12-18 23:41 ` gnus-exit-group-hook Bob Newell
2017-12-18 23:55 ` gnus-exit-group-hook Bob Newell
2017-12-19 1:40 ` gnus-exit-group-hook 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=87bmivlwy1.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).