diff lisp/gnus/message.el @ 22:8fc7fe29b841 r19-15b94

Import from CVS: tag r19-15b94
author cvs
date Mon, 13 Aug 2007 08:50:29 +0200
parents d95e72db5c07
children 4103f0995bd7
line wrap: on
line diff
--- a/lisp/gnus/message.el	Mon Aug 13 08:50:06 2007 +0200
+++ b/lisp/gnus/message.el	Mon Aug 13 08:50:29 2007 +0200
@@ -247,6 +247,7 @@
 (defvar gnus-local-organization)
 (defcustom message-user-organization 
   (or (and (boundp 'gnus-local-organization)
+	   (stringp gnus-local-organization)
 	   gnus-local-organization)
       (getenv "ORGANIZATION")
       t)
@@ -583,7 +584,7 @@
     'message-mail 'message-send-and-exit 
     'message-kill-buffer 'message-send-hook))
 
-(defvar message-delete-mh-headers t
+(defvar message-mh-deletable-headers '(Message-ID Date Lines Sender)
   "If non-nil, delete the deletable headers before feeding to mh.")
 
 ;;; Internal variables.
@@ -794,9 +795,9 @@
 		 (setq paren nil))))
 	(nreverse elems)))))
 
-(defun message-fetch-field (header)
+(defun message-fetch-field (header &optional not-all)
   "The same as `mail-fetch-field', only remove all newlines."
-  (let ((value (mail-fetch-field header nil t)))
+  (let ((value (mail-fetch-field header nil (not not-all))))
     (when value
       (nnheader-replace-chars-in-string value ?\n ? ))))
 
@@ -1052,10 +1053,10 @@
   (kill-all-local-variables)
   (make-local-variable 'message-reply-buffer)
   (setq message-reply-buffer nil)
-  (make-local-variable 'message-send-actions)
-  (make-local-variable 'message-exit-actions)
-  (make-local-variable 'message-kill-actions)
-  (make-local-variable 'message-postpone-actions)
+  (set (make-local-variable 'message-send-actions) nil)
+  (set (make-local-variable 'message-exit-actions) nil)
+  (set (make-local-variable 'message-kill-actions) nil)
+  (set (make-local-variable 'message-postpone-actions) nil)
   (set-syntax-table message-mode-syntax-table)
   (use-local-map message-mode-map)
   (setq local-abbrev-table message-mode-abbrev-table)
@@ -1766,8 +1767,8 @@
 		       "msg."))))
     (setq buffer-file-name name)
     ;; MH wants to generate these headers itself.
-    (when message-delete-mh-headers
-      (let ((headers message-deletable-headers))
+    (when message-mh-deletable-headers
+      (let ((headers message-mh-deletable-headers))
 	(while headers
 	  (goto-char (point-min)) 
 	  (and (re-search-forward 
@@ -1945,7 +1946,7 @@
    ;; Check the Message-ID header.
    (message-check 'message-id
      (let* ((case-fold-search t)
-	    (message-id (message-fetch-field "message-id")))
+	    (message-id (message-fetch-field "message-id" t)))
        (or (not message-id)
 	   (and (string-match "@" message-id)
 		(string-match "@[^\\.]*\\." message-id))
@@ -2840,7 +2841,7 @@
 	    mct (message-fetch-field "mail-copies-to")
 	    reply-to (unless ignore-reply-to (message-fetch-field "reply-to"))
 	    references (message-fetch-field "references")
-	    message-id (message-fetch-field "message-id"))
+	    message-id (message-fetch-field "message-id" t))
       ;; Remove any (buggy) Re:'s that are present and make a
       ;; proper one.
       (when (string-match "^[ \t]*[Rr][Ee]:[ \t]*" subject)
@@ -2875,6 +2876,9 @@
 	      (insert (prog1 (rmail-dont-reply-to (buffer-string))
 			(erase-buffer)))
 	      (goto-char (point-min))
+	      ;; Perhaps Mail-Copies-To: never removed the only address?
+	      (when (eobp)
+		(insert (or reply-to from "")))
 	      (setq ccalist
 		    (mapcar
 		     (lambda (addr)
@@ -2938,7 +2942,7 @@
 	    date (message-fetch-field "date") 
 	    subject (or (message-fetch-field "subject") "none")
 	    references (message-fetch-field "references")
-	    message-id (message-fetch-field "message-id")
+	    message-id (message-fetch-field "message-id" t)
 	    followup-to (message-fetch-field "followup-to")
 	    newsgroups (message-fetch-field "newsgroups")
 	    reply-to (message-fetch-field "reply-to")
@@ -3034,7 +3038,7 @@
 	  (message-narrow-to-head)
 	  (setq from (message-fetch-field "from")
 		newsgroups (message-fetch-field "newsgroups")
-		message-id (message-fetch-field "message-id")
+		message-id (message-fetch-field "message-id" t)
 		distribution (message-fetch-field "distribution")))
 	;; Make sure that this article was written by the user.
 	(unless (string-equal