changeset 10970:c71d4c1319e4

(rmail-duplicate-message): New function. (rmail-retry-failure): Don't get errors when searching for `End of returned message'.
author Richard M. Stallman <rms@gnu.org>
date Sun, 12 Mar 1995 07:38:49 +0000
parents c66a0a2a7bb3
children d7f0852f800f
files lisp/mail/rmail.el
diffstat 1 files changed, 35 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mail/rmail.el	Sun Mar 12 06:11:27 1995 +0000
+++ b/lisp/mail/rmail.el	Sun Mar 12 07:38:49 1995 +0000
@@ -700,6 +700,36 @@
     (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."
@@ -2114,7 +2144,7 @@
          ;; 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)))))
-
+
 (defun rmail-forward (resend)
   "Forward the current message to another user.
 With prefix argument, \"resend\" the message instead of forwarding it;
@@ -2167,7 +2197,7 @@
 	    (insert-buffer-substring forward-buffer)
 	    (insert "------- End of forwarded message -------\n")
 	    (push-mark))))))
-
+
 (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
@@ -2238,7 +2268,7 @@
 	    (funcall send-mail-function)))
       (kill-buffer tembuf))
     (rmail-set-attribute "resent" t rmail-current-message)))
-
+
 (defvar mail-unsent-separator
   (concat "^ *---+ +Unsent message follows +---+ *$\\|"
 	  "^ *---+ +Returned message +---+ *$\\|"
@@ -2294,7 +2324,7 @@
 		  (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))
@@ -2342,21 +2372,7 @@
 	    (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)))
-
+
 (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."