changeset 36856:e11fd97820c0

2001-03-17 ShengHuo ZHU <zsh@cs.rochester.edu> * message.el (rmail-output): It is in rmailout.el not rmail.el. * message.el (message-forward): local-variable-p takes an extra argument in XEmacs. * message.el (message-forward-decoded-p): New variable. (message-forward-subject-author-subject): Use it. (message-make-forward-subject): Use it. (message-forward): Use it. * gnus-uu.el (gnus-uu-digest-mail-forward): Use it.
author ShengHuo ZHU <zsh@cs.rochester.edu>
date Sat, 17 Mar 2001 16:02:56 +0000
parents cfb2e5ed7527
children f6386773ce30
files lisp/gnus/ChangeLog lisp/gnus/gnus-uu.el lisp/gnus/message.el
diffstat 3 files changed, 41 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/gnus/ChangeLog	Fri Mar 16 21:51:12 2001 +0000
+++ b/lisp/gnus/ChangeLog	Sat Mar 17 16:02:56 2001 +0000
@@ -1,3 +1,17 @@
+2001-03-17  ShengHuo ZHU  <zsh@cs.rochester.edu>
+
+	* message.el (rmail-output): It is in rmailout.el not rmail.el.
+
+	* message.el (message-forward): local-variable-p takes an extra
+	argument in XEmacs.
+
+	* message.el (message-forward-decoded-p): New variable.
+	(message-forward-subject-author-subject): Use it.
+	(message-make-forward-subject): Use it.
+	(message-forward): Use it.
+	
+	* gnus-uu.el (gnus-uu-digest-mail-forward): Use it.
+
 2001-03-05  Dave Love  <fx@gnu.org>
 
 	* mm-util.el (mm-mime-mule-charset-alist): Fix utf-8 case.
--- a/lisp/gnus/gnus-uu.el	Fri Mar 16 21:51:12 2001 +0000
+++ b/lisp/gnus/gnus-uu.el	Sat Mar 17 16:02:56 2001 +0000
@@ -564,7 +564,8 @@
       (when (re-search-forward "^From:")
 	(delete-region (point) (gnus-point-at-eol))
 	(insert " " from))
-      (message-forward post t))
+      (let ((message-forward-decoded-p t))
+	(message-forward post t)))
     (setq gnus-uu-digest-from-subject nil)))
 
 (defun gnus-uu-digest-post-forward (&optional n)
--- a/lisp/gnus/message.el	Fri Mar 16 21:51:12 2001 +0000
+++ b/lisp/gnus/message.el	Sat Mar 17 16:02:56 2001 +0000
@@ -1059,7 +1059,7 @@
   (autoload 'gnus-request-post "gnus-int")
   (autoload 'gnus-alive-p "gnus-util")
   (autoload 'gnus-group-name-charset "gnus-group")
-  (autoload 'rmail-output "rmail"))
+  (autoload 'rmail-output "rmailout"))
 
 
 
@@ -4145,15 +4145,22 @@
 
 ;;; Forwarding messages.
 
+(defvar message-forward-decoded-p nil
+  "Non-nil means the original message is decoded.")
+
 (defun message-forward-subject-author-subject (subject)
   "Generate a SUBJECT for a forwarded message.
 The form is: [Source] Subject, where if the original message was mail,
 Source is the sender, and if the original message was news, Source is
 the list of newsgroups is was posted to."
   (concat "["
-	  (or (message-fetch-field
-	       (if (message-news-p) "newsgroups" "from"))
-	      "(nowhere)")
+	   (let ((prefix 
+		  (or (message-fetch-field
+		       (if (message-news-p) "newsgroups" "from"))
+		      "(nowhere)")))
+	     (if message-forward-decoded-p
+		 prefix
+	       (mail-decode-encoded-word-string prefix)))
 	  "] " subject))
 
 (defun message-forward-subject-fwd (subject)
@@ -4162,7 +4169,7 @@
 the message."
   (concat "Fwd: " subject))
 
-(defun message-make-forward-subject (&optional decoded)
+(defun message-make-forward-subject ()
   "Return a Subject header suitable for the message in the current buffer."
   (save-excursion
     (save-restriction
@@ -4171,7 +4178,7 @@
 	    (subject (message-fetch-field "Subject")))
 	(setq subject
 	      (if subject
-		  (if decoded 
+		  (if message-forward-decoded-p
 		      subject
 		    (mail-decode-encoded-word-string subject))
 		""))
@@ -4189,15 +4196,22 @@
 	  (setq funcs (cdr funcs)))
 	subject))))
 
+(eval-when-compile
+  (defvar gnus-article-decoded-p))
+
 ;;;###autoload
 (defun message-forward (&optional news digest)
   "Forward the current message via mail.
 Optional NEWS will use news to forward instead of mail.
 Optional DIGEST will use digest to forward."
   (interactive "P")
-  (let ((cur (current-buffer))
-	(subject (message-make-forward-subject digest))
-	art-beg)
+  (let* ((cur (current-buffer))
+	 (message-forward-decoded-p 
+	  (if (local-variable-p 'gnus-article-decoded-p (current-buffer))
+	      gnus-article-decoded-p  ;; In an article buffer.
+	    message-forward-decoded-p))
+	 (subject (message-make-forward-subject))
+	 art-beg)
     (if news
 	(message-news nil subject)
       (message-mail nil subject))
@@ -4218,7 +4232,8 @@
 	  (if message-forward-as-mime
 	      (insert-buffer-substring cur)
 	    (mml-insert-buffer cur))
-	(if message-forward-show-mml
+	(if (and message-forward-show-mml
+		 (not message-forward-decoded-p))
 	    (insert
 	     (with-temp-buffer
 	       (mm-disable-multibyte-mule4) ;; Must copy buffer in unibyte mode