(replace-buffer-in-windows obuf)
(bury-buffer obuf)))
+(defun rmail-bury ()
+ "Bury current Rmail buffer and its summary buffer."
+ (interactive)
+ ;; This let var was called rmail-buffer, but that interfered
+ ;; with the buffer-local var used in summary buffers.
+ (let ((buffer-to-bury (current-buffer)))
+ (if (rmail-summary-exists)
+ (let (window)
+ (while (setq window (get-buffer-window rmail-summary-buffer))
+ (set-window-buffer window (other-buffer rmail-summary-buffer)))
+ (bury-buffer rmail-summary-buffer)))
+ (switch-to-buffer (other-buffer (current-buffer)))
+ (bury-buffer buffer-to-bury)))
+
+(defun rmail-duplicate-message ()
+ "Create a duplicated copy of the current message.
+The duplicate copy goes into the Rmail file just after the
+original copy."
+ (interactive)
+ (widen)
+ (let ((buffer-read-only nil)
+ (number rmail-current-message)
+ (string (buffer-substring (rmail-msgbeg rmail-current-message)
+ (rmail-msgend rmail-current-message))))
+ (goto-char (rmail-msgend rmail-current-message))
+ (insert string)
+ (rmail-forget-messages)
+ (rmail-show-message number)
+ (message "Message duplicated")))
+
;;;###autoload
(defun rmail-input (filename)
"Run Rmail on file FILENAME."
;; If we can't kludge it simply, do it correctly
(let ((mail-use-rfc822 t))
(rmail-make-in-reply-to-field from date message-id)))))
-
+\f
(defun rmail-forward (resend)
"Forward the current message to another user.
With prefix argument, \"resend\" the message instead of forwarding it;
(insert-buffer-substring forward-buffer)
(insert "------- End of forwarded message -------\n")
(push-mark))))))
-
+\f
(defun rmail-resend (address &optional from comment mail-alias-file)
"Resend current message to ADDRESSES.
ADDRESSES should be a single address, a string consisting of several
(funcall send-mail-function)))
(kill-buffer tembuf))
(rmail-set-attribute "resent" t rmail-current-message)))
-
+\f
(defvar mail-unsent-separator
(concat "^ *---+ +Unsent message follows +---+ *$\\|"
"^ *---+ +Returned message +---+ *$\\|"
(set-buffer (get-buffer-create " rmail retry temp"))
(insert-buffer old-buffer)
(goto-char (point-max))
- (if (re-search-backward "^End of returned message$")
+ (if (re-search-backward "^End of returned message$" nil t)
(delete-region (point) (point-max)))
(indent-rigidly (point-min) (point-max) (- column))
(goto-char (point-min))
(mail-position-on-field (if resending "Resent-To" "To") t)
(set-buffer mail-buffer)
(rmail-beginning-of-message))))))
-
-(defun rmail-bury ()
- "Bury current Rmail buffer and its summary buffer."
- (interactive)
- ;; This let var was called rmail-buffer, but that interfered
- ;; with the buffer-local var used in summary buffers.
- (let ((buffer-to-bury (current-buffer)))
- (if (rmail-summary-exists)
- (let (window)
- (while (setq window (get-buffer-window rmail-summary-buffer))
- (set-window-buffer window (other-buffer rmail-summary-buffer)))
- (bury-buffer rmail-summary-buffer)))
- (switch-to-buffer (other-buffer (current-buffer)))
- (bury-buffer buffer-to-bury)))
-
+\f
(defun rmail-summary-exists ()
"Non-nil iff in an RMAIL buffer and an associated summary buffer exists.
In fact, the non-nil value returned is the summary buffer itself."