annotate lisp/mail/undigest.el @ 15127:654bc3990b4d

(gud-display-line): Switch to gud buffer before calling gud-find-file.
author Richard M. Stallman <rms@gnu.org>
date Thu, 02 May 1996 21:20:55 +0000
parents 836ae8d0998d
children fb91eb76bead
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
657
fec3f9a1e3e5 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 35
diff changeset
1 ;;; undigest.el --- digest-cracking support for the RMAIL mail reader
fec3f9a1e3e5 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 35
diff changeset
2
14734
20f4c4a078b2 Comment change.
Richard M. Stallman <rms@gnu.org>
parents: 14677
diff changeset
3 ;; Copyright (C) 1985, 1986, 1994, 1996 Free Software Foundation, Inc.
841
2cdce064065f entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 814
diff changeset
4
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 657
diff changeset
5 ;; Maintainer: FSF
814
38b2499cb3e9 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 807
diff changeset
6 ;; Keywords: mail
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 657
diff changeset
7
35
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
8 ;; This file is part of GNU Emacs.
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
9
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
11 ;; it under the terms of the GNU General Public License as published by
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 657
diff changeset
12 ;; the Free Software Foundation; either version 2, or (at your option)
35
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
13 ;; any later version.
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
14
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
15 ;; GNU Emacs is distributed in the hope that it will be useful,
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
18 ;; GNU General Public License for more details.
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
19
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
20 ;; You should have received a copy of the GNU General Public License
14169
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13088
diff changeset
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13088
diff changeset
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13088
diff changeset
23 ;; Boston, MA 02111-1307, USA.
35
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
24
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 657
diff changeset
25 ;;; Commentary:
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 657
diff changeset
26
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 657
diff changeset
27 ;; See Internet RFC 934
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 657
diff changeset
28
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 657
diff changeset
29 ;;; Code:
35
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
30
7038
e640d438df9a (undigestify-rmail-message): Update summary buffer.
Karl Heuer <kwzh@gnu.org>
parents: 841
diff changeset
31 (require 'rmail)
e640d438df9a (undigestify-rmail-message): Update summary buffer.
Karl Heuer <kwzh@gnu.org>
parents: 841
diff changeset
32
35
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
33 (defun undigestify-rmail-message ()
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
34 "Break up a digest message into its constituent messages.
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
35 Leaves original message, deleted, before the undigestified messages."
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
36 (interactive)
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
37 (widen)
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
38 (let ((buffer-read-only nil)
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
39 (msg-string (buffer-substring (rmail-msgbeg rmail-current-message)
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
40 (rmail-msgend rmail-current-message))))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
41 (goto-char (rmail-msgend rmail-current-message))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
42 (narrow-to-region (point) (point))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
43 (insert msg-string)
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
44 (narrow-to-region (point-min) (1- (point-max))))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
45 (let ((error t)
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
46 (buffer-read-only nil))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
47 (unwind-protect
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
48 (progn
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
49 (save-restriction
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
50 (goto-char (point-min))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
51 (delete-region (point-min)
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
52 (progn (search-forward "\n*** EOOH ***\n")
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
53 (point)))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
54 (insert "\^_\^L\n0, unseen,,\n*** EOOH ***\n")
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
55 (narrow-to-region (point)
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
56 (point-max))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
57 (let* ((fill-prefix "")
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
58 (case-fold-search t)
13080
21a1494b450c (undigestify-rmail-message): Scan back as far as start
Richard M. Stallman <rms@gnu.org>
parents: 11498
diff changeset
59 start
35
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
60 (digest-name
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
61 (mail-strip-quoted-names
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
62 (or (save-restriction
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
63 (search-forward "\n\n")
13080
21a1494b450c (undigestify-rmail-message): Scan back as far as start
Richard M. Stallman <rms@gnu.org>
parents: 11498
diff changeset
64 (setq start (point))
35
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
65 (narrow-to-region (point-min) (point))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
66 (goto-char (point-max))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
67 (or (mail-fetch-field "Reply-To")
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
68 (mail-fetch-field "To")
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
69 (mail-fetch-field "Apparently-To")
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
70 (mail-fetch-field "From")))
13088
d383abe2f9f3 (undigestify-rmail-message): Better error messages.
Richard M. Stallman <rms@gnu.org>
parents: 13080
diff changeset
71 (error "Message is not a digest--bad header")))))
35
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
72 (save-excursion
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
73 (goto-char (point-max))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
74 (skip-chars-backward " \t\n")
13080
21a1494b450c (undigestify-rmail-message): Scan back as far as start
Richard M. Stallman <rms@gnu.org>
parents: 11498
diff changeset
75 (let (found)
35
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
76 ;; compensate for broken un*x digestifiers. Sigh Sigh.
13080
21a1494b450c (undigestify-rmail-message): Scan back as far as start
Richard M. Stallman <rms@gnu.org>
parents: 11498
diff changeset
77 (while (and (> (point) start) (not found))
35
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
78 (forward-line -1)
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
79 (if (looking-at (concat "End of.*Digest.*\n"
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
80 (regexp-quote "*********") "*"
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
81 "\\(\n------*\\)*"))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
82 (setq found t)))
13088
d383abe2f9f3 (undigestify-rmail-message): Better error messages.
Richard M. Stallman <rms@gnu.org>
parents: 13080
diff changeset
83 (if (not found)
d383abe2f9f3 (undigestify-rmail-message): Better error messages.
Richard M. Stallman <rms@gnu.org>
parents: 13080
diff changeset
84 (error "Message is not a digest--no end line"))))
35
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
85 (re-search-forward (concat "^" (make-string 55 ?-) "-*\n*"))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
86 (replace-match "\^_\^L\n0, unseen,,\n*** EOOH ***\n")
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
87 (save-restriction
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
88 (narrow-to-region (point)
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
89 (progn (search-forward "\n\n")
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
90 (point)))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
91 (if (mail-fetch-field "To") nil
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
92 (goto-char (point-min))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
93 (insert "To: " digest-name "\n")))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
94 (while (re-search-forward
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
95 (concat "\n\n" (make-string 27 ?-) "-*\n*")
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
96 nil t)
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
97 (replace-match "\n\n\^_\^L\n0, unseen,,\n*** EOOH ***\n")
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
98 (save-restriction
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
99 (if (looking-at "End ")
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
100 (insert "To: " digest-name "\n\n")
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
101 (narrow-to-region (point)
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
102 (progn (search-forward "\n\n"
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
103 nil 'move)
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
104 (point))))
11498
da7bbadf9999 (undigestify-rmail-message): Strip "^- " which is
Richard M. Stallman <rms@gnu.org>
parents: 7300
diff changeset
105 (if (mail-fetch-field "To")
da7bbadf9999 (undigestify-rmail-message): Strip "^- " which is
Richard M. Stallman <rms@gnu.org>
parents: 7300
diff changeset
106 nil
35
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
107 (goto-char (point-min))
11498
da7bbadf9999 (undigestify-rmail-message): Strip "^- " which is
Richard M. Stallman <rms@gnu.org>
parents: 7300
diff changeset
108 (insert "To: " digest-name "\n")))
da7bbadf9999 (undigestify-rmail-message): Strip "^- " which is
Richard M. Stallman <rms@gnu.org>
parents: 7300
diff changeset
109 ;; Digestifiers may insert `- ' on lines that start with `-'.
da7bbadf9999 (undigestify-rmail-message): Strip "^- " which is
Richard M. Stallman <rms@gnu.org>
parents: 7300
diff changeset
110 ;; Undo that.
da7bbadf9999 (undigestify-rmail-message): Strip "^- " which is
Richard M. Stallman <rms@gnu.org>
parents: 7300
diff changeset
111 (save-excursion
da7bbadf9999 (undigestify-rmail-message): Strip "^- " which is
Richard M. Stallman <rms@gnu.org>
parents: 7300
diff changeset
112 (goto-char (point-min))
da7bbadf9999 (undigestify-rmail-message): Strip "^- " which is
Richard M. Stallman <rms@gnu.org>
parents: 7300
diff changeset
113 (if (re-search-forward
da7bbadf9999 (undigestify-rmail-message): Strip "^- " which is
Richard M. Stallman <rms@gnu.org>
parents: 7300
diff changeset
114 "\n\n----------------------------*\n*"
da7bbadf9999 (undigestify-rmail-message): Strip "^- " which is
Richard M. Stallman <rms@gnu.org>
parents: 7300
diff changeset
115 nil t)
da7bbadf9999 (undigestify-rmail-message): Strip "^- " which is
Richard M. Stallman <rms@gnu.org>
parents: 7300
diff changeset
116 (let ((end (point-marker)))
da7bbadf9999 (undigestify-rmail-message): Strip "^- " which is
Richard M. Stallman <rms@gnu.org>
parents: 7300
diff changeset
117 (goto-char (point-min))
da7bbadf9999 (undigestify-rmail-message): Strip "^- " which is
Richard M. Stallman <rms@gnu.org>
parents: 7300
diff changeset
118 (while (re-search-forward "^- " end t)
da7bbadf9999 (undigestify-rmail-message): Strip "^- " which is
Richard M. Stallman <rms@gnu.org>
parents: 7300
diff changeset
119 (delete-char -2)))))
da7bbadf9999 (undigestify-rmail-message): Strip "^- " which is
Richard M. Stallman <rms@gnu.org>
parents: 7300
diff changeset
120 )))
35
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
121 (setq error nil)
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
122 (message "Message successfully undigestified")
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
123 (let ((n rmail-current-message))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
124 (rmail-forget-messages)
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
125 (rmail-show-message n)
7038
e640d438df9a (undigestify-rmail-message): Update summary buffer.
Karl Heuer <kwzh@gnu.org>
parents: 841
diff changeset
126 (rmail-delete-forward)
e640d438df9a (undigestify-rmail-message): Update summary buffer.
Karl Heuer <kwzh@gnu.org>
parents: 841
diff changeset
127 (if (rmail-summary-exists)
e640d438df9a (undigestify-rmail-message): Update summary buffer.
Karl Heuer <kwzh@gnu.org>
parents: 841
diff changeset
128 (rmail-select-summary
e640d438df9a (undigestify-rmail-message): Update summary buffer.
Karl Heuer <kwzh@gnu.org>
parents: 841
diff changeset
129 (rmail-update-summary)))))
35
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
130 (cond (error
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
131 (narrow-to-region (point-min) (1+ (point-max)))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
132 (delete-region (point-min) (point-max))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
133 (rmail-show-message rmail-current-message))))))
63b375f17a65 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
134
14630
584eb99710a6 (unforward-rmail-message): New command.
Karl Heuer <kwzh@gnu.org>
parents: 14169
diff changeset
135 (defun unforward-rmail-message ()
584eb99710a6 (unforward-rmail-message): New command.
Karl Heuer <kwzh@gnu.org>
parents: 14169
diff changeset
136 "Extract a forwarded message from the containing message.
584eb99710a6 (unforward-rmail-message): New command.
Karl Heuer <kwzh@gnu.org>
parents: 14169
diff changeset
137 This puts the forwarded message into a separate rmail message
584eb99710a6 (unforward-rmail-message): New command.
Karl Heuer <kwzh@gnu.org>
parents: 14169
diff changeset
138 following the containing message."
584eb99710a6 (unforward-rmail-message): New command.
Karl Heuer <kwzh@gnu.org>
parents: 14169
diff changeset
139 (interactive)
584eb99710a6 (unforward-rmail-message): New command.
Karl Heuer <kwzh@gnu.org>
parents: 14169
diff changeset
140 (narrow-to-region (rmail-msgbeg rmail-current-message)
584eb99710a6 (unforward-rmail-message): New command.
Karl Heuer <kwzh@gnu.org>
parents: 14169
diff changeset
141 (rmail-msgend rmail-current-message))
584eb99710a6 (unforward-rmail-message): New command.
Karl Heuer <kwzh@gnu.org>
parents: 14169
diff changeset
142 (goto-char (point-min))
584eb99710a6 (unforward-rmail-message): New command.
Karl Heuer <kwzh@gnu.org>
parents: 14169
diff changeset
143 (let (beg end (buffer-read-only nil) msg-string who-forwarded-it)
584eb99710a6 (unforward-rmail-message): New command.
Karl Heuer <kwzh@gnu.org>
parents: 14169
diff changeset
144 (setq who-forwarded-it (mail-fetch-field "From"))
14655
8246444fbe55 (unforward-rmail-message): Handle any kind of forwarding delimiters.
Richard M. Stallman <rms@gnu.org>
parents: 14630
diff changeset
145 (if (re-search-forward "^----" nil t)
8246444fbe55 (unforward-rmail-message): Handle any kind of forwarding delimiters.
Richard M. Stallman <rms@gnu.org>
parents: 14630
diff changeset
146 nil
14630
584eb99710a6 (unforward-rmail-message): New command.
Karl Heuer <kwzh@gnu.org>
parents: 14169
diff changeset
147 (error "No forwarded message"))
14655
8246444fbe55 (unforward-rmail-message): Handle any kind of forwarding delimiters.
Richard M. Stallman <rms@gnu.org>
parents: 14630
diff changeset
148 (forward-line 1)
8246444fbe55 (unforward-rmail-message): Handle any kind of forwarding delimiters.
Richard M. Stallman <rms@gnu.org>
parents: 14630
diff changeset
149 (setq beg (point))
8246444fbe55 (unforward-rmail-message): Handle any kind of forwarding delimiters.
Richard M. Stallman <rms@gnu.org>
parents: 14630
diff changeset
150 (if (re-search-forward "^----" nil t)
14630
584eb99710a6 (unforward-rmail-message): New command.
Karl Heuer <kwzh@gnu.org>
parents: 14169
diff changeset
151 (setq end (match-beginning 0))
584eb99710a6 (unforward-rmail-message): New command.
Karl Heuer <kwzh@gnu.org>
parents: 14169
diff changeset
152 (error "No terminator for forwarded message"))
584eb99710a6 (unforward-rmail-message): New command.
Karl Heuer <kwzh@gnu.org>
parents: 14169
diff changeset
153 (widen)
584eb99710a6 (unforward-rmail-message): New command.
Karl Heuer <kwzh@gnu.org>
parents: 14169
diff changeset
154 (setq msg-string (buffer-substring beg end))
584eb99710a6 (unforward-rmail-message): New command.
Karl Heuer <kwzh@gnu.org>
parents: 14169
diff changeset
155 (goto-char (rmail-msgend rmail-current-message))
584eb99710a6 (unforward-rmail-message): New command.
Karl Heuer <kwzh@gnu.org>
parents: 14169
diff changeset
156 (narrow-to-region (point) (point))
584eb99710a6 (unforward-rmail-message): New command.
Karl Heuer <kwzh@gnu.org>
parents: 14169
diff changeset
157 (insert "\^_\^L\n0, unseen,,\n*** EOOH ***\n")
584eb99710a6 (unforward-rmail-message): New command.
Karl Heuer <kwzh@gnu.org>
parents: 14169
diff changeset
158 (narrow-to-region (point) (point))
584eb99710a6 (unforward-rmail-message): New command.
Karl Heuer <kwzh@gnu.org>
parents: 14169
diff changeset
159 (insert "Forwarded-by: " who-forwarded-it "\n")
584eb99710a6 (unforward-rmail-message): New command.
Karl Heuer <kwzh@gnu.org>
parents: 14169
diff changeset
160 (insert msg-string)
584eb99710a6 (unforward-rmail-message): New command.
Karl Heuer <kwzh@gnu.org>
parents: 14169
diff changeset
161 (goto-char (point-min))
584eb99710a6 (unforward-rmail-message): New command.
Karl Heuer <kwzh@gnu.org>
parents: 14169
diff changeset
162 (while (not (eobp))
584eb99710a6 (unforward-rmail-message): New command.
Karl Heuer <kwzh@gnu.org>
parents: 14169
diff changeset
163 (if (looking-at "- ")
584eb99710a6 (unforward-rmail-message): New command.
Karl Heuer <kwzh@gnu.org>
parents: 14169
diff changeset
164 (delete-region (point) (+ 2 (point))))
584eb99710a6 (unforward-rmail-message): New command.
Karl Heuer <kwzh@gnu.org>
parents: 14169
diff changeset
165 (forward-line 1))
584eb99710a6 (unforward-rmail-message): New command.
Karl Heuer <kwzh@gnu.org>
parents: 14169
diff changeset
166 (let ((n rmail-current-message))
584eb99710a6 (unforward-rmail-message): New command.
Karl Heuer <kwzh@gnu.org>
parents: 14169
diff changeset
167 (rmail-forget-messages)
584eb99710a6 (unforward-rmail-message): New command.
Karl Heuer <kwzh@gnu.org>
parents: 14169
diff changeset
168 (rmail-show-message n)
584eb99710a6 (unforward-rmail-message): New command.
Karl Heuer <kwzh@gnu.org>
parents: 14169
diff changeset
169 (if (rmail-summary-exists)
584eb99710a6 (unforward-rmail-message): New command.
Karl Heuer <kwzh@gnu.org>
parents: 14169
diff changeset
170 (rmail-select-summary
584eb99710a6 (unforward-rmail-message): New command.
Karl Heuer <kwzh@gnu.org>
parents: 14169
diff changeset
171 (rmail-update-summary))))))
584eb99710a6 (unforward-rmail-message): New command.
Karl Heuer <kwzh@gnu.org>
parents: 14169
diff changeset
172
657
fec3f9a1e3e5 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 35
diff changeset
173 ;;; undigest.el ends here