changeset 21293:21de06ed5f74

(rmail-clear-headers): Handle failure to find "\n[^ \t]".
author Richard M. Stallman <rms@gnu.org>
date Thu, 26 Mar 1998 04:28:37 +0000
parents 5d62016adafd
children e010f1191668
files lisp/mail/rmail.el
diffstat 1 files changed, 18 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mail/rmail.el	Thu Mar 26 04:26:27 1998 +0000
+++ b/lisp/mail/rmail.el	Thu Mar 26 04:28:37 1998 +0000
@@ -1662,21 +1662,21 @@
     (let ((case-fold-search t)
 	  (buffer-read-only nil))
       (if (and rmail-displayed-headers (null ignored-headers))
-	(save-restriction
-	  (narrow-to-region (point-min) (point))
-	  (let (lim next)
-	    (goto-char (point-min))
-	    (while (and (not (eobp))
-			(save-excursion
-			  (if (re-search-forward "\n[^ \t]" nil t)
-			    (setq lim (match-beginning 0)
-				  next (1+ lim))
-			    (setq lim nil next (point-max)))))
-	      (if (save-excursion
-		    (re-search-forward rmail-displayed-headers lim t))
-		(goto-char next)
-		(delete-region (point) next))))
-	  (goto-char (point-min)))
+	  (save-restriction
+	    (narrow-to-region (point-min) (point))
+	    (let (lim next)
+	      (goto-char (point-min))
+	      (while (and (not (eobp))
+			  (save-excursion
+			    (if (re-search-forward "\n[^ \t]" nil t)
+				(setq lim (match-beginning 0)
+				      next (1+ lim))
+			      (setq lim nil next (point-max)))))
+		(if (save-excursion
+		      (re-search-forward rmail-displayed-headers lim t))
+		  (goto-char next)
+		  (delete-region (point) next))))
+	    (goto-char (point-min)))
 	(or ignored-headers (setq ignored-headers rmail-ignored-headers))
 	(save-restriction
 	  (narrow-to-region (point-min) (point))
@@ -1685,8 +1685,9 @@
 		   (re-search-forward ignored-headers nil t))
 	    (beginning-of-line)
 	    (delete-region (point)
-			   (progn (re-search-forward "\n[^ \t]")
-				  (1- (point))))))))))
+			   (if (re-search-forward "\n[^ \t]" nil t)
+			       (1- (point))
+			     (point-max)))))))))
 
 (defun rmail-msg-is-pruned ()
   (rmail-maybe-set-message-counters)