aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl Heuer1995-11-17 08:23:27 +0000
committerKarl Heuer1995-11-17 08:23:27 +0000
commite75e28533df3f5fdc61b49dd8df74380341fc0c0 (patch)
tree1e5e9d66a607bda211309d4eff6d1cb102c2c0b4
parent10aa933d49e7ae123e1b28c438f55e6aa084bc6f (diff)
downloademacs-e75e28533df3f5fdc61b49dd8df74380341fc0c0.tar.gz
emacs-e75e28533df3f5fdc61b49dd8df74380341fc0c0.zip
(rmail-retry-failure): Add missing colons in regexp.
Use " +", not " *", to check for indented text. Don't make a temp buffer; just record the indent amount. Simplify.
-rw-r--r--lisp/mail/rmail.el54
1 files changed, 23 insertions, 31 deletions
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index fed21ca86bc..633960f913e 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -2362,7 +2362,7 @@ The variable `rmail-retry-ignored-headers' is a regular expression
2362specifying headers which should not be copied into the new message." 2362specifying headers which should not be copied into the new message."
2363 (interactive) 2363 (interactive)
2364 (require 'mail-utils) 2364 (require 'mail-utils)
2365 (let (mail-buffer bounce-start bounce-end resending) 2365 (let (mail-buffer bounce-start bounce-end bounce-indent resending)
2366 (save-excursion 2366 (save-excursion
2367 ;; Narrow down to just the quoted original message 2367 ;; Narrow down to just the quoted original message
2368 (rmail-beginning-of-message) 2368 (rmail-beginning-of-message)
@@ -2389,36 +2389,26 @@ specifying headers which should not be copied into the new message."
2389 ;; Support a style of failure message in which the original 2389 ;; Support a style of failure message in which the original
2390 ;; message is indented, and included within lines saying 2390 ;; message is indented, and included within lines saying
2391 ;; `Start of returned message' and `End of returned message'. 2391 ;; `Start of returned message' and `End of returned message'.
2392 (if (looking-at " *Received:") 2392 (if (looking-at " +Received:")
2393 (let (column) 2393 (progn
2394 (setq bounce-start (point))
2394 (skip-chars-forward " ") 2395 (skip-chars-forward " ")
2395 (setq column (current-column)) 2396 (setq bounce-indent (- (current-column)))
2396 (let ((old-buffer (current-buffer))) 2397 (goto-char (point-max))
2397 (set-buffer (get-buffer-create " rmail retry temp")) 2398 (re-search-backward "^End of returned message$" nil t)
2398 (insert-buffer old-buffer) 2399 (setq bounce-end (point)))
2399 (goto-char (point-max)) 2400 ;; One message contained a few random lines before the old
2400 (if (re-search-backward "^End of returned message$" nil t) 2401 ;; message header. The first line of the message started with
2401 (delete-region (point) (point-max))) 2402 ;; two hyphens. A blank line follows these random lines.
2402 (indent-rigidly (point-min) (point-max) (- column)) 2403 (if (looking-at "^--")
2403 (goto-char (point-min)) 2404 (progn
2404 (re-search-forward mail-unsent-separator nil t)))) 2405 (search-forward "\n\n")
2405 (save-restriction 2406 (skip-chars-forward "\n")))
2406 (let ((old-end (point-max))) 2407 (setq bounce-start (point)
2407 ;; One message contained a few random lines before the old 2408 bounce-end (point-max))
2408 ;; message header. The first line of the message started with 2409 (or (search-forward "\n\n" nil t)
2409 ;; two hyphens. A blank line follows these random lines. 2410 (error "Cannot find end of header in failed message")))
2410 (skip-chars-forward "\n") 2411 (setq mail-buffer (current-buffer)))))
2411 (if (looking-at "^--")
2412 (progn
2413 (search-forward "\n\n")
2414 (skip-chars-forward "\n")))
2415 (beginning-of-line)
2416 (narrow-to-region (point) (point-max))
2417 (setq mail-buffer (current-buffer)
2418 bounce-start (point)
2419 bounce-end (point-max))
2420 (or (search-forward "\n\n" nil t)
2421 (error "Cannot find end of header in failed message")))))))
2422 ;; Start sending a new message; default header fields from the original. 2412 ;; Start sending a new message; default header fields from the original.
2423 ;; Turn off the usual actions for initializing the message body 2413 ;; Turn off the usual actions for initializing the message body
2424 ;; because we want to get only the text from the failure message. 2414 ;; because we want to get only the text from the failure message.
@@ -2429,8 +2419,10 @@ specifying headers which should not be copied into the new message."
2429 (erase-buffer) 2419 (erase-buffer)
2430 (insert-buffer-substring mail-buffer bounce-start bounce-end) 2420 (insert-buffer-substring mail-buffer bounce-start bounce-end)
2431 (goto-char (point-min)) 2421 (goto-char (point-min))
2422 (if bounce-indent
2423 (indent-rigidly (point-min) (point-max) bounce-indent))
2432 (rmail-clear-headers rmail-retry-ignored-headers) 2424 (rmail-clear-headers rmail-retry-ignored-headers)
2433 (rmail-clear-headers "^sender:\\|^from\\|^return-path") 2425 (rmail-clear-headers "^sender:\\|^from:\\|^return-path:")
2434 (goto-char (point-min)) 2426 (goto-char (point-min))
2435 (save-restriction 2427 (save-restriction
2436 (search-forward "\n\n") 2428 (search-forward "\n\n")