summaryrefslogtreecommitdiff
path: root/lisp/mail/undigest.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2000-01-21 02:04:16 +0000
committerRichard M. Stallman <rms@gnu.org>2000-01-21 02:04:16 +0000
commit992d6f18ab5e470fe2703c49b355db2bf430c8df (patch)
tree8e624e5303e884ceb99ce605d6541f466cb461d4 /lisp/mail/undigest.el
parentef87dadf27281dd5c7d2be7660446e37a0a3dc65 (diff)
downloademacs-992d6f18ab5e470fe2703c49b355db2bf430c8df.tar.gz
(rmail-digest-end-regexps): Variable replaces rmail-digest-end-regexp.
Allows multiple regexps for detecting the end line. (undigestify-rmail-message): Corresponding changes.
Diffstat (limited to 'lisp/mail/undigest.el')
-rw-r--r--lisp/mail/undigest.el36
1 files changed, 21 insertions, 15 deletions
diff --git a/lisp/mail/undigest.el b/lisp/mail/undigest.el
index a85d280022d..bb03205981c 100644
--- a/lisp/mail/undigest.el
+++ b/lisp/mail/undigest.el
@@ -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 @@ Leaves original message, deleted, before the undigestified messages."
(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