annotate lisp/mail/rmailout.el @ 2594:e1277aec1738

(gud-format-command): Fix %f expansuuin to send ondly the basename of files to gdb.
author Eric S. Raymond <esr@snark.thyrsus.com>
date Tue, 27 Apr 1993 21:59:46 +0000
parents a712cff3b6e7
children 67f34b0bc2d1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
658
7cbd4fcd8b0f *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 202
diff changeset
1 ;;; rmailout.el --- "RMAIL" mail reader for Emacs: output message to a file.
7cbd4fcd8b0f *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 202
diff changeset
2
845
213978acbc1e entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 814
diff changeset
3 ;; Copyright (C) 1985, 1987 Free Software Foundation, Inc.
213978acbc1e entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 814
diff changeset
4
788
c8d4eb38ebfc *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 713
diff changeset
5 ;; Maintainer: FSF
814
38b2499cb3e9 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 807
diff changeset
6 ;; Keywords: mail
788
c8d4eb38ebfc *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 713
diff changeset
7
63
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
8 ;; This file is part of GNU Emacs.
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
9
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
714e88ef93c8 Initial revision
root <root>
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: 788
diff changeset
12 ;; the Free Software Foundation; either version 2, or (at your option)
63
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
13 ;; any later version.
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
14
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
15 ;; GNU Emacs is distributed in the hope that it will be useful,
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
18 ;; GNU General Public License for more details.
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
19
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
20 ;; You should have received a copy of the GNU General Public License
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
21 ;; along with GNU Emacs; see the file COPYING. If not, write to
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
22 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
23
788
c8d4eb38ebfc *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 713
diff changeset
24 ;;; Code:
63
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
25
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
26 ;; Temporary until Emacs always has this variable.
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
27 (defvar rmail-delete-after-output nil
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
28 "*Non-nil means automatically delete a message that is copied to a file.")
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
29
145
1a0f15a66c06 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 63
diff changeset
30 (defvar rmail-output-file-alist nil
1a0f15a66c06 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 63
diff changeset
31 "*Alist matching regexps to suggested output Rmail files.
1a0f15a66c06 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 63
diff changeset
32 This is a list of elements of the form (REGEXP . FILENAME).")
1a0f15a66c06 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 63
diff changeset
33
1866
a712cff3b6e7 * rmailout.el (rmail-output, rmail-output-to-mail-file): Reverse
Jim Blandy <jimb@redhat.com>
parents: 1460
diff changeset
34 ;;; There are functions elsewhere in Emacs that use this function; check
a712cff3b6e7 * rmailout.el (rmail-output, rmail-output-to-mail-file): Reverse
Jim Blandy <jimb@redhat.com>
parents: 1460
diff changeset
35 ;;; them out before you change the calling method.
a712cff3b6e7 * rmailout.el (rmail-output, rmail-output-to-mail-file): Reverse
Jim Blandy <jimb@redhat.com>
parents: 1460
diff changeset
36 (defun rmail-output-to-rmail-file (file-name &optional count)
63
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
37 "Append the current message to an Rmail file named FILE-NAME.
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
38 If the file does not exist, ask if it should be created.
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
39 If file is being visited, the message is appended to the Emacs
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
40 buffer visiting that file.
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
41 A prefix argument N says to output N consecutive messages
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
42 starting with the current one. Deleted messages are skipped and don't count."
1866
a712cff3b6e7 * rmailout.el (rmail-output, rmail-output-to-mail-file): Reverse
Jim Blandy <jimb@redhat.com>
parents: 1460
diff changeset
43 (interactive (list (read-file-name
63
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
44 (concat "Output message to Rmail file: (default "
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
45 (file-name-nondirectory rmail-last-rmail-file)
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
46 ") ")
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
47 (file-name-directory rmail-last-rmail-file)
145
1a0f15a66c06 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 63
diff changeset
48 (let (answer tail)
1a0f15a66c06 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 63
diff changeset
49 (setq tail rmail-output-file-alist)
1a0f15a66c06 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 63
diff changeset
50 ;; Suggest a file based on a pattern match.
1a0f15a66c06 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 63
diff changeset
51 (while (and tail (not answer))
1a0f15a66c06 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 63
diff changeset
52 (save-excursion
1a0f15a66c06 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 63
diff changeset
53 (goto-char (point-min))
1a0f15a66c06 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 63
diff changeset
54 (if (re-search-forward (car (car tail)) nil t)
1a0f15a66c06 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 63
diff changeset
55 (setq answer (cdr (car tail))))
1a0f15a66c06 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 63
diff changeset
56 (setq tail (cdr tail))))
1a0f15a66c06 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 63
diff changeset
57 ;; If not suggestions, use same file as last time.
1866
a712cff3b6e7 * rmailout.el (rmail-output, rmail-output-to-mail-file): Reverse
Jim Blandy <jimb@redhat.com>
parents: 1460
diff changeset
58 (or answer rmail-last-rmail-file)))
a712cff3b6e7 * rmailout.el (rmail-output, rmail-output-to-mail-file): Reverse
Jim Blandy <jimb@redhat.com>
parents: 1460
diff changeset
59 (prefix-numeric-value current-prefix-arg)))
a712cff3b6e7 * rmailout.el (rmail-output, rmail-output-to-mail-file): Reverse
Jim Blandy <jimb@redhat.com>
parents: 1460
diff changeset
60 (or count (setq count 1))
202
ae5ace097df2 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 145
diff changeset
61 (setq file-name
ae5ace097df2 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 145
diff changeset
62 (expand-file-name file-name
ae5ace097df2 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 145
diff changeset
63 (file-name-directory rmail-last-rmail-file)))
63
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
64 (setq rmail-last-rmail-file file-name)
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
65 (rmail-maybe-set-message-counters)
1460
e60eef93a18f (rmail-output-to-rmail-file): Call abbreviate-file-name.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
66 (setq file-name (abbreviate-file-name file-name))
63
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
67 (or (get-file-buffer file-name)
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
68 (file-exists-p file-name)
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
69 (if (yes-or-no-p
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
70 (concat "\"" file-name "\" does not exist, create it? "))
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
71 (let ((file-buffer (create-file-buffer file-name)))
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
72 (save-excursion
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
73 (set-buffer file-buffer)
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
74 (rmail-insert-rmail-file-header)
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
75 (let ((require-final-newline nil))
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
76 (write-region (point-min) (point-max) file-name t 1)))
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
77 (kill-buffer file-buffer))
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
78 (error "Output file does not exist")))
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
79 (while (> count 0)
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
80 (let (redelete)
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
81 (unwind-protect
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
82 (progn
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
83 (save-restriction
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
84 (widen)
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
85 (if (rmail-message-deleted-p rmail-current-message)
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
86 (progn (setq redelete t)
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
87 (rmail-set-attribute "deleted" nil)))
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
88 ;; Decide whether to append to a file or to an Emacs buffer.
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
89 (save-excursion
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
90 (let ((buf (get-file-buffer file-name))
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
91 (cur (current-buffer))
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
92 (beg (1+ (rmail-msgbeg rmail-current-message)))
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
93 (end (1+ (rmail-msgend rmail-current-message))))
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
94 (if (not buf)
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
95 (append-to-file beg end file-name)
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
96 (if (eq buf (current-buffer))
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
97 (error "Can't output message to same file it's already in"))
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
98 ;; File has been visited, in buffer BUF.
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
99 (set-buffer buf)
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
100 (let ((buffer-read-only nil)
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
101 (msg (and (boundp 'rmail-current-message)
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
102 rmail-current-message)))
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
103 ;; If MSG is non-nil, buffer is in RMAIL mode.
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
104 (if msg
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
105 (progn
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
106 (rmail-maybe-set-message-counters)
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
107 (widen)
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
108 (narrow-to-region (point-max) (point-max))
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
109 (insert-buffer-substring cur beg end)
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
110 (goto-char (point-min))
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
111 (widen)
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
112 (search-backward "\n\^_")
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
113 (narrow-to-region (point) (point-max))
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
114 (rmail-count-new-messages t)
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
115 (rmail-show-message msg))
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
116 ;; Output file not in rmail mode => just insert at the end.
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
117 (narrow-to-region (point-min) (1+ (buffer-size)))
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
118 (goto-char (point-max))
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
119 (insert-buffer-substring cur beg end)))))))
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
120 (rmail-set-attribute "filed" t))
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
121 (if redelete (rmail-set-attribute "deleted" t))))
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
122 (setq count (1- count))
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
123 (if rmail-delete-after-output
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
124 (rmail-delete-forward)
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
125 (if (> count 0)
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
126 (rmail-next-undeleted-message 1)))))
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
127
1866
a712cff3b6e7 * rmailout.el (rmail-output, rmail-output-to-mail-file): Reverse
Jim Blandy <jimb@redhat.com>
parents: 1460
diff changeset
128 ;;; There are functions elsewhere in Emacs that use this function; check
a712cff3b6e7 * rmailout.el (rmail-output, rmail-output-to-mail-file): Reverse
Jim Blandy <jimb@redhat.com>
parents: 1460
diff changeset
129 ;;; them out before you change the calling method.
a712cff3b6e7 * rmailout.el (rmail-output, rmail-output-to-mail-file): Reverse
Jim Blandy <jimb@redhat.com>
parents: 1460
diff changeset
130 (defun rmail-output (file-name &optional count)
63
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
131 "Append this message to Unix mail file named FILE-NAME.
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
132 A prefix argument N says to output N consecutive messages
1866
a712cff3b6e7 * rmailout.el (rmail-output, rmail-output-to-mail-file): Reverse
Jim Blandy <jimb@redhat.com>
parents: 1460
diff changeset
133 starting with the current one. Deleted messages are skipped and don't count.
a712cff3b6e7 * rmailout.el (rmail-output, rmail-output-to-mail-file): Reverse
Jim Blandy <jimb@redhat.com>
parents: 1460
diff changeset
134 When called from lisp code, N may be omitted."
63
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
135 (interactive
1866
a712cff3b6e7 * rmailout.el (rmail-output, rmail-output-to-mail-file): Reverse
Jim Blandy <jimb@redhat.com>
parents: 1460
diff changeset
136 (list (read-file-name
63
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
137 (concat "Output message to Unix mail file"
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
138 (if rmail-last-file
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
139 (concat " (default "
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
140 (file-name-nondirectory rmail-last-file)
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
141 "): " )
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
142 ": "))
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
143 (and rmail-last-file (file-name-directory rmail-last-file))
1866
a712cff3b6e7 * rmailout.el (rmail-output, rmail-output-to-mail-file): Reverse
Jim Blandy <jimb@redhat.com>
parents: 1460
diff changeset
144 rmail-last-file)
a712cff3b6e7 * rmailout.el (rmail-output, rmail-output-to-mail-file): Reverse
Jim Blandy <jimb@redhat.com>
parents: 1460
diff changeset
145 (prefix-numeric-value current-prefix-arg)))
a712cff3b6e7 * rmailout.el (rmail-output, rmail-output-to-mail-file): Reverse
Jim Blandy <jimb@redhat.com>
parents: 1460
diff changeset
146 (or count (setq count 1))
202
ae5ace097df2 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 145
diff changeset
147 (setq file-name
ae5ace097df2 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 145
diff changeset
148 (expand-file-name file-name
ae5ace097df2 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 145
diff changeset
149 (and rmail-last-file
ae5ace097df2 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 145
diff changeset
150 (file-name-directory rmail-last-file))))
63
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
151 (setq rmail-last-file file-name)
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
152 (while (> count 0)
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
153 (let ((rmailbuf (current-buffer))
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
154 (tembuf (get-buffer-create " rmail-output"))
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
155 (case-fold-search t))
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
156 (save-excursion
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
157 (set-buffer tembuf)
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
158 (erase-buffer)
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
159 ;; If we can do it, read a little of the file
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
160 ;; to check whether it is an RMAIL file.
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
161 ;; If it is, don't mess it up.
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
162 (if (fboundp 'insert-partial-file-contents)
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
163 (progn
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
164 (insert-partial-file-contents file-name 0 20)
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
165 (if (looking-at "BABYL OPTIONS:\n")
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
166 (error (save-excursion
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
167 (set-buffer rmailbuf)
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
168 (substitute-command-keys
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
169 "File %s is an RMAIL file; use the \\[rmail-output-to-rmail-file] command"))
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
170 file-name))
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
171 (erase-buffer)))
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
172 (insert-buffer-substring rmailbuf)
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
173 (insert "\n")
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
174 (goto-char (point-min))
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
175 (insert "From "
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
176 (mail-strip-quoted-names (or (mail-fetch-field "from")
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
177 (mail-fetch-field "really-from")
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
178 (mail-fetch-field "sender")
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
179 "unknown"))
713
9d04c281a9bd *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 658
diff changeset
180 " " (or (mail-fetch-field "date") (current-time-string)) "\n")
63
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
181 ;; ``Quote'' "\nFrom " as "\n>From "
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
182 ;; (note that this isn't really quoting, as there is no requirement
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
183 ;; that "\n[>]+From " be quoted in the same transparent way.)
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
184 (while (search-forward "\nFrom " nil t)
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
185 (forward-char -5)
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
186 (insert ?>))
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
187 (append-to-file (point-min) (point-max) file-name))
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
188 (kill-buffer tembuf))
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
189 (if (equal major-mode 'rmail-mode)
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
190 (rmail-set-attribute "filed" t))
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
191 (setq count (1- count))
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
192 (if rmail-delete-after-output
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
193 (rmail-delete-forward)
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
194 (if (> count 0)
714e88ef93c8 Initial revision
root <root>
parents:
diff changeset
195 (rmail-next-undeleted-message 1)))))
658
7cbd4fcd8b0f *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 202
diff changeset
196
7cbd4fcd8b0f *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 202
diff changeset
197 ;;; rmailout.el ends here