changeset 88230:2406115dbe50

(rmail-summary-by-topic): Don't use rmail-current-subject-regexp. (rmail-message-subject-p): Use rmail-header-get-header instead of mail-fetch-field. (rmail-summary-by-senders): Default to current sender.
author Alex Schroeder <alex@gnu.org>
date Fri, 20 Jan 2006 00:42:54 +0000
parents 1453476a5834
children e304a2bf7bd4
files lisp/mail/rmailsum.el
diffstat 1 files changed, 15 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mail/rmailsum.el	Thu Jan 19 23:55:58 2006 +0000
+++ b/lisp/mail/rmailsum.el	Fri Jan 20 00:42:54 2006 +0000
@@ -143,8 +143,6 @@
   (interactive
    (let* ((subject (with-current-buffer rmail-buffer
 		     (rmail-current-subject)))
-	  (subject-re (with-current-buffer rmail-buffer
-			(rmail-current-subject-regexp)))
 	  (prompt (concat "Topics to summarize by (regexp"
 			  (if subject ", default current subject" "")
 			  "): ")))
@@ -167,18 +165,26 @@
      (rmail-desc-get-end msg))
     (goto-char (point-min))
     (if whole-message
-        (re-search-forward subject nil t)
-      (string-match subject
-		    (let ((subj (mail-fetch-field "subject")))
-		      (if subj
-			  (funcall rmail-summary-line-decoder subj)
-			""))))))
+	(re-search-forward subject nil t))
+    (string-match subject
+		  (let ((subj (rmail-header-get-header "subject")))
+		    (if subj
+			(funcall rmail-summary-line-decoder subj)
+		      "")))))
 
 ;;;###autoload
 (defun rmail-summary-by-senders (senders)
   "Display a summary of all messages with the given SENDERS.
 SENDERS is a string of names separated by commas."
-  (interactive "sSenders to summarize by: ")
+  (interactive
+   (let* ((sender (when rmail-current-message
+		    (rmail-desc-get-sender rmail-current-message)))
+	  (sender-re (with-current-buffer rmail-buffer
+		       (regexp-quote sender)))
+	  (prompt (concat "Senders to summarize by (regexp"
+			  (if sender ", default current sender" "")
+			  "): ")))
+     (list (read-string prompt nil nil sender))))
   (rmail-new-summary
    (concat "senders " senders)
    (list 'rmail-summary-by-senders senders)