emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/lisp/mail mail-utils.el


From: Glenn Morris
Subject: [Emacs-diffs] emacs/lisp/mail mail-utils.el
Date: Wed, 18 Feb 2009 04:35:02 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Glenn Morris <gm>       09/02/18 04:35:02

Modified files:
        lisp/mail      : mail-utils.el 

Log message:
        (mail-mbox-from): Move here from rmailout.el.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/mail/mail-utils.el?cvsroot=emacs&r1=1.71&r2=1.72

Patches:
Index: mail-utils.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/mail/mail-utils.el,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -b -r1.71 -r1.72
--- mail-utils.el       10 Feb 2009 03:39:41 -0000      1.71
+++ mail-utils.el       18 Feb 2009 04:35:02 -0000      1.72
@@ -386,6 +386,20 @@
            (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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]