]> git.eshelyaron.com Git - emacs.git/commitdiff
(mail-mbox-from): Move here from rmailout.el.
authorGlenn Morris <rgm@gnu.org>
Wed, 18 Feb 2009 04:35:18 +0000 (04:35 +0000)
committerGlenn Morris <rgm@gnu.org>
Wed, 18 Feb 2009 04:35:18 +0000 (04:35 +0000)
lisp/ChangeLog
lisp/mail/mail-utils.el

index 66fe7df65ebab21129d86c2bd88de5306e27a416..9590f39c9f72376d4241c8d0cf0a5dd6bd23b8d4 100644 (file)
@@ -1,3 +1,41 @@
+2009-02-18  Glenn Morris  <rgm@gnu.org>
+
+       * 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  <rms@gnu.org>
 
        * mail/rmailmsc.el (set-rmail-inbox-list): Doc fix.
index 9c607cb4f4c837983347b7f0b00ac73d1496c6a3..e988cba707375a48c4531576399296a8dfd722a6 100644 (file)
@@ -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