From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/64722 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.gnus.general Subject: Re: patch proposed: gnus-summary-limit-to-from-to Date: Tue, 29 May 2007 12:51:48 +0900 Organization: Emacsen advocacy group Message-ID: References: <87hcpwkiur.fsf@call.dachary.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1180410797 8601 80.91.229.12 (29 May 2007 03:53:17 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 29 May 2007 03:53:17 +0000 (UTC) Cc: ding@gnus.org To: Loic Dachary Original-X-From: ding-owner+M13233@lists.math.uh.edu Tue May 29 05:53:16 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 1Hsslk-000128-7G for ding-account@gmane.org; Tue, 29 May 2007 05:53:12 +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 1Hsskc-0005dN-7I; Mon, 28 May 2007 22:52:02 -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 1Hsska-0005d9-NS for ding@lists.math.uh.edu; Mon, 28 May 2007 22:52:00 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.67) (envelope-from ) id 1HsskZ-0008OT-8b for ding@lists.math.uh.edu; Mon, 28 May 2007 22:52:00 -0500 Original-Received: from orlando.hostforweb.net ([216.246.45.90]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1HsskY-0001G6-00 for ; Tue, 29 May 2007 05:51:58 +0200 Original-Received: from [66.225.201.151] (port=55835 helo=mail.jpl.org) by orlando.hostforweb.net with esmtpa (Exim 4.63) (envelope-from ) id 1HsskX-0006lU-Mr; Mon, 28 May 2007 22:51:58 -0500 X-Hashcash: 1:20:070529:loic@dachary.org::x3bUCpRZ6nkYU9+9:04rkC X-Hashcash: 1:20:070529:ding@gnus.org::ghZlcX0Vcg4NnK7M:00004qog X-Face: #kKnN,xUnmKia.'[pp`;Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu;B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (gnu/linux) Cancel-Lock: sha1:KoXJhULuW2BTdthemqKrPJOud4w= X-Antivirus-Scanner: Clean mail though you should still use an Antivirus X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - orlando.hostforweb.net X-AntiAbuse: Original Domain - gnus.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - jpl.org X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: -2.4 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:64722 Archived-At: --=-=-= >>>>> In <87hcpwkiur.fsf@call.dachary.org> Loic Dachary wrote: > 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 ;-) Isn't it better to be `gnus-summary-limit-to-from-to-cc'? In addition, isn't there a use of excluding ones matching a regexp? ;-) > +(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." I tried improving it modifying `gnus-summary-limit-to-recipient'. --=-=-= Content-Type: application/emacs-lisp Content-Disposition: inline (defun gnus-summary-limit-to-address (address &optional not-matching) "Limit the summary buffer to articles with the given ADDRESS. If NOT-MATCHING, exclude ADDRESS. To, Cc and From headers are checked. You need to include `To' and `Cc' in `nnmail-extra-headers'." (interactive (list (read-string (format "%s address (regexp): " (if current-prefix-arg "Exclude" "Limit to"))) current-prefix-arg)) (when (not (equal "" address)) (prog1 (let* ((to (if (memq 'To nnmail-extra-headers) (gnus-summary-find-matching (cons 'extra 'To) address 'all nil nil not-matching) (gnus-message 1 "`To' isn't present in `nnmail-extra-headers'") (sit-for 1) t)) (cc (if (memq 'Cc nnmail-extra-headers) (gnus-summary-find-matching (cons 'extra 'Cc) address 'all nil nil not-matching) (gnus-message 1 "`Cc' isn't present in `nnmail-extra-headers'") (sit-for 1) t)) (from (gnus-summary-find-matching "from" address 'all nil nil not-matching)) (articles (if not-matching ;; We need the numbers that are in all lists: (if (eq cc t) (if (eq to t) from (mapcar (lambda (a) (car (memq a from))) to)) (if (eq to t) (mapcar (lambda (a) (car (memq a from))) cc) (mapcar (lambda (a) (car (memq a from))) (mapcar (lambda (a) (car (memq a to))) cc)))) (nconc (if (eq to t) nil to) (if (eq cc t) nil cc) from)))) (unless articles (error "Found no matches for \"%s\"" address)) (gnus-summary-limit articles)) (gnus-summary-position-point)))) --=-=-= Content-Disposition: inline How about adding it to No Gnus? --=-=-=--