diff options
| author | Richard M. Stallman | 2000-01-21 02:04:16 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2000-01-21 02:04:16 +0000 |
| commit | 5ea4b65bfe16cb7b22096418202da9963fb851d3 (patch) | |
| tree | 88ec22c222dd91c079885dc7cb18c40ca7f7f167 /lisp | |
| parent | 757081353df933080416901d87c28fc0237ab5ea (diff) | |
| download | emacs-5ea4b65bfe16cb7b22096418202da9963fb851d3.tar.gz emacs-5ea4b65bfe16cb7b22096418202da9963fb851d3.zip | |
(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')
| -rw-r--r-- | lisp/mail/undigest.el | 36 |
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 @@ | |||
| 30 | 30 | ||
| 31 | (require 'rmail) | 31 | (require 'rmail) |
| 32 | 32 | ||
| 33 | (defcustom rmail-digest-end-regexp (concat "End of.*Digest.*\n" | 33 | (defcustom rmail-digest-end-regexps |
| 34 | (regexp-quote "*********") "*" | 34 | (list (concat "End of.*Digest.*\n" |
| 35 | "\\(\n------*\\)*") | 35 | (regexp-quote "*********") "*" |
| 36 | "*Regexp matching the end of a digest message." | 36 | "\\(\n------*\\)*") |
| 37 | (concat "End of.*\n" | ||
| 38 | (regexp-quote "*") "*")) | ||
| 39 | "*Regexps matching the end of a digest message." | ||
| 37 | :group 'rmail | 40 | :group 'rmail |
| 38 | :type 'regexp) | 41 | :type '(repeat regexp)) |
| 39 | 42 | ||
| 40 | ;;;###autoload | 43 | ;;;###autoload |
| 41 | (defun undigestify-rmail-message () | 44 | (defun undigestify-rmail-message () |
| @@ -79,16 +82,19 @@ Leaves original message, deleted, before the undigestified messages." | |||
| 79 | (mail-fetch-field "From"))) | 82 | (mail-fetch-field "From"))) |
| 80 | (error "Message is not a digest--bad header"))))) | 83 | (error "Message is not a digest--bad header"))))) |
| 81 | (save-excursion | 84 | (save-excursion |
| 82 | (goto-char (point-max)) | 85 | (let (found |
| 83 | (skip-chars-backward " \t\n") | 86 | (regexps rmail-digest-end-regexps)) |
| 84 | (let (found) | 87 | (while (and regexps (not found)) |
| 85 | ;; compensate for broken un*x digestifiers. Sigh Sigh. | 88 | (goto-char (point-max)) |
| 86 | (while (and (> (point) start) (not found)) | 89 | (skip-chars-backward " \t\n") |
| 87 | (forward-line -1) | 90 | ;; compensate for broken un*x digestifiers. Sigh Sigh. |
| 88 | (if (looking-at rmail-digest-end-regexp) | 91 | (while (and (> (point) start) (not found)) |
| 89 | (setq found t))) | 92 | (forward-line -1) |
| 90 | (if (not found) | 93 | (if (looking-at (car regexps)) |
| 91 | (error "Message is not a digest--no end line")))) | 94 | (setq found t)) |
| 95 | (setq regexps (cdr regexps))) | ||
| 96 | (unless found | ||
| 97 | (error "Message is not a digest--no end line")))) | ||
| 92 | (re-search-forward (concat "^" (make-string 55 ?-) "-*\n*")) | 98 | (re-search-forward (concat "^" (make-string 55 ?-) "-*\n*")) |
| 93 | (replace-match "\^_\^L\n0, unseen,,\n*** EOOH ***\n") | 99 | (replace-match "\^_\^L\n0, unseen,,\n*** EOOH ***\n") |
| 94 | (save-restriction | 100 | (save-restriction |