From 1bfadfb2a18929223212c66538e8e039c395e7d3 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 18 Feb 2009 04:35:18 +0000 Subject: [PATCH] (mail-mbox-from): Move here from rmailout.el. --- lisp/ChangeLog | 38 ++++++++++++++++++++++++++++++++++++++ lisp/mail/mail-utils.el | 14 ++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 66fe7df65eb..9590f39c9f7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,41 @@ +2009-02-18 Glenn Morris + + * mail/rmail-spam-filter.el (rmail-summary-mode-map): Remove unneeded + declaration. + (top-level): No need for cl now. + (rmail-spam-filter, rmail-use-spam-filter, rsf-file, rsf-no-blind-cc) + (rsf-beep, rsf-sleep-after-message, rsf-min-region-to-spam-list) + (rsf-autosave-newly-added-definitions, rsf-white-list) + (rsf-definitions-alist, rsf-check-field, rsf-add-subject-to-spam-list) + (rsf-add-sender-to-spam-list, rsf-add-region-to-spam-list) + (rsf-customize-spam-definitions, rsf-customize-group) + (rsf-custom-save-all, rsf-add-content-type-field): Doc fixes. + (rsf-check-field): Use setcar and setcdr rather than setf. + (rmail-spam-filter): Simplify. + (rsf-add-subject-to-spam-list, rsf-add-sender-to-spam-list) + (rsf-add-region-to-spam-list): Use rmail-get-header or + buffer-substring-no-properties. Regexp-quote the extracted data. + Make the messages less verbose. + (rmail-summary-mode-map, rmail-mode-map): Use easy-menu and dolist to + simplify things. + (rsf-add-content-type-field): Make the message less verbose. + + * mail/rmail.el (rmail-get-new-mail-1): Fix the spam beep test. + (rmail-get-new-mail-filter-spam): Simplify. Don't mess with + rmail-deleted-vector. + (rmail-insert-inbox-text, rmail-collect-deleted) + (rmail-set-message-deleted-p, rmail-only-expunge) + (rmail-make-in-reply-to-field): Replace ?\ with ?\s. + (rmail-get-labels): Remove unused local `blurb'. + (rmail-message-attr-p, rmail-message-unseen-p, rmail-message-labels-p) + (rmail-msgend, rmail-msgbeg, rmail-message-deleted-p) + (rmail-set-message-deleted-p): Doc fixes. + + * mail/rmailout.el (rmail-mbox-from): Move to mail-utils. + Update callers for associated name change. + * mail/mail-utils.el (mail-mbox-from): Move here from rmailout.el. + * mail/unrmail.el (unrmail): Use mail-mbox-from. + 2009-02-17 Richard M Stallman * mail/rmailmsc.el (set-rmail-inbox-list): Doc fix. diff --git a/lisp/mail/mail-utils.el b/lisp/mail/mail-utils.el index 9c607cb4f4c..e988cba7073 100644 --- a/lisp/mail/mail-utils.el +++ b/lisp/mail/mail-utils.el @@ -386,6 +386,20 @@ matches may be returned from the message body." (substring s (match-beginning 3) (match-end 3)) " " (mail-rfc822-time-zone time)))) +(defun mail-mbox-from () + "Return an mbox \"From \" line for the current message. +The buffer should be narrowed to just the header." + (let ((from (or (mail-fetch-field "from") + (mail-fetch-field "really-from") + (mail-fetch-field "sender") + "unknown")) + (date (mail-fetch-field "date"))) + (format "From %s %s\n" (mail-strip-quoted-names from) + (or (and date + (ignore-errors + (current-time-string (date-to-time date)))) + (current-time-string))))) + (provide 'mail-utils) ;; arch-tag: b24aec2f-fd65-4ceb-9e39-3cc2827036fd -- 2.39.5