From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/72759 Path: news.gmane.org!not-for-mail From: Russ Allbery Newsgroups: gmane.emacs.gnus.general Subject: Re: Restricting frequency of 'g' Date: Thu, 07 Oct 2010 14:55:07 -0700 Organization: The Eyrie Message-ID: <87tykxmzwk.fsf@windlord.stanford.edu> References: <87zls71wod.fsf@windlord.stanford.edu> <200804080355.m383tJe9029473@sallyv1.ics.uci.edu> <200804090649.m396nesX018860@sallyv1.ics.uci.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1286488563 20277 80.91.229.12 (7 Oct 2010 21:56:03 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 7 Oct 2010 21:56:03 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M21131@lists.math.uh.edu Thu Oct 07 23:56:02 2010 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.69) (envelope-from ) id 1P3yRT-0002U1-8R for ding-account@gmane.org; Thu, 07 Oct 2010 23:55:59 +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 1P3yRH-0006xK-Iz; Thu, 07 Oct 2010 16:55:47 -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 1P3yRG-0006x2-4z for ding@lists.math.uh.edu; Thu, 07 Oct 2010 16:55:46 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.72) (envelope-from ) id 1P3yRB-0006lE-SC for ding@lists.math.uh.edu; Thu, 07 Oct 2010 16:55:46 -0500 Original-Received: from smtp1.stanford.edu ([171.67.219.81] helo=smtp.stanford.edu) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1P3yRA-0001vJ-00 for ; Thu, 07 Oct 2010 23:55:41 +0200 Original-Received: from smtp.stanford.edu (localhost.localdomain [127.0.0.1]) by localhost (Postfix) with SMTP id 0A682179E10 for ; Thu, 7 Oct 2010 14:55:10 -0700 (PDT) Original-Received: from windlord.stanford.edu (windlord.Stanford.EDU [171.67.225.134]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.stanford.edu (Postfix) with ESMTPS id 69DBD179E0E for ; Thu, 7 Oct 2010 14:55:07 -0700 (PDT) Original-Received: by windlord.stanford.edu (Postfix, from userid 1000) id 39D332F490; Thu, 7 Oct 2010 14:55:07 -0700 (PDT) In-Reply-To: (Lars Magne Ingebrigtsen's message of "Thu, 07 Oct 2010 22:16:28 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Spam-Score: -4.9 (----) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:72759 Archived-At: Lars Magne Ingebrigtsen writes: > Dan Nicolaescu writes: >> Any reason not to install this patch? > The functionality doesn't seem all that compelling... Would many people > use it? I absolutely swear by my implementation, although I wouldn't use the one that you're responding to. It's a really valuable tool in helping me avoid the temptation to spend all day checking my mail. ;; Use this function instead of gnus-group-get-new-news as the action for g. ;; It changes the level of subscribedness that it checks based on how long ;; it's been since the previous check and tries to throttle checking mail too ;; often. (defvar rra-last-mail-important-check (float-time) "The last time I checked mail in important groups.") (defvar rra-last-mail-normal-check (float-time) "The last time I checked mail in normal groups.") (defvar rra-last-mail-low-check (float-time) "The last time I checked mail in low-priority groups.") (defvar rra-mail-important-check-interval (* 60 15) "How long I'm required to wait before checking mail in important groups.") (defvar rra-mail-normal-check-interval (* 60 30) "How long I'm required to wait before checking mail in normal groups.") (defvar rra-mail-low-check-interval (* 60 60) "How long I'm required to wait before checking mail in low-priority groups.") (defun rra-timed-gnus-group-get-new-news () "Get newly arrived articles based on the interval since the last time I've checked for new articles." (interactive) (cond ((> (float-time) (+ rra-last-mail-low-check rra-mail-low-check-interval)) (gnus-group-get-new-news) (setq rra-last-mail-low-check (float-time)) (setq rra-last-mail-normal-check (float-time)) (setq rra-last-mail-important-check (float-time))) ((> (float-time) (+ rra-last-mail-normal-check rra-mail-normal-check-interval)) (gnus-group-get-new-news 3) (setq rra-last-mail-normal-check (float-time)) (setq rra-last-mail-important-check (float-time))) ((> (float-time) (+ rra-last-mail-important-check rra-mail-important-check-interval)) (gnus-group-get-new-news 1) (setq rra-last-mail-important-check (float-time))) (t (let ((next-check (+ rra-last-mail-important-check rra-mail-important-check-interval))) (message (concat "No gnus is good news (" (int-to-string (floor (- next-check (float-time)))) " seconds until check allowed)")))))) -- Russ Allbery (rra@stanford.edu)