(message-make-forward-subject-function): Changed default to
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Sat, 12 Apr 2003 22:00:39 +0000 (22:00 +0000)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Sat, 12 Apr 2003 22:00:39 +0000 (22:00 +0000)
message-forward-subject-name-subject.
(message-forward-subject-name-subject): New function.

lisp/ChangeLog
lisp/message.el

index d13ac69..acb5190 100644 (file)
@@ -2,6 +2,9 @@
 
        * message.el (message-newline-and-reformat): Place a boundary
        before filling.
+       (message-make-forward-subject-function): Changed default to
+       message-forward-subject-name-subject. 
+       (message-forward-subject-name-subject): New function.
 
        * nnimap.el (nnimap-split-fancy): Ditto.
 
index f182989..71dfef1 100644 (file)
@@ -432,7 +432,7 @@ If t, use `message-user-organization-file'."
   :group 'message-headers)
 
 (defcustom message-make-forward-subject-function
-  'message-forward-subject-author-subject
+  'message-forward-subject-name-subject
   "*List of functions called to generate subject headers for forwarded messages.
 The subject generated by the previous function is passed into each
 successive function.
@@ -441,6 +441,8 @@ The provided functions are:
 
 * `message-forward-subject-author-subject' (Source of article (author or
       newsgroup)), in brackets followed by the subject
+* `message-forward-subject-name-subject' (Source of article (name of author
+      or newsgroup)), in brackets followed by the subject
 * `message-forward-subject-fwd' (Subject of article with 'Fwd:' prepended
       to it."
   :group 'message-forwarding
@@ -5842,6 +5844,22 @@ the list of newsgroups is was posted to."
              (mail-decode-encoded-word-string prefix)))
          "] " subject))
 
+(defun message-forward-subject-name-subject (subject)
+  "Generate a SUBJECT for a forwarded message.
+The form is: [Source] Subject, where if the original message was mail,
+Source is the name of the sender, and if the original message was
+news, Source is the list of newsgroups is was posted to."
+  (concat "["
+         (let ((prefix
+                (or (message-fetch-field "newsgroups")
+                    (cdr
+                     (mail-header-parse-address (message-fetch-field "from")))
+                    "(nowhere)")))
+           (if message-forward-decoded-p
+               prefix
+             (mail-decode-encoded-word-string prefix)))
+         "] " subject))
+
 (defun message-forward-subject-fwd (subject)
   "Generate a SUBJECT for a forwarded message.
 The form is: Fwd: Subject, where Subject is the original subject of