From: Brian Fox Date: Tue, 21 Sep 1993 07:34:20 +0000 (+0000) Subject: (rmail-convert-file): If the file is empty, don't convert it after X-Git-Tag: emacs-19.34~11087 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=760a35286c14d3ce5c0ec84bf5e2adcc446ddebe;p=emacs.git (rmail-convert-file): If the file is empty, don't convert it after inserting the BABYL header. --- 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." ;; so we don't lose the Labels: file attribute, etc. (let ((buffer-read-only nil)) (insert "BABYL OPTIONS: -*- rmail -*-\n"))) + ((equal (point-min) (point-max)) + ;; Empty RMAIL file. Just insert the header. + (rmail-insert-rmail-file-header)) (t + ;; Non-empty file in non-RMAIL format. Add header and convert. (setq convert t) (rmail-insert-rmail-file-header))) ;; 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." (rmail-convert-to-babyl-format) (message "Converting to Babyl format...done"))))) -; I have checked that adding "-*- rmail -*-" to the BABYL OPTIONS line -; will not cause emacs 18.55 problems. +;;; I have checked that adding "-*- rmail -*-" to the BABYL OPTIONS line +;;; will not cause emacs 18.55 problems. (defun rmail-insert-rmail-file-header () (let ((buffer-read-only nil)) @@ -1830,7 +1834,9 @@ see the documentation of `rmail-resend'." rmail-current-message))) (save-excursion ;; Insert after header separator--before signature if any. - (search-forward-regexp (concat "^" mail-header-separator)) + (goto-char (point-min)) + (search-forward-regexp + (concat "^" (regexp-quote mail-header-separator))) (forward-line 1) (insert-buffer forward-buffer))))))