From: Alex Schroeder Date: Fri, 20 Jan 2006 00:42:58 +0000 (+0000) Subject: (rmail-summary-by-topic): Don't use rmail-current-subject-regexp. X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5ea144f9c67b9194b54464faf7b7a707b040a385;p=emacs.git (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. --- diff --git a/lisp/mail/ChangeLog b/lisp/mail/ChangeLog index b10f263f695..4fb8bbae380 100644 --- a/lisp/mail/ChangeLog +++ b/lisp/mail/ChangeLog @@ -5,6 +5,10 @@ (rmail-summary-update-attribute): Deleted. (rmail-summary-update): Simple defun regenerates the entire summary line. + (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. * rmailkwd.el (rmail-set-label): Call rmail-summary-update at the end. diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el index fa85e2067ea..343d70b0553 100644 --- a/lisp/mail/rmailsum.el +++ b/lisp/mail/rmailsum.el @@ -143,8 +143,6 @@ SUBJECT is a string of regexps separated by commas." (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 @@ non-nil otherwise." (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)