From 665ae8654babc2e07a08d0b67a60b6e61007dc13 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Fri, 6 Jan 2012 00:34:47 -0800 Subject: Trivial unrmail fix for empty input files. * lisp/mail/unrmail.el (unrmail): Give an explicit error if the input file has no messages. Fixes: debbugs:10377 --- lisp/ChangeLog | 3 +++ lisp/mail/unrmail.el | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 186860c2b1..ba9886a33e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2012-01-06 Glenn Morris + * 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) diff --git a/lisp/mail/unrmail.el b/lisp/mail/unrmail.el index 178b64f119..929f97746b 100644 --- a/lisp/mail/unrmail.el +++ b/lisp/mail/unrmail.el @@ -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)) -- cgit v1.2.3