From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/66694 Path: news.gmane.org!not-for-mail From: John SJ Anderson Newsgroups: gmane.emacs.gnus.general Subject: Re: Restricting frequency of 'g' Date: Sun, 06 Apr 2008 07:55:42 -0400 Organization: genehack Message-ID: <86wsnbjiyp.fsf@ankh.home.genehack.org> References: <87zls71wod.fsf@windlord.stanford.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1207483014 9703 80.91.229.12 (6 Apr 2008 11:56:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 6 Apr 2008 11:56:54 +0000 (UTC) Cc: ding@gnus.org To: Russ Allbery Original-X-From: ding-owner+M15177@lists.math.uh.edu Sun Apr 06 13:57:26 2008 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.50) id 1JiTUz-0000uz-DG for ding-account@gmane.org; Sun, 06 Apr 2008 13:57:25 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1JiTTa-0008SZ-FI; Sun, 06 Apr 2008 06:55:58 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1JiTTY-0008SM-PB for ding@lists.math.uh.edu; Sun, 06 Apr 2008 06:55:56 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.67) (envelope-from ) id 1JiTTS-00030D-EK for ding@lists.math.uh.edu; Sun, 06 Apr 2008 06:55:56 -0500 Original-Received: from smtp02.lnh.mail.rcn.net ([207.172.157.102]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1JiTTb-0003pC-00 for ; Sun, 06 Apr 2008 13:55:59 +0200 Original-Received: from mr08.lnh.mail.rcn.net ([207.172.157.28]) by smtp02.lnh.mail.rcn.net with ESMTP; 06 Apr 2008 07:55:49 -0400 Original-Received: from smtp01.lnh.mail.rcn.net (smtp01.lnh.mail.rcn.net [207.172.4.11]) by mr08.lnh.mail.rcn.net (MOS 3.8.6-GA) with ESMTP id JUY33548; Sun, 6 Apr 2008 07:55:46 -0400 (EDT) Original-Received: from 208-58-208-42.c3-0.gth-ubr1.lnh-gth.md.cable.rcn.com (HELO quirm.localdomain) ([208.58.208.42]) by smtp01.lnh.mail.rcn.net with ESMTP; 06 Apr 2008 09:00:19 -0400 Original-Received: from ankh.home.genehack.org (ankh.home.genehack.org [192.168.1.17]) by quirm.localdomain (Postfix) with ESMTP id 56170FA819D; Sun, 6 Apr 2008 07:55:42 -0400 (EDT) X-URL: http://genehack.org X-Attribution: john In-Reply-To: <87zls71wod.fsf@windlord.stanford.edu> (Russ Allbery's message of "Sat\, 05 Apr 2008 20\:36\:50 -0700") X-Junkmail-Status: score=10/50, host=mr08.lnh.mail.rcn.net X-Junkmail-SD-Raw: score=unknown, refid=str=0001.0A010201.47F8BA42.00AA,ss=1,fgs=0, ip=207.172.4.11, so=2007-10-30 19:00:17, dmn=5.4.3/2007-11-16 X-Junkmail-IWF: false X-Spam-Score: -2.5 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:66694 Archived-At: Russ Allbery 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 "") '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