From: John SJ Anderson <genehack@genehack.org>
To: Russ Allbery <rra@stanford.edu>
Cc: ding@gnus.org
Subject: Re: Restricting frequency of 'g'
Date: Sun, 06 Apr 2008 07:55:42 -0400 [thread overview]
Message-ID: <86wsnbjiyp.fsf@ankh.home.genehack.org> (raw)
In-Reply-To: <87zls71wod.fsf@windlord.stanford.edu> (Russ Allbery's message of "Sat\, 05 Apr 2008 20\:36\:50 -0700")
Russ Allbery <rra@stanford.edu> writes:
> Does anyone have a good recipe for having Gnus remember the last time I
> checked for new mail and to force me to jump through some hoop if it's
> been less than a configurable amount of time?
I had the same problem; so I came up with this and then retrained
myself to hit 'F6' instead of 'g'.
(defvar jsja/last-mail-check (float-time)
"last time i checked mail via magic key")
(defvar jsja/mail-check-interval (* 60 5)
"how long i should wait before checking mail")
(defun jsja/switch-to-gnus ()
"Bring Gnus *Group* buffer to front, starting Gnus if needed"
(interactive)
(if (or (not (fboundp 'gnus-alive-p))
(not (gnus-alive-p)))
(gnus)
(switch-to-buffer "*Group*")
(delete-other-windows)
(setq next-mail-check (+ jsja/last-mail-check jsja/mail-check-interval))
(if (< (float-time) next-mail-check)
(message (concat
"no gnus is good news ("
(int-to-string (floor (- next-mail-check (float-time))))
" seconds until next check allowed)" ))
(gnus-group-get-new-news 1)
(setq jsja/last-mail-check (float-time)))))
(global-set-key (kbd "<f6>") 'jsja/switch-to-gnus)
john.
--
I WILL NOT DEMAND WHAT I'M WORTH
I WILL NOT DEMAND WHAT I'M WORTH
I WILL NOT DEMAND WHAT I'M WORTH
Bart Simpson on chalkboard in episode 5F14
next prev parent reply other threads:[~2008-04-06 11:55 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-06 3:36 Russ Allbery
2008-04-06 4:54 ` Bill O'Connor
2008-04-06 6:43 ` Russ Allbery
2008-04-06 11:55 ` John SJ Anderson [this message]
2008-04-07 1:30 ` Russ Allbery
2008-04-07 23:45 ` jidanni
2008-04-08 0:54 ` John SJ Anderson
2008-04-08 3:41 ` Russ Allbery
2008-04-08 21:12 ` a Gnus biff (was: Restricting frequency of 'g') Ted Zlatanov
2008-04-09 13:59 ` a Gnus biff Wes Hardaker
2008-04-08 3:55 ` Restricting frequency of 'g' Dan Nicolaescu
2008-04-09 6:49 ` Dan Nicolaescu
2008-04-09 19:22 ` Reiner Steib
2008-04-12 14:58 ` Mark Plaksin
2008-07-29 21:14 ` Dan Nicolaescu
2008-07-30 18:04 ` Reiner Steib
2009-07-30 19:32 ` Dan Nicolaescu
2010-10-07 6:27 ` Dan Nicolaescu
2010-10-07 20:16 ` Lars Magne Ingebrigtsen
2010-10-07 21:55 ` Russ Allbery
2010-10-08 17:28 ` Ted Zlatanov
2010-10-08 15:14 ` Jason L Tibbitts III
2010-10-09 15:36 ` Lars Magne Ingebrigtsen
2010-10-09 15:50 ` Richard Riley
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=86wsnbjiyp.fsf@ankh.home.genehack.org \
--to=genehack@genehack.org \
--cc=ding@gnus.org \
--cc=rra@stanford.edu \
/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).