aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Fox1993-09-21 07:34:20 +0000
committerBrian Fox1993-09-21 07:34:20 +0000
commit760a35286c14d3ce5c0ec84bf5e2adcc446ddebe (patch)
tree301f87102663ff96195194999e0c6d49bfec07f2
parent671e87b36d50a9cc9d0b30151eb962a481ceae0a (diff)
downloademacs-760a35286c14d3ce5c0ec84bf5e2adcc446ddebe.tar.gz
emacs-760a35286c14d3ce5c0ec84bf5e2adcc446ddebe.zip
(rmail-convert-file): If the file is empty, don't convert it after
inserting the BABYL header.
-rw-r--r--lisp/mail/rmail.el12
1 files changed, 9 insertions, 3 deletions
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 096723725d6..d8b11bf48bd 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -269,7 +269,11 @@ that file, but does not copy any new mail into the file."
269 ;; so we don't lose the Labels: file attribute, etc. 269 ;; so we don't lose the Labels: file attribute, etc.
270 (let ((buffer-read-only nil)) 270 (let ((buffer-read-only nil))
271 (insert "BABYL OPTIONS: -*- rmail -*-\n"))) 271 (insert "BABYL OPTIONS: -*- rmail -*-\n")))
272 ((equal (point-min) (point-max))
273 ;; Empty RMAIL file. Just insert the header.
274 (rmail-insert-rmail-file-header))
272 (t 275 (t
276 ;; Non-empty file in non-RMAIL format. Add header and convert.
273 (setq convert t) 277 (setq convert t)
274 (rmail-insert-rmail-file-header))) 278 (rmail-insert-rmail-file-header)))
275 ;; If file was not a Babyl file or if there are 279 ;; If file was not a Babyl file or if there are
@@ -292,8 +296,8 @@ that file, but does not copy any new mail into the file."
292 (rmail-convert-to-babyl-format) 296 (rmail-convert-to-babyl-format)
293 (message "Converting to Babyl format...done"))))) 297 (message "Converting to Babyl format...done")))))
294 298
295; I have checked that adding "-*- rmail -*-" to the BABYL OPTIONS line 299;;; I have checked that adding "-*- rmail -*-" to the BABYL OPTIONS line
296; will not cause emacs 18.55 problems. 300;;; will not cause emacs 18.55 problems.
297 301
298(defun rmail-insert-rmail-file-header () 302(defun rmail-insert-rmail-file-header ()
299 (let ((buffer-read-only nil)) 303 (let ((buffer-read-only nil))
@@ -1830,7 +1834,9 @@ see the documentation of `rmail-resend'."
1830 rmail-current-message))) 1834 rmail-current-message)))
1831 (save-excursion 1835 (save-excursion
1832 ;; Insert after header separator--before signature if any. 1836 ;; Insert after header separator--before signature if any.
1833 (search-forward-regexp (concat "^" mail-header-separator)) 1837 (goto-char (point-min))
1838 (search-forward-regexp
1839 (concat "^" (regexp-quote mail-header-separator)))
1834 (forward-line 1) 1840 (forward-line 1)
1835 (insert-buffer forward-buffer)))))) 1841 (insert-buffer forward-buffer))))))
1836 1842