aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1995-03-12 07:38:49 +0000
committerRichard M. Stallman1995-03-12 07:38:49 +0000
commita16aef1565fbf7511e4693f78fd58126d0d69227 (patch)
treee715b3a4f66bcfc5a0a090e0df5dcd16105f8fc2
parentdf8bde8ba52f1a13f049fa6fd57ebb6f753f9016 (diff)
downloademacs-a16aef1565fbf7511e4693f78fd58126d0d69227.tar.gz
emacs-a16aef1565fbf7511e4693f78fd58126d0d69227.zip
(rmail-duplicate-message): New function.
(rmail-retry-failure): Don't get errors when searching for `End of returned message'.
-rw-r--r--lisp/mail/rmail.el54
1 files changed, 35 insertions, 19 deletions
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 46bec6db657..d5f094c4edd 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -700,6 +700,36 @@ Instead, these commands are available:
700 (replace-buffer-in-windows obuf) 700 (replace-buffer-in-windows obuf)
701 (bury-buffer obuf))) 701 (bury-buffer obuf)))
702 702
703(defun rmail-bury ()
704 "Bury current Rmail buffer and its summary buffer."
705 (interactive)
706 ;; This let var was called rmail-buffer, but that interfered
707 ;; with the buffer-local var used in summary buffers.
708 (let ((buffer-to-bury (current-buffer)))
709 (if (rmail-summary-exists)
710 (let (window)
711 (while (setq window (get-buffer-window rmail-summary-buffer))
712 (set-window-buffer window (other-buffer rmail-summary-buffer)))
713 (bury-buffer rmail-summary-buffer)))
714 (switch-to-buffer (other-buffer (current-buffer)))
715 (bury-buffer buffer-to-bury)))
716
717(defun rmail-duplicate-message ()
718 "Create a duplicated copy of the current message.
719The duplicate copy goes into the Rmail file just after the
720original copy."
721 (interactive)
722 (widen)
723 (let ((buffer-read-only nil)
724 (number rmail-current-message)
725 (string (buffer-substring (rmail-msgbeg rmail-current-message)
726 (rmail-msgend rmail-current-message))))
727 (goto-char (rmail-msgend rmail-current-message))
728 (insert string)
729 (rmail-forget-messages)
730 (rmail-show-message number)
731 (message "Message duplicated")))
732
703;;;###autoload 733;;;###autoload
704(defun rmail-input (filename) 734(defun rmail-input (filename)
705 "Run Rmail on file FILENAME." 735 "Run Rmail on file FILENAME."
@@ -2114,7 +2144,7 @@ use \\[mail-yank-original] to yank the original message into it."
2114 ;; If we can't kludge it simply, do it correctly 2144 ;; If we can't kludge it simply, do it correctly
2115 (let ((mail-use-rfc822 t)) 2145 (let ((mail-use-rfc822 t))
2116 (rmail-make-in-reply-to-field from date message-id))))) 2146 (rmail-make-in-reply-to-field from date message-id)))))
2117 2147
2118(defun rmail-forward (resend) 2148(defun rmail-forward (resend)
2119 "Forward the current message to another user. 2149 "Forward the current message to another user.
2120With prefix argument, \"resend\" the message instead of forwarding it; 2150With prefix argument, \"resend\" the message instead of forwarding it;
@@ -2167,7 +2197,7 @@ see the documentation of `rmail-resend'."
2167 (insert-buffer-substring forward-buffer) 2197 (insert-buffer-substring forward-buffer)
2168 (insert "------- End of forwarded message -------\n") 2198 (insert "------- End of forwarded message -------\n")
2169 (push-mark)))))) 2199 (push-mark))))))
2170 2200
2171(defun rmail-resend (address &optional from comment mail-alias-file) 2201(defun rmail-resend (address &optional from comment mail-alias-file)
2172 "Resend current message to ADDRESSES. 2202 "Resend current message to ADDRESSES.
2173ADDRESSES should be a single address, a string consisting of several 2203ADDRESSES should be a single address, a string consisting of several
@@ -2238,7 +2268,7 @@ typically for purposes of moderating a list."
2238 (funcall send-mail-function))) 2268 (funcall send-mail-function)))
2239 (kill-buffer tembuf)) 2269 (kill-buffer tembuf))
2240 (rmail-set-attribute "resent" t rmail-current-message))) 2270 (rmail-set-attribute "resent" t rmail-current-message)))
2241 2271
2242(defvar mail-unsent-separator 2272(defvar mail-unsent-separator
2243 (concat "^ *---+ +Unsent message follows +---+ *$\\|" 2273 (concat "^ *---+ +Unsent message follows +---+ *$\\|"
2244 "^ *---+ +Returned message +---+ *$\\|" 2274 "^ *---+ +Returned message +---+ *$\\|"
@@ -2294,7 +2324,7 @@ specifying headers which should not be copied into the new message."
2294 (set-buffer (get-buffer-create " rmail retry temp")) 2324 (set-buffer (get-buffer-create " rmail retry temp"))
2295 (insert-buffer old-buffer) 2325 (insert-buffer old-buffer)
2296 (goto-char (point-max)) 2326 (goto-char (point-max))
2297 (if (re-search-backward "^End of returned message$") 2327 (if (re-search-backward "^End of returned message$" nil t)
2298 (delete-region (point) (point-max))) 2328 (delete-region (point) (point-max)))
2299 (indent-rigidly (point-min) (point-max) (- column)) 2329 (indent-rigidly (point-min) (point-max) (- column))
2300 (goto-char (point-min)) 2330 (goto-char (point-min))
@@ -2342,21 +2372,7 @@ specifying headers which should not be copied into the new message."
2342 (mail-position-on-field (if resending "Resent-To" "To") t) 2372 (mail-position-on-field (if resending "Resent-To" "To") t)
2343 (set-buffer mail-buffer) 2373 (set-buffer mail-buffer)
2344 (rmail-beginning-of-message)))))) 2374 (rmail-beginning-of-message))))))
2345 2375
2346(defun rmail-bury ()
2347 "Bury current Rmail buffer and its summary buffer."
2348 (interactive)
2349 ;; This let var was called rmail-buffer, but that interfered
2350 ;; with the buffer-local var used in summary buffers.
2351 (let ((buffer-to-bury (current-buffer)))
2352 (if (rmail-summary-exists)
2353 (let (window)
2354 (while (setq window (get-buffer-window rmail-summary-buffer))
2355 (set-window-buffer window (other-buffer rmail-summary-buffer)))
2356 (bury-buffer rmail-summary-buffer)))
2357 (switch-to-buffer (other-buffer (current-buffer)))
2358 (bury-buffer buffer-to-bury)))
2359
2360(defun rmail-summary-exists () 2376(defun rmail-summary-exists ()
2361 "Non-nil iff in an RMAIL buffer and an associated summary buffer exists. 2377 "Non-nil iff in an RMAIL buffer and an associated summary buffer exists.
2362In fact, the non-nil value returned is the summary buffer itself." 2378In fact, the non-nil value returned is the summary buffer itself."