diff lisp/vm/vm-reply.el @ 136:b980b6286996 r20-2b2

Import from CVS: tag r20-2b2
author cvs
date Mon, 13 Aug 2007 09:31:12 +0200
parents 1370575f1259
children 585fb297b004
line wrap: on
line diff
--- a/lisp/vm/vm-reply.el	Mon Aug 13 09:30:13 2007 +0200
+++ b/lisp/vm/vm-reply.el	Mon Aug 13 09:31:12 2007 +0200
@@ -344,6 +344,10 @@
   (let ((b (current-buffer)))
     (vm-mail-send)
     (cond ((null (buffer-name b)) ;; dead buffer
+	   ;; This improves window configuration behavior in
+	   ;; XEmacs.  It avoids taking the folder buffer from
+	   ;; one frame and attaching it to the selected frame.
+	   (set-buffer (window-buffer (selected-window)))
 	   (vm-display nil nil '(vm-mail-send-and-exit)
 		       '(vm-mail-send-and-exit
 			 reading-message
@@ -440,13 +444,13 @@
 	   (vm-mail-mark-forwarded))
 	  ((eq vm-system-state 'redistributing)
 	   (vm-mail-mark-redistributed)))
+    (vm-display nil nil '(vm-mail-send) '(vm-mail-send))
     ;; be careful, something could have killed the composition
     ;; buffer inside mail-send.
     (if (eq (current-buffer) composition-buffer)
 	(progn
 	  (vm-rename-current-mail-buffer)
-	  (vm-keep-mail-buffer (current-buffer))))
-    (vm-display nil nil '(vm-mail-send) '(vm-mail-send))))
+	  (vm-keep-mail-buffer (current-buffer))))))
 
 (defun vm-mail-mode-get-header-contents (header-name-regexp)
   (let ((contents nil)
@@ -612,7 +616,8 @@
   (vm-select-folder-buffer)
   (vm-check-for-killed-summary)
   (vm-error-if-folder-empty)
-  (if (eq last-command 'vm-next-command-uses-marks)
+  (if (and (eq last-command 'vm-next-command-uses-marks)
+	   (cdr (vm-select-marked-or-prefixed-messages 0)))
       (let ((vm-digest-send-type vm-forwarding-digest-type))
 	(setq this-command 'vm-next-command-uses-marks)
 	(command-execute 'vm-send-digest))
@@ -620,8 +625,8 @@
 	  (miming (and vm-send-using-mime
 		       (equal vm-forwarding-digest-type "mime")))
 	  mail-buffer
-	  header-end boundary
-	  (mp vm-message-pointer))
+	  header-end
+	  (mp (vm-select-marked-or-prefixed-messages 1)))
       (save-restriction
 	(widen)
 	(vm-mail-internal
@@ -648,15 +653,13 @@
 	  (goto-char (match-end 0))
 	  (setq header-end (match-beginning 0)))
 	(cond ((equal vm-forwarding-digest-type "mime")
-	       (setq boundary (vm-mime-encapsulate-messages
-			       (list (car mp)) vm-forwarded-headers
-			       vm-unforwarded-header-regexp))
+	       (vm-mime-encapsulate-messages (list (car mp))
+					     vm-forwarded-headers
+					     vm-unforwarded-header-regexp
+					     nil)
 	       (goto-char header-end)
 	       (insert "MIME-Version: 1.0\n")
-	       (insert (if vm-mime-avoid-folding-content-type
-			   "Content-Type: multipart/digest; boundary=\""
-			 "Content-Type: multipart/digest;\n\tboundary=\"")
-		       boundary "\"\n")
+	       (insert "Content-Type: message/rfc822\n")
 	       (insert "Content-Transfer-Encoding: "
 		       (vm-determine-proper-content-transfer-encoding
 			(point)
@@ -678,9 +681,7 @@
 	  (let ((b (current-buffer)))
 	    (set-buffer mail-buffer)
 	    (mail-text)
-	    (vm-mime-attach-object b "multipart/digest"
-				   (list (concat "boundary=\""
-						 boundary "\"")) nil t)
+	    (vm-mime-attach-object b "message/rfc822" nil nil t)
 	    (add-hook 'kill-buffer-hook
 		      (list 'lambda ()
 			    (list 'if (list 'eq mail-buffer '(current-buffer))
@@ -755,10 +756,10 @@
 The current message will be copied to a Mail mode buffer and you
 can edit the message and send it as usual.
 
-NOTE: since you are doing a resend, a Resent-To header is
-provided for you to fill in.  If you don't fill it in, when you
-send the message it will go to the original recipients listed in
-the To and Cc headers.  You may also create a Resent-Cc header."
+NOTE: since you are doing a resend, a Resent-To header is provided
+for you to fill in the new recipient list.  If you don't fill in
+this header, what happens when you send the message is undefined.
+You may also create a Resent-Cc header."
   (interactive)
   (vm-follow-summary-cursor)
   (vm-select-folder-buffer)
@@ -855,7 +856,8 @@
       (cond ((equal vm-digest-send-type "mime")
 	     (setq boundary (vm-mime-encapsulate-messages
 			     mlist vm-mime-digest-headers
-			     vm-mime-digest-discard-header-regexp))
+			     vm-mime-digest-discard-header-regexp
+			     t))
 	     (goto-char header-end)
 	     (insert "MIME-Version: 1.0\n")
 	     (insert (if vm-mime-avoid-folding-content-type
@@ -877,18 +879,6 @@
 	      vm-rfc1153-digest-discard-header-regexp)))
       (goto-char start)
       (setq mp mlist)
-      (if prefix
-	  (progn
-	    (message "Building digest preamble...")
-	    (while mp
-	      (let ((vm-summary-uninteresting-senders nil))
-		(insert (vm-sprintf 'vm-digest-preamble-format (car mp)) "\n"))
-	      (if vm-digest-center-preamble
-		  (progn
-		    (forward-char -1)
-		    (center-line)
-		    (forward-char 1)))
-	      (setq mp (cdr mp)))))
       (if miming
 	  (let ((b (current-buffer)))
 	    (set-buffer mail-buffer)
@@ -900,6 +890,22 @@
 		      (list 'lambda ()
 			    (list 'if (list 'eq mail-buffer '(current-buffer))
 				  (list 'kill-buffer b))))))
+      (if prefix
+	  (save-excursion
+	    (message "Building digest preamble...")
+	    (if miming
+		(progn
+		  (set-buffer mail-buffer)
+		  (mail-text)))
+	    (while mp
+	      (let ((vm-summary-uninteresting-senders nil))
+		(insert (vm-sprintf 'vm-digest-preamble-format (car mp)) "\n"))
+	      (if vm-digest-center-preamble
+		  (progn
+		    (forward-char -1)
+		    (center-line)
+		    (forward-char 1)))
+	      (setq mp (cdr mp)))))
       (mail-position-on-field "To")
       (message "Building %s digest... done" vm-digest-send-type)))
   (run-hooks 'vm-send-digest-hook)