changeset 27375:517cdf51989f

(rmail-digest-end-regexps): Variable replaces rmail-digest-end-regexp. Allows multiple regexps for detecting the end line. (undigestify-rmail-message): Corresponding changes.
author Richard M. Stallman <rms@gnu.org>
date Fri, 21 Jan 2000 02:04:16 +0000
parents 0f5edee5242b
children 674b7f75841e
files lisp/mail/undigest.el
diffstat 1 files changed, 21 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mail/undigest.el	Thu Jan 20 18:18:58 2000 +0000
+++ b/lisp/mail/undigest.el	Fri Jan 21 02:04:16 2000 +0000
@@ -30,12 +30,15 @@
 
 (require 'rmail)
 
-(defcustom rmail-digest-end-regexp (concat "End of.*Digest.*\n"
-					   (regexp-quote "*********") "*"
-					   "\\(\n------*\\)*")
-  "*Regexp matching the end of a digest message."
+(defcustom rmail-digest-end-regexps
+  (list (concat "End of.*Digest.*\n"
+		(regexp-quote "*********") "*"
+		"\\(\n------*\\)*")
+	(concat "End of.*\n"
+		(regexp-quote "*") "*"))
+  "*Regexps matching the end of a digest message."
   :group 'rmail
-  :type 'regexp)
+  :type '(repeat regexp))
 
 ;;;###autoload
 (defun undigestify-rmail-message ()
@@ -79,16 +82,19 @@
 				 (mail-fetch-field "From")))
 			   (error "Message is not a digest--bad header")))))
 		(save-excursion
-		  (goto-char (point-max))
-		  (skip-chars-backward " \t\n")
-		  (let (found)
-		    ;; compensate for broken un*x digestifiers.  Sigh Sigh.
-		    (while (and (> (point) start) (not found))
-		      (forward-line -1)
-		      (if (looking-at rmail-digest-end-regexp)
-			  (setq found t)))
-		    (if (not found)
-			(error "Message is not a digest--no end line"))))
+		  (let (found
+			(regexps rmail-digest-end-regexps))
+		    (while (and regexps (not found))
+		      (goto-char (point-max))
+		      (skip-chars-backward " \t\n")
+		      ;; compensate for broken un*x digestifiers.  Sigh Sigh.
+		      (while (and (> (point) start) (not found))
+			(forward-line -1)
+			(if (looking-at (car regexps))
+			    (setq found t))
+			(setq regexps (cdr regexps)))
+		    (unless found
+		      (error "Message is not a digest--no end line"))))
 		(re-search-forward (concat "^" (make-string 55 ?-) "-*\n*"))
 		(replace-match "\^_\^L\n0, unseen,,\n*** EOOH ***\n")
 		(save-restriction