diff options
| author | Richard M. Stallman | 1996-06-07 14:57:45 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-06-07 14:57:45 +0000 |
| commit | 8e8abef096a7817aeedfb96c843c65bf11315a2e (patch) | |
| tree | 56c2bc2ab7c9993125fe537ea31b8fc9e48aff36 /lisp | |
| parent | 6702f50da61233455f3b3bee2e734d72faf5935e (diff) | |
| download | emacs-8e8abef096a7817aeedfb96c843c65bf11315a2e.tar.gz emacs-8e8abef096a7817aeedfb96c843c65bf11315a2e.zip | |
(rmail-get-new-mail): If conversion to BABYL fails
for the default inboxes, rename them so they won't be tried again.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/mail/rmail.el | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 94bbf6ef15a..c2b994980a6 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el | |||
| @@ -899,7 +899,8 @@ It returns t if it got any new messages." | |||
| 899 | (make-backup-files (and make-backup-files (buffer-modified-p))) | 899 | (make-backup-files (and make-backup-files (buffer-modified-p))) |
| 900 | (buffer-read-only nil) | 900 | (buffer-read-only nil) |
| 901 | ;; Don't make undo records for what we do in getting mail. | 901 | ;; Don't make undo records for what we do in getting mail. |
| 902 | (buffer-undo-list t)) | 902 | (buffer-undo-list t) |
| 903 | success) | ||
| 903 | (goto-char (point-max)) | 904 | (goto-char (point-max)) |
| 904 | (skip-chars-backward " \t\n") ; just in case of brain damage | 905 | (skip-chars-backward " \t\n") ; just in case of brain damage |
| 905 | (delete-region (point) (point-max)) ; caused by require-final-newline | 906 | (delete-region (point) (point-max)) ; caused by require-final-newline |
| @@ -914,8 +915,22 @@ It returns t if it got any new messages." | |||
| 914 | (setq delete-files (rmail-insert-inbox-text rmail-inbox-list t))) | 915 | (setq delete-files (rmail-insert-inbox-text rmail-inbox-list t))) |
| 915 | ;; Scan the new text and convert each message to babyl format. | 916 | ;; Scan the new text and convert each message to babyl format. |
| 916 | (goto-char (point-min)) | 917 | (goto-char (point-min)) |
| 917 | (save-excursion | 918 | (unwind-protect |
| 918 | (setq new-messages (rmail-convert-to-babyl-format))) | 919 | (save-excursion |
| 920 | (setq new-messages (rmail-convert-to-babyl-format) | ||
| 921 | success t)) | ||
| 922 | ;; If we could not convert the file's inboxes, | ||
| 923 | ;; rename the files we tried to read | ||
| 924 | ;; so we won't over and over again. | ||
| 925 | (if (and (not file-name) (not success)) | ||
| 926 | (let ((files delete-files) | ||
| 927 | (count 0)) | ||
| 928 | (while files | ||
| 929 | (while (file-exists-p (format "RMAILOSE.%d" count)) | ||
| 930 | (setq count (1+ count))) | ||
| 931 | (rename-file (car files) | ||
| 932 | (format "RMAILOSE.%d" count)) | ||
| 933 | (setq files (cdr files)))))) | ||
| 919 | (or (zerop new-messages) | 934 | (or (zerop new-messages) |
| 920 | (let (success) | 935 | (let (success) |
| 921 | (widen) | 936 | (widen) |