From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/64716 Path: news.gmane.org!not-for-mail From: Loic Dachary Newsgroups: gmane.emacs.gnus.general Subject: patch proposed: gnus-summary-limit-to-from-to Date: Mon, 28 May 2007 18:34:20 +0200 Message-ID: <87hcpwkiur.fsf@call.dachary.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1180370072 23142 80.91.229.12 (28 May 2007 16:34:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 28 May 2007 16:34:32 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M13227=ding+2Daccount=gmane.org@lists.math.uh.edu Mon May 28 18:34:30 2007 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 1HsiAo-00070k-OD for ding-account@gmane.org; Mon, 28 May 2007 18:34:23 +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 1HsiAn-0002eT-82 for ding-account@gmane.org; Mon, 28 May 2007 11:34:21 -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 1HsiAm-0002eO-BL for ding@lists.math.uh.edu; Mon, 28 May 2007 11:34:20 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.67) (envelope-from ) id 1HsiAk-0004JX-Ny for ding@lists.math.uh.edu; Mon, 28 May 2007 11:34:20 -0500 Original-Received: from smtp4-g19.free.fr ([212.27.42.30]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1HsiAk-0008P1-00 for ; Mon, 28 May 2007 18:34:18 +0200 Original-Received: from call.dachary.org (magenta.dachary.org [82.235.173.177]) by smtp4-g19.free.fr (Postfix) with ESMTP id 5D4926F402; Mon, 28 May 2007 18:34:17 +0200 (CEST) User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.99 (gnu/linux) X-Spam-Score: -2.1 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:64716 Archived-At: Hi, I wanted to see all mails from OR to a someone. With gnus-summary-limit-to-from-to one can see all mails coming from or sent to yves.guiard (for instance ;-) The patch is against No Gnus v0.6 GNU Emacs 22.0.99.1 (i386-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2007-05-01 on pacem, modified by Debian When added to .emacs it can be bound to / f using: (define-key gnus-summary-limit-map (kbd "f") 'gnus-summary-limit-to-from-to) Cheers, diff -r 01fe29f10b77 gnus-sum.el --- a/gnus-sum.el Mon May 28 17:01:17 2007 +0200 +++ b/gnus-sum.el Mon May 28 18:11:06 2007 +0200 @@ -1787,6 +1787,7 @@ increase the score of each group you rea "w" gnus-summary-pop-limit "s" gnus-summary-limit-to-subject "a" gnus-summary-limit-to-author + "f" gnus-summary-limit-to-from-to "u" gnus-summary-limit-to-unread "m" gnus-summary-limit-to-marks "M" gnus-summary-limit-exclude-marks @@ -7800,6 +7801,23 @@ If NOT-MATCHING, excluding articles that (gnus-summary-limit articles)) (gnus-summary-position-point)))) +(defun gnus-summary-limit-to-from-to (fromto &optional ignored ig) + "Limit the summary buffer to articles that have from or to header that match a regexp. +If NOT-MATCHING, excluding articles that have from or to header that match a regexp." + (interactive + (list (read-string "Limit to from/to (regexp): ") + nil current-prefix-arg)) + (when (not (equal "" fromto)) + (prog1 + (let ((articles-from (gnus-summary-find-matching + "from" fromto 'all nil nil nil)) + (articles-to (gnus-summary-find-matching + (cons 'extra 'To) fromto 'all nil nil nil))) + (unless (or articles-from articles-to) + (error "Found no matches for \"%s\"" fromto)) + (gnus-summary-limit (gnus-sorted-nunion articles-from articles-to))) + (gnus-summary-position-point)))) + (defun gnus-summary-limit-to-author (from &optional not-matching) "Limit the summary buffer to articles that have authors that match a regexp. If NOT-MATCHING, excluding articles that have authors that match a regexp." -- +33 1 76 60 72 81 Loic Dachary mailto:loic@dachary.org http://dachary.org/loic/gpg.txt sip:loic@dachary.org Latitude: 48.86962325498033 Longitude: 2.3623046278953552