Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: wmorgan-sup@masanjin.net (William Morgan)
Subject: [sup-talk] Feature suggestion for hooks
Date: Tue, 18 Dec 2007 20:36:26 -0800	[thread overview]
Message-ID: <1198038876-sup-2579@south> (raw)
In-Reply-To: <1197760360-sup-5935@arlanda>

Excerpts from Ismo Puustinen's message of Sat Dec 15 15:27:59 -0800 2007:
> I have a small script that works as a biff-like new mail indicator. 
> The script would need as input the amount of unread mail in the 
> inbox. The problem is that the after-poll hook apparently has no 
> way of knowing how much unread mail there currenly is -- it only 
> knows the number added during this poll.

I've added a num_inbox_total_unread variable to the after-poll hook.

> An even better option might be to add these computationally intensive
> operations to an internal API that would be callable from the hooks.
> This way the variables would not need to be computed if the hook
> didn't need them. 

The hook system supports this though its "variables" already---passed in
variables can be lambdas which are not evaluated unless needed (and then
they're cached). I do this for the above, although it's not really an
expensive operation thanks to Ferret.

-- 
William <wmorgan-sup at masanjin.net>


      reply	other threads:[~2007-12-19  4:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-15 23:27 Ismo Puustinen
2007-12-19  4:36 ` William Morgan [this message]

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=1198038876-sup-2579@south \
    --to=wmorgan-sup@masanjin.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