From: Loic Dachary <loic@dachary.org>
To: ding@gnus.org
Subject: patch proposed: gnus-summary-limit-to-from-to
Date: Mon, 28 May 2007 18:34:20 +0200 [thread overview]
Message-ID: <87hcpwkiur.fsf@call.dachary.org> (raw)
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
next reply other threads:[~2007-05-28 16:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-28 16:34 Loic Dachary [this message]
2007-05-29 3:51 ` Katsumi Yamaoka
2007-05-29 5:52 ` Reiner Steib
2007-05-29 9:17 ` Loic Dachary
2007-05-29 9:57 ` Katsumi Yamaoka
2007-05-29 11:32 ` Loic Dachary
2007-05-29 12:06 ` Katsumi Yamaoka
2007-05-29 12:16 ` Loic Dachary
2007-05-29 12:27 ` Katsumi Yamaoka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87hcpwkiur.fsf@call.dachary.org \
--to=loic@dachary.org \
--cc=ding@gnus.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).