From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/81821 Path: news.gmane.org!not-for-mail From: =?utf-8?Q?Sergio_Mart=C3=ADnez?= Newsgroups: gmane.emacs.gnus.general Subject: Re: filtering mail from a group Date: Mon, 30 Apr 2012 23:05:48 -0500 Message-ID: <87k40w1r6r.fsf@tesla.pmx> References: <874ns2aw16.fsf@tesla.pmx> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1335845250 29662 80.91.229.3 (1 May 2012 04:07:30 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 1 May 2012 04:07:30 +0000 (UTC) Cc: "Gnus" To: Erik Colson Original-X-From: ding-owner+M30091@lists.math.uh.edu Tue May 01 06:07:29 2012 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SP4N6-0000M9-C2 for ding-account@gmane.org; Tue, 01 May 2012 06:07:28 +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 1SP4Ln-000545-19; Mon, 30 Apr 2012 23:06:07 -0500 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1SP4Lk-00053q-39 for ding@lists.math.uh.edu; Mon, 30 Apr 2012 23:06:04 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1SP4Li-00077L-PD for ding@lists.math.uh.edu; Mon, 30 Apr 2012 23:06:03 -0500 Original-Received: from mail-iy0-f172.google.com ([209.85.210.172]) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1SP4Lh-00024C-5f for ding@gnus.org; Tue, 01 May 2012 06:06:01 +0200 Original-Received: by iazz13 with SMTP id z13so7542666iaz.17 for ; Mon, 30 Apr 2012 21:05:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:mail-followup-to:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=KRXvUQOwjz30Eux3i6sIrgstZvppi6Uok4O681LvGRA=; b=CvVnLbC07wjLbWKVN54NEAc98F9hIDbLgI6V9Qk8BOF5/ldzTcGTxC6cKiKb6YGVO1 /mCZOsd66/3o1kfsGezxyAHbFIFQx1alrIzKRhpLeLu+7l3LVKoNKbqHUTnoSfZ8I3Dc uDThqQQ3zOLmXZBsZV7wRUWhRKzV4g6whRZHSI3bQ4sqLjEs4ZWo4ufHmPIQMdgvUov0 QmAY6JcfXpATIaHSyph2RIdUBmTAwgodPagGsYjbiUFkkMbA1y+5bh4zDVhDGvMd0P6O GgKKSErYgRQCSHh4cFXGcOZqNWtRzsr4IBXf0Y3TBQmOc5PJ8ndmOsXs7Ec2dH68POfO POgA== Original-Received: by 10.50.154.170 with SMTP id vp10mr478834igb.32.1335845154894; Mon, 30 Apr 2012 21:05:54 -0700 (PDT) Original-Received: from tesla.pmx ([189.205.164.74]) by mx.google.com with ESMTPS id mk10sm13206204igc.11.2012.04.30.21.05.51 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 30 Apr 2012 21:05:53 -0700 (PDT) Mail-Followup-To: Erik Colson , "Gnus" In-Reply-To: (Erik Colson's message of "Mon, 30 Apr 2012 11:12:27 +0200") User-Agent: Gnus/5.130004 (Ma Gnus v0.4) Emacs/24.1.50 (gnu/linux) X-Spam-Score: -2.7 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:81821 Archived-At: Erik Colson writes: > > Hi Sergio! > > Thanks for your answer! > I don't want to put mails in another mailbox. I want to limit the mails > to mails posted after a certain date, without removing the older ones > from the mailbox. It is doable with / t but that makes me calculate > again and again the number of days since the 'filter date'. Because / t > requires to enter a number of days and not a date... > > Thanks for helping ! > -- > erik OK, maybe this can help you: --------------------------------------------------------------- (defun gnus-summary-limit-to-date (date &optional after-p) "Limit the summary buffer to articles before DATE. If AFTER-P (the prefix) is non-nil, limit the summary buffer to articles that are after DATE." (interactive (let ((after current-prefix-arg) date-string) (setq date-string (if after (read-string "Limit to after the date: ") (read-string "Limit to before the date: "))) (list date-string after))) (let (date-string age) (setq date-string (if (string-match-p ":+" date) date (concat date " 00:00" ))) (setq age (days-between (current-time-string) date-string)) (gnus-summary-limit-to-age age after-p))) ---------------------------------------------------------------- Put this in your .emacs or .gnus file, then in the summary buffer do M-x gnus-summary-limit-to-date RET. It prompts you for a date to limit articles before that date or after if a prefix argument is given (i.e. C-u M-x gnus-summary-limit-to-date RET). Note that the date is in a format accepted by `parse-time-string', for example: "2012-01-01" or "Mon, 30 Apr 2012 22:40:05 -0500", etc. I hope this can be useful. Let me know if it does not fit your needs. -- Sergio