aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl Heuer1995-12-21 18:02:18 +0000
committerKarl Heuer1995-12-21 18:02:18 +0000
commit40e09f88122c5d8a7334e3493579a9a1da9536ed (patch)
tree76b5c7b0b2338c3586d4ab0be207f384d0f279eb
parent107e7c704585f029b34d6e3b9f33df619de1dbca (diff)
downloademacs-40e09f88122c5d8a7334e3493579a9a1da9536ed.tar.gz
emacs-40e09f88122c5d8a7334e3493579a9a1da9536ed.zip
(rmail-ignored-headers): Add resent-date, nntp-posting-host.
(rmail-retry-failure): Fix previous change. Combine variables mail-buffer and rmail-buffer. Look for an end-delimiter in case where the start-of-bounce delimiter looks like -- plus some more text. (rmail-search): Doc fix.
-rw-r--r--lisp/mail/rmail.el56
1 files changed, 41 insertions, 15 deletions
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 03d9a52b689..3e9ed328d51 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -67,7 +67,7 @@ value is the user's name.)
67It is useful to set this variable in the site customization file.") 67It is useful to set this variable in the site customization file.")
68 68
69;;;###autoload 69;;;###autoload
70(defvar rmail-ignored-headers "^via:\\|^mail-from:\\|^origin:\\|^status:\\|^received:\\|^x400-originator:\\|^x400-recipients:\\|^x400-received:\\|^x400-mts-identifier:\\|^x400-content-type:\\|^\\(resent-\\|\\)message-id:\\|^summary-line:" 70(defvar rmail-ignored-headers "^via:\\|^mail-from:\\|^origin:\\|^status:\\|^received:\\|^x400-originator:\\|^x400-recipients:\\|^x400-received:\\|^x400-mts-identifier:\\|^x400-content-type:\\|^\\(resent-\\|\\)message-id:\\|^summary-line:\\|^resent-date:\\|^nntp-posting-host:"
71 "*Regexp to match Header fields that Rmail should normally hide.") 71 "*Regexp to match Header fields that Rmail should normally hide.")
72 72
73;;;###autoload 73;;;###autoload
@@ -1727,7 +1727,7 @@ or forward if N is negative."
1727 1727
1728(defvar rmail-search-last-regexp nil) 1728(defvar rmail-search-last-regexp nil)
1729(defun rmail-search (regexp &optional n) 1729(defun rmail-search (regexp &optional n)
1730 "Show message containing next match for REGEXP. 1730 "Show message containing next match for REGEXP (but not the current msg).
1731Prefix argument gives repeat count; negative argument means search 1731Prefix argument gives repeat count; negative argument means search
1732backwards (through earlier messages). 1732backwards (through earlier messages).
1733Interactively, empty argument means use same regexp used last time." 1733Interactively, empty argument means use same regexp used last time."
@@ -2367,7 +2367,9 @@ The variable `rmail-retry-ignored-headers' is a regular expression
2367specifying headers which should not be copied into the new message." 2367specifying headers which should not be copied into the new message."
2368 (interactive) 2368 (interactive)
2369 (require 'mail-utils) 2369 (require 'mail-utils)
2370 (let (mail-buffer bounce-start bounce-end bounce-indent resending) 2370 (let ((rmail-buffer (current-buffer))
2371 (msgnum rmail-current-message)
2372 bounce-start bounce-end bounce-indent resending)
2371 (save-excursion 2373 (save-excursion
2372 ;; Narrow down to just the quoted original message 2374 ;; Narrow down to just the quoted original message
2373 (rmail-beginning-of-message) 2375 (rmail-beginning-of-message)
@@ -2377,7 +2379,6 @@ specifying headers which should not be copied into the new message."
2377 (buffer-substring (progn (beginning-of-line) (point)) 2379 (buffer-substring (progn (beginning-of-line) (point))
2378 (progn (end-of-line) (point))))) 2380 (progn (end-of-line) (point)))))
2379 (re-search-forward mail-unsent-separator) 2381 (re-search-forward mail-unsent-separator)
2380 (setq mail-buffer (current-buffer))
2381 (search-forward codestring) 2382 (search-forward codestring)
2382 (or (search-forward "\n\n" nil t) 2383 (or (search-forward "\n\n" nil t)
2383 (error "Cannot find end of Mime data in failed message")) 2384 (error "Cannot find end of Mime data in failed message"))
@@ -2404,25 +2405,50 @@ specifying headers which should not be copied into the new message."
2404 (setq bounce-end (point))) 2405 (setq bounce-end (point)))
2405 ;; One message contained a few random lines before the old 2406 ;; One message contained a few random lines before the old
2406 ;; message header. The first line of the message started with 2407 ;; message header. The first line of the message started with
2407 ;; two hyphens. A blank line follows these random lines. 2408 ;; two hyphens. A blank line followed these random lines.
2409 ;; The same line beginning with two hyphens was possibly
2410 ;; marking the end of the message.
2408 (if (looking-at "^--") 2411 (if (looking-at "^--")
2409 (progn 2412 (let ((boundary (buffer-substring-no-properties
2413 (point)
2414 (progn (end-of-line) (point)))))
2410 (search-forward "\n\n") 2415 (search-forward "\n\n")
2411 (skip-chars-forward "\n"))) 2416 (skip-chars-forward "\n")
2412 (setq bounce-start (point) 2417 (setq bounce-start (point))
2413 bounce-end (point-max)) 2418 (goto-char (point-max))
2419 (search-backward (concat "\n\n" boundary) bounce-start t)
2420 (setq bounce-end (point)))
2421 (setq bounce-start (point)
2422 bounce-end (point-max)))
2414 (or (search-forward "\n\n" nil t) 2423 (or (search-forward "\n\n" nil t)
2415 (error "Cannot find end of header in failed message"))) 2424 (error "Cannot find end of header in failed message"))
2416 (setq mail-buffer (current-buffer))))) 2425 ))))
2417 ;; Start sending a new message; default header fields from the original. 2426 ;; Start sending a new message; default header fields from the original.
2418 ;; Turn off the usual actions for initializing the message body 2427 ;; Turn off the usual actions for initializing the message body
2419 ;; because we want to get only the text from the failure message. 2428 ;; because we want to get only the text from the failure message.
2420 (let (mail-signature mail-setup-hook) 2429 (let ((action
2421 (if (rmail-start-mail nil nil nil nil nil mail-buffer) 2430 ;; This function will be called when the user sends the retry.
2431 ;; It will mark the bounce message as "retried".
2432 (function (lambda ()
2433 (let ((msgnum rmail-send-actions-rmail-msg-number))
2434 (save-excursion
2435 (set-buffer rmail-send-actions-rmail-buffer)
2436 (if msgnum
2437 (rmail-set-attribute "retried" t msgnum)))))))
2438 mail-signature mail-setup-hook)
2439 (if (rmail-start-mail nil nil nil nil nil rmail-buffer
2440 (list (list action)))
2422 ;; Insert original text as initial text of new draft message. 2441 ;; Insert original text as initial text of new draft message.
2423 (progn 2442 (progn
2443 ;; We keep the rmail buffer and message number in these
2444 ;; buffer-local vars in the sendmail buffer,
2445 ;; so that the rmail-only-expunge can relocate the message number.
2446 (make-local-variable 'rmail-send-actions-rmail-buffer)
2447 (make-local-variable 'rmail-send-actions-rmail-msg-number)
2448 (setq rmail-send-actions-rmail-buffer rmail-buffer)
2449 (setq rmail-send-actions-rmail-msg-number msgnum)
2424 (erase-buffer) 2450 (erase-buffer)
2425 (insert-buffer-substring mail-buffer bounce-start bounce-end) 2451 (insert-buffer-substring rmail-buffer bounce-start bounce-end)
2426 (goto-char (point-min)) 2452 (goto-char (point-min))
2427 (if bounce-indent 2453 (if bounce-indent
2428 (indent-rigidly (point-min) (point-max) bounce-indent)) 2454 (indent-rigidly (point-min) (point-max) bounce-indent))
@@ -2440,7 +2466,7 @@ specifying headers which should not be copied into the new message."
2440 (insert "BCC: " (user-login-name) "\n")))) 2466 (insert "BCC: " (user-login-name) "\n"))))
2441 (insert mail-header-separator) 2467 (insert mail-header-separator)
2442 (mail-position-on-field (if resending "Resent-To" "To") t) 2468 (mail-position-on-field (if resending "Resent-To" "To") t)
2443 (set-buffer mail-buffer) 2469 (set-buffer rmail-buffer)
2444 (rmail-beginning-of-message)))))) 2470 (rmail-beginning-of-message))))))
2445 2471
2446(defun rmail-summary-exists () 2472(defun rmail-summary-exists ()