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<))))))