Mercurial > emacs
comparison lisp/mail/undigest.el @ 27360:7d643cf235ad
(rmail-digest-end-regexp): New user option.
(undigestify-rmail-message): Use it.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Tue, 18 Jan 2000 21:30:05 +0000 |
parents | 7be5edf3710f |
children | 517cdf51989f |
comparison
equal
deleted
inserted
replaced
27359:3fcd19033f0c | 27360:7d643cf235ad |
---|---|
27 ;; See Internet RFC 934 | 27 ;; See Internet RFC 934 |
28 | 28 |
29 ;;; Code: | 29 ;;; Code: |
30 | 30 |
31 (require 'rmail) | 31 (require 'rmail) |
32 | |
33 (defcustom rmail-digest-end-regexp (concat "End of.*Digest.*\n" | |
34 (regexp-quote "*********") "*" | |
35 "\\(\n------*\\)*") | |
36 "*Regexp matching the end of a digest message." | |
37 :group 'rmail | |
38 :type 'regexp) | |
32 | 39 |
33 ;;;###autoload | 40 ;;;###autoload |
34 (defun undigestify-rmail-message () | 41 (defun undigestify-rmail-message () |
35 "Break up a digest message into its constituent messages. | 42 "Break up a digest message into its constituent messages. |
36 Leaves original message, deleted, before the undigestified messages." | 43 Leaves original message, deleted, before the undigestified messages." |
76 (skip-chars-backward " \t\n") | 83 (skip-chars-backward " \t\n") |
77 (let (found) | 84 (let (found) |
78 ;; compensate for broken un*x digestifiers. Sigh Sigh. | 85 ;; compensate for broken un*x digestifiers. Sigh Sigh. |
79 (while (and (> (point) start) (not found)) | 86 (while (and (> (point) start) (not found)) |
80 (forward-line -1) | 87 (forward-line -1) |
81 (if (looking-at (concat "End of.*Digest.*\n" | 88 (if (looking-at rmail-digest-end-regexp) |
82 (regexp-quote "*********") "*" | |
83 "\\(\n------*\\)*")) | |
84 (setq found t))) | 89 (setq found t))) |
85 (if (not found) | 90 (if (not found) |
86 (error "Message is not a digest--no end line")))) | 91 (error "Message is not a digest--no end line")))) |
87 (re-search-forward (concat "^" (make-string 55 ?-) "-*\n*")) | 92 (re-search-forward (concat "^" (make-string 55 ?-) "-*\n*")) |
88 (replace-match "\^_\^L\n0, unseen,,\n*** EOOH ***\n") | 93 (replace-match "\^_\^L\n0, unseen,,\n*** EOOH ***\n") |