]> git.eshelyaron.com Git - emacs.git/commitdiff
Trivial unrmail fix for empty input files.
authorGlenn Morris <rgm@gnu.org>
Fri, 6 Jan 2012 08:34:47 +0000 (00:34 -0800)
committerGlenn Morris <rgm@gnu.org>
Fri, 6 Jan 2012 08:34:47 +0000 (00:34 -0800)
* lisp/mail/unrmail.el (unrmail): Give an explicit error if the input
file has no messages.

Fixes: debbugs:10377
lisp/ChangeLog
lisp/mail/unrmail.el

index 186860c2b17f618d5d5e4746fd82137581dff8b8..ba9886a33e234ccb44f8a605db77c15b728a89fe 100644 (file)
@@ -1,5 +1,8 @@
 2012-01-06  Glenn Morris  <rgm@gnu.org>
 
+       * mail/unrmail.el (unrmail): Give an explicit error if the input file
+       has no messages.  (Bug#10377)
+
        * info.el (Info-mode-map): Bind e to end-of-buffer, rather
        than Info-edit.  (Bug#10385)
 
index 178b64f119104e072dd66c8faf1cf207aa3f10f2..929f97746b0734082aaa39b4d9547f2d52271276 100644 (file)
@@ -66,7 +66,8 @@ For example, invoke `emacs -batch -f batch-unrmail RMAIL'."
          from to)
       (goto-char (point-min))
       (search-forward "\n\^_" nil t)   ; Skip BABYL header.
-      (setq from (point))
+      (if (= (setq from (point)) (point-max))
+         (error "The input file contains no messages"))
       (goto-char (point-max))
       (search-backward "\n\^_" from 'mv)
       (setq to (point))