Mercurial > emacs
comparison lisp/mail/rmail.el @ 5274:89b71a85be3e
(rmail-quit): Expunge without updating summary.
(rmail-resend): Delete more than one Sender,
but only in the headers, not in the body.
(rmail-resend): Doc fix.
(rmail): Doc fix.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 23 Dec 1993 03:24:31 +0000 |
parents | 3fb665ab94c1 |
children | 2c747b081be1 |
comparison
equal
deleted
inserted
replaced
5273:59fee4967e01 | 5274:89b71a85be3e |
---|---|
196 "Read and edit incoming mail. | 196 "Read and edit incoming mail. |
197 Moves messages into file named by `rmail-file-name' (a babyl format file) | 197 Moves messages into file named by `rmail-file-name' (a babyl format file) |
198 and edits that file in RMAIL Mode. | 198 and edits that file in RMAIL Mode. |
199 Type \\[describe-mode] once editing that file, for a list of RMAIL commands. | 199 Type \\[describe-mode] once editing that file, for a list of RMAIL commands. |
200 | 200 |
201 May be called with filename as argument; then performs rmail editing on | 201 May be called with file name as argument; then performs rmail editing on |
202 that file, but does not copy any new mail into the file." | 202 that file, but does not copy any new mail into the file. |
203 Interactively, if you supply a prefix argument, then you | |
204 have a chance to specify a file name with the minibuffer." | |
203 (interactive (if current-prefix-arg | 205 (interactive (if current-prefix-arg |
204 (list (read-file-name "Run rmail on RMAIL file: " | 206 (list (read-file-name "Run rmail on RMAIL file: " |
205 nil nil t)))) | 207 nil nil t)))) |
206 (or rmail-last-file | 208 (or rmail-last-file |
207 (setq rmail-last-file (expand-file-name "~/xmail"))) | 209 (setq rmail-last-file (expand-file-name "~/xmail"))) |
1854 (forward-line 1) | 1856 (forward-line 1) |
1855 (insert-buffer forward-buffer)))))) | 1857 (insert-buffer forward-buffer)))))) |
1856 | 1858 |
1857 (defun rmail-resend (address &optional from comment mail-alias-file) | 1859 (defun rmail-resend (address &optional from comment mail-alias-file) |
1858 "Resend current message to ADDRESSES. | 1860 "Resend current message to ADDRESSES. |
1859 ADDRESSES should be a single address, a a string consisting of several | 1861 ADDRESSES should be a single address, a string consisting of several |
1860 addresses separated by commas, or a list of addresses. | 1862 addresses separated by commas, or a list of addresses. |
1861 | 1863 |
1862 Optional FROM is the address to resend the message from, and | 1864 Optional FROM is the address to resend the message from, and |
1863 defaults to the username of the person redistributing the message. | 1865 defaults to the username of the person redistributing the message. |
1864 Optional COMMENT is a string that will be inserted as a comment in the | 1866 Optional COMMENT is a string that will be inserted as a comment in the |
1878 ;;>> Copy message into temp buffer | 1880 ;;>> Copy message into temp buffer |
1879 (set-buffer tembuf) | 1881 (set-buffer tembuf) |
1880 (insert-buffer-substring mailbuf) | 1882 (insert-buffer-substring mailbuf) |
1881 (goto-char (point-min)) | 1883 (goto-char (point-min)) |
1882 ;; Delete any Sender field, since that's not specifyable. | 1884 ;; Delete any Sender field, since that's not specifyable. |
1883 (if (re-search-forward "^Sender:" nil t) | 1885 ; Only delete Sender fields in the actual header. |
1884 (let (beg) | 1886 (re-search-forward "^$" nil 'move) |
1885 (beginning-of-line) | 1887 ; Using "while" here rather than "if" because some buggy mail |
1886 (setq beg (point)) | 1888 ; software may have inserted multiple Sender fields. |
1887 (forward-line 1) | 1889 (while (re-search-backward "^Sender:" nil t) |
1888 (while (looking-at "[ \t]") | 1890 (let (beg) |
1889 (forward-line 1)) | 1891 (setq beg (point)) |
1890 (delete-region beg (point)))) | 1892 (forward-line 1) |
1893 (while (looking-at "[ \t]") | |
1894 (forward-line 1)) | |
1895 (delete-region beg (point)))) | |
1896 ; Go back to the beginning of the buffer so the Resent- fields | |
1897 ; are inserted there. | |
1898 (goto-char (point-min)) | |
1891 ;;>> Insert resent-from: | 1899 ;;>> Insert resent-from: |
1892 (insert "Resent-From: " from "\n") | 1900 (insert "Resent-From: " from "\n") |
1893 (insert "Resent-Date: " (mail-rfc822-date) "\n") | 1901 (insert "Resent-Date: " (mail-rfc822-date) "\n") |
1894 ;;>> Insert resent-to: and bcc if need be. | 1902 ;;>> Insert resent-to: and bcc if need be. |
1895 (let ((before (point))) | 1903 (let ((before (point))) |
1927 "^|? *---+ +Message text follows: +---+ *|?$")) | 1935 "^|? *---+ +Message text follows: +---+ *|?$")) |
1928 | 1936 |
1929 (defun rmail-retry-failure () | 1937 (defun rmail-retry-failure () |
1930 "Edit a mail message which is based on the contents of the current message. | 1938 "Edit a mail message which is based on the contents of the current message. |
1931 For a message rejected by the mail system, extract the interesting headers and | 1939 For a message rejected by the mail system, extract the interesting headers and |
1932 the body of the original message; otherwise copy the current message." | 1940 the body of the original message." |
1933 (interactive) | 1941 (interactive) |
1934 (require 'mail-utils) | 1942 (require 'mail-utils) |
1935 (let (to subj irp2 cc orig-message) | 1943 (let (to subj irp2 cc orig-message) |
1936 (save-excursion | 1944 (save-excursion |
1937 ;; Narrow down to just the quoted original message | 1945 ;; Narrow down to just the quoted original message |