From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/16176 Path: main.gmane.org!not-for-mail From: (Jari Aalto+list.ding) Newsgroups: gmane.emacs.gnus.general Subject: patch: 5.6.38 gnus-uu, new regexp marking commands Date: 22 Aug 1998 18:12:13 +0300 Sender: owner-ding@hpc.uh.edu Message-ID: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 (generated by tm-edit 7.106) Content-Type: multipart/mixed; boundary="Multipart_Sat_Aug_22_18:12:11_1998-1" Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1035155088 26242 80.91.224.250 (20 Oct 2002 23:04:48 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 23:04:48 +0000 (UTC) Return-Path: Original-Received: from gwyn.tux.org (gwyn.tux.org [207.96.122.8]) by altair.xemacs.org (8.9.1/8.9.1) with ESMTP id IAA04010 for ; Sat, 22 Aug 1998 08:12:07 -0700 Original-Received: from sina.hpc.uh.edu (Sina.HPC.UH.EDU [129.7.3.5]) by gwyn.tux.org (8.8.8/8.8.8) with ESMTP id LAA07775 for ; Sat, 22 Aug 1998 11:13:31 -0400 Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by sina.hpc.uh.edu (8.7.3/8.7.3) with ESMTP id KAK16615; Sat, 22 Aug 1998 10:13:19 -0500 (CDT) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Sat, 22 Aug 1998 10:12:52 -0500 (CDT) Original-Received: from sclp3.sclp.com (root@sclp3.sclp.com [209.195.19.139]) by sina.hpc.uh.edu (8.7.3/8.7.3) with ESMTP id KAA16602 for ; Sat, 22 Aug 1998 10:12:41 -0500 (CDT) Original-Received: from axl01it.ntc.nokia.com (axl01it.ntc.nokia.com [131.228.118.232]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id LAA06011 for ; Sat, 22 Aug 1998 11:12:34 -0400 (EDT) Original-Received: from zeus.tele.nokia.fi (zeus.tele.nokia.fi [131.228.134.50]) by axl01it.ntc.nokia.com (8.8.5/8.6.9) with SMTP id SAA01964 for ; Sat, 22 Aug 1998 18:12:02 +0300 (EET DST) Original-Received: from creator.tele.nokia.fi (creator.tele.nokia.fi [131.228.48.178]) by zeus.tele.nokia.fi (8.6.4/8.6.4) with ESMTP id SAA14226 for ; Sat, 22 Aug 1998 18:15:52 +0300 Original-Received: (from jaalto@localhost) by creator.tele.nokia.fi (8.7.5/8.7.1) id SAA18303; Sat, 22 Aug 1998 18:12:15 +0300 (EETDST) Original-To: Ding mailing list X-info: Emacs tiny tools: ftp://cs.uta.fi/pub/ssjaaa/ File server: Send subject 'send help' to Original-Lines: 151 X-Mailer: Gnus v5.6.38/Emacs 19.34 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:16176 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:16176 --Multipart_Sat_Aug_22_18:12:11_1998-1 Content-Type: text/plain; charset=US-ASCII Hi, A day ago I subscribed to handfull of new mailing lists and when I was away last night my procmail recipes sorted them to wrong folders. so I had to move lot of mail from group to another. The first command that come into my mind was gnus-uu-mark-by-regexp But it only matched subjects. I assumed it would match the visible Summary line, but it didn't :-). There was nothing in common in the subject lines that come from eg liserv XXX. However If I matched against From field, then I could tag all the messages coming from particular list and move then all to right group. Here is the new functions that do that: They un/mark articles that match From field. The patch is against 5.6.38. Feel free to move the new keybinds to somewhere more appropriate. jari --Multipart_Sat_Aug_22_18:12:11_1998-1 Content-Type: text/plain; charset=US-ASCII Sat Aug 22 17:56:04 1998 Jari Aalto * gnus-uu.el ((gnus-uu-mark-map "P" gnus-summary-mark-map)): Added commands "f" gnus-uu-mark-by-from-regexp "F" gnus-uu-unmark-by-from-regexp (gnus-uu-mark-by-from-regexp): New user function. (gnus-uu-find-articles-matching): Added anew arg `data-flag' Which may have other uses in the future. Curretly if flag is set to non-nil, the matching list is generated by looking at `from' fields. If flag is nil, then list is generated by looking at `subject'. (gnus-uu-find-articles-matching): variable changes `list-of-subjects' --> `list' and `subject' --> `string' --Multipart_Sat_Aug_22_18:12:11_1998-1 Content-Type: text/plain; type=patch; charset=US-ASCII Content-Disposition: attachment; filename="gnus-uu.el.diff" Content-Transfer-Encoding: 7bit Prereq: 1.1 =================================================================== RCS file: RCS/gnus-uu.el,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- 1.1 1998/08/22 14:53:26 +++ 1.2 1998/08/22 15:01:27 @@ -356,6 +356,8 @@ "g" gnus-uu-unmark-region "R" gnus-uu-mark-by-regexp "G" gnus-uu-unmark-by-regexp + "f" gnus-uu-mark-by-from-regexp + "F" gnus-uu-unmark-by-from-regexp "t" gnus-uu-mark-thread "T" gnus-uu-unmark-thread "a" gnus-uu-mark-all @@ -578,6 +580,25 @@ (interactive (list (read-from-minibuffer "Mark (regexp): "))) (gnus-uu-mark-by-regexp regexp t)) + +(defun gnus-uu-mark-by-from-regexp (regexp &optional unmark) + "Ask for a regular expression and set the process mark on all articles that match `From'." + (interactive (list (read-from-minibuffer "Mark (From regexp): "))) + (let ((articles (gnus-uu-find-articles-matching regexp nil nil 'from))) + (while articles + (if unmark + (gnus-summary-remove-process-mark (pop articles)) + (gnus-summary-set-process-mark (pop articles)))) + (message "")) + (gnus-summary-position-point)) + + +(defun gnus-uu-unmark-by-from-regexp (regexp &optional unmark) + "Ask for a regular expression and remove the process mark on all articles that match `from' ." + (interactive (list (read-from-minibuffer "Mark (regexp): "))) + (gnus-uu-mark-by-from-regexp regexp t)) + + (defun gnus-uu-mark-series () "Mark the current series with the process mark." (interactive) @@ -1081,14 +1102,19 @@ (string< (car l1) (car l2))) (defun gnus-uu-find-articles-matching - (&optional subject only-unread do-not-translate) + (&optional subject only-unread do-not-translate data-flag) ;; Finds all articles that matches the regexp SUBJECT. If it is ;; nil, the current article name will be used. If ONLY-UNREAD is ;; non-nil, only unread articles are chosen. If DO-NOT-TRANSLATE is ;; non-nil, article names are not equalized before sorting. + ;; + ;; If DATA-FLAG is non-nil, match `from' gnus-data instead of `subject' (let ((subject (or subject (gnus-uu-reginize-string (gnus-summary-article-subject)))) - list-of-subjects) + list + from + string + ) (save-excursion (if (not subject) () @@ -1104,16 +1130,21 @@ gnus-unread-mark) (= mark gnus-ticked-mark) (= mark gnus-dormant-mark)) - (setq subj (mail-header-subject (gnus-data-header d))) - (string-match subject subj) - (push (cons subj (gnus-data-number d)) - list-of-subjects)))) + (cond + ((null data-flag) + (setq string (mail-header-subject (gnus-data-header d))) + (string-match subject string)) + (t + (setq string (mail-header-from (gnus-data-header d))) + (string-match subject string))) + (push (cons string (gnus-data-number d)) + list)))) ;; Expand numbers, sort, and return the list of article ;; numbers. (mapcar (lambda (sub) (cdr sub)) (sort (gnus-uu-expand-numbers - list-of-subjects + list (not do-not-translate)) 'gnus-uu-string<)))))) --Multipart_Sat_Aug_22_18:12:11_1998-1--