Mercurial > emacs
annotate lisp/mail/rmail.el @ 2363:64dadcfcdf68
Fix typo in source for `configure.tmp.$$.c'.
author | Jim Blandy <jimb@redhat.com> |
---|---|
date | Thu, 25 Mar 1993 03:57:51 +0000 |
parents | 5140299129c3 |
children | 5dd3b7338f71 |
rev | line source |
---|---|
658
7cbd4fcd8b0f
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
621
diff
changeset
|
1 ;;; rmail.el --- main code of "RMAIL" mail reader for Emacs. |
7cbd4fcd8b0f
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
621
diff
changeset
|
2 |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
3 ;; Copyright (C) 1985, 1986, 1987, 1988, 1993 Free Software Foundation, Inc. |
846
20674ae6bf52
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
830
diff
changeset
|
4 |
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
658
diff
changeset
|
5 ;; Maintainer: FSF |
814
38b2499cb3e9
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
813
diff
changeset
|
6 ;; Keywords: mail |
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
658
diff
changeset
|
7 |
270 | 8 ;; This file is part of GNU Emacs. |
9 | |
10 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
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:
658
diff
changeset
|
12 ;; the Free Software Foundation; either version 2, or (at your option) |
270 | 13 ;; any later version. |
14 | |
15 ;; GNU Emacs is distributed in the hope that it will be useful, | |
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 ;; GNU General Public License for more details. | |
19 | |
20 ;; You should have received a copy of the GNU General Public License | |
21 ;; along with GNU Emacs; see the file COPYING. If not, write to | |
22 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | |
23 | |
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
658
diff
changeset
|
24 ;;; Code: |
270 | 25 |
26 ;; Souped up by shane@mit-ajax based on ideas of rlk@athena.mit.edu | |
27 ;; New features include attribute and keyword support, message | |
28 ;; selection by dispatch table, summary by attributes and keywords, | |
29 ;; expunging by dispatch table, sticky options for file commands. | |
30 | |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
31 ;; Extended by Bob Weiner of Motorola |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
32 ;; New features include: rmail and rmail-summary buffers remain |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
33 ;; synchronized and key bindings basically operate the same way in both |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
34 ;; buffers, summary by topic or by regular expression, rmail-reply-prefix |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
35 ;; variable, and a bury rmail buffer (wipe) command. |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
36 ;; |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
37 |
270 | 38 (require 'mail-utils) |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
39 |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
40 ;; For Emacs V18 compatibility |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
41 (and (not (fboundp 'user-original-login-name)) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
42 (fboundp 'user-real-login-name) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
43 (fset 'user-original-login-name 'user-real-login-name)) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
44 (and (not (fboundp 'buffer-disable-undo)) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
45 (fboundp 'buffer-flush-undo) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
46 (fset 'buffer-disable-undo 'buffer-flush-undo)) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
47 |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
48 ; These variables now declared in paths.el. |
270 | 49 ;(defvar rmail-spool-directory "/usr/spool/mail/" |
50 ; "This is the name of the directory used by the system mailer for\n\ | |
51 ;delivering new mail. It's name should end with a slash.") | |
52 ;(defvar rmail-file-name | |
53 ; (expand-file-name "~/RMAIL") | |
54 ; "") | |
55 | |
56 ;;;###autoload | |
57 (defvar rmail-dont-reply-to-names nil "\ | |
58 *A regexp specifying names to prune of reply to messages. | |
59 nil means dont reply to yourself.") | |
60 | |
61 ;;;###autoload | |
62 (defvar rmail-default-dont-reply-to-names "info-" "\ | |
63 A regular expression specifying part of the value of the default value of | |
64 the variable `rmail-dont-reply-to-names', for when the user does not set | |
65 `rmail-dont-reply-to-names' explicitly. (The other part of the default | |
66 value is the user's name.) | |
67 It is useful to set this variable in the site customisation file.") | |
68 | |
69 ;;;###autoload | |
70 (defvar rmail-ignored-headers "^via:\\|^mail-from:\\|^origin:\\|^status:\\|^received:\\|^message-id:\\|^summary-line:" "\ | |
71 *Gubbish headers one would rather not see.") | |
72 | |
73 ;;;###autoload | |
74 (defvar rmail-delete-after-output nil "\ | |
75 *Non-nil means automatically delete a message that is copied to a file.") | |
76 | |
77 ;;;###autoload | |
78 (defconst rmail-primary-inbox-list nil "\ | |
79 *List of files which are inboxes for user's primary mail file ~/RMAIL. | |
80 `nil' means the default, which is (\"/usr/spool/mail/$USER\" \"~/mbox\") | |
81 \(the first name varies depending on the operating system, | |
82 and the value of the environment variable MAIL overrides it).") | |
83 | |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
84 ;; These may be altered by site-init.el to match the format of mmdf files |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
85 ;; delimiting used on a given host (delim1 and delim2 from the config |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
86 ;; files). |
270 | 87 |
88 (defvar mmdf-delim1 "^\001\001\001\001\n" | |
89 "Regexp marking the start of an mmdf message") | |
90 (defvar mmdf-delim2 "^\001\001\001\001\n" | |
91 "Regexp marking the end of an mmdf message") | |
92 | |
93 (defvar rmail-message-filter nil | |
94 "If non nil, is a filter function for new headers in RMAIL. | |
95 Called with region narrowed to unformatted header.") | |
96 | |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
97 (defvar rmail-reply-prefix "Re: " |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
98 "String to prepend to Subject line when replying to a message.") |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
99 |
270 | 100 (defvar rmail-mode-map nil) |
101 | |
102 (defvar rmail-inbox-list nil) | |
103 (defvar rmail-keywords nil) | |
104 | |
105 ;; Message counters and markers. Deleted flags. | |
106 | |
107 (defvar rmail-current-message nil) | |
108 (defvar rmail-total-messages nil) | |
109 (defvar rmail-message-vector nil) | |
110 (defvar rmail-deleted-vector nil) | |
111 | |
112 ;; These are used by autoloaded rmail-summary. | |
113 | |
114 (defvar rmail-summary-buffer nil) | |
115 (defvar rmail-summary-vector nil) | |
116 | |
117 ;; `Sticky' default variables. | |
118 | |
119 ;; Last individual label specified to a or k. | |
120 (defvar rmail-last-label nil) | |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
121 ;; Last set of values specified to C-M-n, C-M-p, C-M-s or C-M-l. |
270 | 122 (defvar rmail-last-multi-labels nil) |
123 (defvar rmail-last-file nil) | |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
124 (defvar rmail-last-regexp nil) |
270 | 125 (defvar rmail-last-rmail-file nil) |
617 | 126 |
621 | 127 ;;; Regexp matching the delimiter of messages in UNIX mail format |
128 ;;; (UNIX From lines), minus the initial ^. Note that if you change | |
129 ;;; this expression, you must change the code in rmail-nuke-pinhead-header | |
130 ;;; that knows the exact ordering of the \\( \\) subexpressions. | |
617 | 131 (defvar rmail-unix-mail-delimiter |
1112 | 132 (let ((time-zone-regexp |
1704
7e1897c2951b
* rmail.el (rmail-unix-mail-delimiter): Not all time zone names
Jim Blandy <jimb@redhat.com>
parents:
1464
diff
changeset
|
133 (concat "\\([A-Z]?[A-Z][A-Z][A-Z]\\( DST\\)?" |
1112 | 134 "\\|[-+]?[0-9][0-9][0-9][0-9]" |
135 "\\|" | |
136 "\\) *"))) | |
137 (concat | |
138 "From " | |
139 | |
140 ;; Username, perhaps with a quoted section that can contain spaces. | |
141 "\\(" | |
142 "[^ \n]*" | |
143 "\\(\\|\".*\"[^ \n]*\\)" | |
144 "\\) ?" | |
145 | |
146 ;; The time the message was sent. | |
147 "\\([^ \n]*\\) *" ; day of the week | |
148 "\\([^ ]*\\) *" ; month | |
149 "\\([0-9]*\\) *" ; day of month | |
150 "\\([0-9:]*\\) *" ; time of day | |
151 | |
152 ;; Perhaps a time zone, specified by an abbreviation, or by a | |
153 ;; numeric offset. | |
154 time-zone-regexp | |
155 | |
156 ;; The year. | |
157 " [0-9][0-9]\\([0-9]*\\) *" | |
158 | |
159 ;; On some systems the time zone can appear after the year, too. | |
160 time-zone-regexp | |
161 | |
162 ;; I'm not sure what this is. | |
163 "\\(remote from [^\n]*\\)?" | |
164 | |
165 "\n")) | |
166 nil) | |
167 | |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
168 ;; Perform BODY in the summary buffer |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
169 ;; in such a way that its cursor is properly updated in its own window. |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
170 (defmacro rmail-select-summary (&rest body) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
171 (` (progn (if (rmail-summary-displayed) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
172 (let ((window (selected-window))) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
173 (unwind-protect |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
174 (progn |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
175 (pop-to-buffer rmail-summary-buffer) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
176 (,@ body)) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
177 (select-window window))) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
178 (save-excursion |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
179 (set-buffer rmail-summary-buffer) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
180 (progn (,@ body)))) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
181 (rmail-maybe-display-summary)))) |
270 | 182 |
183 ;;;; *** Rmail Mode *** | |
184 | |
185 ;;;###autoload | |
186 (defun rmail (&optional file-name-arg) | |
187 "Read and edit incoming mail. | |
188 Moves messages into file named by rmail-file-name (a babyl format file) | |
189 and edits that file in RMAIL Mode. | |
190 Type \\[describe-mode] once editing that file, for a list of RMAIL commands. | |
191 | |
192 May be called with filename as argument; then performs rmail editing on | |
193 that file, but does not copy any new mail into the file." | |
194 (interactive (if current-prefix-arg | |
195 (list (read-file-name "Run rmail on RMAIL file: " | |
196 nil nil t)))) | |
197 (or rmail-last-file | |
198 (setq rmail-last-file (expand-file-name "~/xmail"))) | |
199 (or rmail-last-rmail-file | |
200 (setq rmail-last-rmail-file (expand-file-name "~/XMAIL"))) | |
201 (let* ((file-name (expand-file-name (or file-name-arg rmail-file-name))) | |
202 (existed (get-file-buffer file-name))) | |
203 ;; Like find-file, but in the case where a buffer existed | |
204 ;; and the file was reverted, recompute the message-data. | |
205 (if (and existed (not (verify-visited-file-modtime existed))) | |
206 (progn | |
207 ;; Don't be confused by apparent local-variables spec | |
208 ;; in the last message in the RMAIL file. | |
1024
ceb4469d3cd7
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
997
diff
changeset
|
209 (let ((enable-local-variables nil)) |
270 | 210 (find-file file-name)) |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
211 (if (and (verify-visited-file-modtime existed) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
212 (eq major-mode 'rmail-mode)) |
270 | 213 (progn (rmail-forget-messages) |
214 (rmail-set-message-counters)))) | |
1024
ceb4469d3cd7
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
997
diff
changeset
|
215 (let ((enable-local-variables nil)) |
270 | 216 (find-file file-name))) |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
217 (if (eq major-mode 'rmail-edit-mode) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
218 (error "Exit Rmail Edit mode before getting new mail.")) |
270 | 219 (if (and existed (> (buffer-size) 0)) |
220 ;; Buffer not new and not empty; ensure in proper mode, but that's all. | |
221 (or (eq major-mode 'rmail-mode) | |
222 (rmail-mode-2)) | |
223 (rmail-mode-2) | |
224 ;; Provide default set of inboxes for primary mail file ~/RMAIL. | |
225 (and (null rmail-inbox-list) | |
226 (null file-name-arg) | |
227 (setq rmail-inbox-list | |
228 (or rmail-primary-inbox-list | |
229 (list "~/mbox" | |
230 (or (getenv "MAIL") | |
231 (concat rmail-spool-directory | |
232 (user-original-login-name))))))) | |
233 ;; Convert all or part to Babyl file if possible. | |
234 (rmail-convert-file) | |
235 (goto-char (point-max)) | |
236 (if (null rmail-inbox-list) | |
237 (progn | |
238 (rmail-set-message-counters) | |
239 (rmail-show-message)))) | |
1342
776d4c59f256
* rmail.el (rmail-first-unseen-message): Don't show the message,
Joseph Arceneaux <jla@gnu.org>
parents:
1267
diff
changeset
|
240 (let ((existing-unseen (rmail-first-unseen-message))) |
776d4c59f256
* rmail.el (rmail-first-unseen-message): Don't show the message,
Joseph Arceneaux <jla@gnu.org>
parents:
1267
diff
changeset
|
241 (rmail-get-new-mail) |
776d4c59f256
* rmail.el (rmail-first-unseen-message): Don't show the message,
Joseph Arceneaux <jla@gnu.org>
parents:
1267
diff
changeset
|
242 ;; Show the first unseen message, which might be from a previous session |
776d4c59f256
* rmail.el (rmail-first-unseen-message): Don't show the message,
Joseph Arceneaux <jla@gnu.org>
parents:
1267
diff
changeset
|
243 ;; or might have been just read in by rmail-get-new-mail. Must |
776d4c59f256
* rmail.el (rmail-first-unseen-message): Don't show the message,
Joseph Arceneaux <jla@gnu.org>
parents:
1267
diff
changeset
|
244 ;; determine already unseen messages first, as rmail-get-new-mail |
776d4c59f256
* rmail.el (rmail-first-unseen-message): Don't show the message,
Joseph Arceneaux <jla@gnu.org>
parents:
1267
diff
changeset
|
245 ;; positions on the first new messsage, thus marking it as seen. |
776d4c59f256
* rmail.el (rmail-first-unseen-message): Don't show the message,
Joseph Arceneaux <jla@gnu.org>
parents:
1267
diff
changeset
|
246 (rmail-show-message existing-unseen)))) |
270 | 247 |
248 ;; Given the value of MAILPATH, return a list of inbox file names. | |
249 ;; This is turned off because it is not clear that the user wants | |
250 ;; all these inboxes to feed into the primary rmail file. | |
251 ; (defun rmail-convert-mailpath (string) | |
252 ; (let (idx list) | |
253 ; (while (setq idx (string-match "[%:]" string)) | |
254 ; (let ((this (substring string 0 idx))) | |
255 ; (setq string (substring string (1+ idx))) | |
256 ; (setq list (cons (if (string-match "%" this) | |
257 ; (substring this 0 (string-match "%" this)) | |
258 ; this) | |
259 ; list)))) | |
260 ; list)) | |
261 | |
262 ; I have checked that adding "-*- rmail -*-" to the BABYL OPTIONS line | |
263 ; will not cause emacs 18.55 problems. | |
264 | |
265 (defun rmail-convert-file () | |
266 (let (convert) | |
267 (widen) | |
268 (goto-char (point-min)) | |
269 ;; If file doesn't start like a Babyl file, | |
270 ;; convert it to one, by adding a header and converting each message. | |
271 (cond ((looking-at "BABYL OPTIONS:")) | |
272 ((looking-at "Version: 5\n") | |
273 ;; Losing babyl file made by old version of Rmail. | |
274 ;; Just fix the babyl file header; don't make a new one, | |
275 ;; so we don't lose the Labels: file attribute, etc. | |
276 (let ((buffer-read-only nil)) | |
277 (insert "BABYL OPTIONS: -*- rmail -*-\n"))) | |
278 (t | |
279 (setq convert t) | |
280 (rmail-insert-rmail-file-header))) | |
281 ;; If file was not a Babyl file or if there are | |
282 ;; Unix format messages added at the end, | |
283 ;; convert file as necessary. | |
284 (if (or convert | |
285 (progn (goto-char (point-max)) | |
286 (search-backward "\^_") | |
287 (forward-char 1) | |
288 (looking-at "\n*From "))) | |
289 (let ((buffer-read-only nil)) | |
290 (message "Converting to Babyl format...") | |
291 (narrow-to-region (point) (point-max)) | |
292 (rmail-convert-to-babyl-format) | |
293 (message "Converting to Babyl format...done"))))) | |
294 | |
295 ; I have checked that adding "-*- rmail -*-" to the BABYL OPTIONS line | |
296 ; will not cause emacs 18.55 problems. | |
297 | |
298 (defun rmail-insert-rmail-file-header () | |
299 (let ((buffer-read-only nil)) | |
300 (insert "BABYL OPTIONS: -*- rmail -*- | |
301 Version: 5 | |
302 Labels: | |
303 Note: This is the header of an rmail file. | |
304 Note: If you are seeing it in rmail, | |
305 Note: it means the file has no messages in it.\n\^_"))) | |
306 | |
307 (if rmail-mode-map | |
308 nil | |
309 (setq rmail-mode-map (make-keymap)) | |
310 (suppress-keymap rmail-mode-map) | |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
311 (define-key rmail-mode-map "a" 'rmail-add-label) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
312 (define-key rmail-mode-map "b" 'rmail-bury) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
313 (define-key rmail-mode-map "c" 'rmail-continue) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
314 (define-key rmail-mode-map "d" 'rmail-delete-forward) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
315 (define-key rmail-mode-map "\C-d" 'rmail-delete-backward) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
316 (define-key rmail-mode-map "e" 'rmail-edit-current-message) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
317 (define-key rmail-mode-map "f" 'rmail-forward) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
318 (define-key rmail-mode-map "g" 'rmail-get-new-mail) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
319 (define-key rmail-mode-map "h" 'rmail-summary) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
320 (define-key rmail-mode-map "i" 'rmail-input) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
321 (define-key rmail-mode-map "j" 'rmail-show-message) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
322 (define-key rmail-mode-map "k" 'rmail-kill-label) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
323 (define-key rmail-mode-map "l" 'rmail-summary-by-labels) |
270 | 324 (define-key rmail-mode-map "\e\C-h" 'rmail-summary) |
325 (define-key rmail-mode-map "\e\C-l" 'rmail-summary-by-labels) | |
326 (define-key rmail-mode-map "\e\C-r" 'rmail-summary-by-recipients) | |
327 (define-key rmail-mode-map "\e\C-s" 'rmail-summary-by-regexp) | |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
328 (define-key rmail-mode-map "\e\C-t" 'rmail-summary-by-topic) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
329 (define-key rmail-mode-map "m" 'rmail-mail) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
330 (define-key rmail-mode-map "\em" 'rmail-retry-failure) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
331 (define-key rmail-mode-map "n" 'rmail-next-undeleted-message) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
332 (define-key rmail-mode-map "\en" 'rmail-next-message) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
333 (define-key rmail-mode-map "\e\C-n" 'rmail-next-labeled-message) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
334 (define-key rmail-mode-map "o" 'rmail-output-to-rmail-file) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
335 (define-key rmail-mode-map "\C-o" 'rmail-output) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
336 (define-key rmail-mode-map "p" 'rmail-previous-undeleted-message) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
337 (define-key rmail-mode-map "\ep" 'rmail-previous-message) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
338 (define-key rmail-mode-map "\e\C-p" 'rmail-previous-labeled-message) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
339 (define-key rmail-mode-map "q" 'rmail-quit) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
340 (define-key rmail-mode-map "r" 'rmail-reply) |
1464
7f25b15a6809
(rmail-mode-map): Delete binding of M-r (use global one).
Richard M. Stallman <rms@gnu.org>
parents:
1382
diff
changeset
|
341 ;; I find I can't live without the default M-r command -- rms. |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
342 ;; (define-key rmail-mode-map "\er" 'rmail-search-backwards) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
343 (define-key rmail-mode-map "s" 'rmail-expunge-and-save) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
344 (define-key rmail-mode-map "\es" 'rmail-search) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
345 (define-key rmail-mode-map "t" 'rmail-toggle-header) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
346 (define-key rmail-mode-map "u" 'rmail-undelete-previous-message) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
347 (define-key rmail-mode-map "w" 'rmail-edit-current-message) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
348 (define-key rmail-mode-map "x" 'rmail-expunge) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
349 (define-key rmail-mode-map "." 'rmail-beginning-of-message) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
350 (define-key rmail-mode-map "<" 'rmail-first-message) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
351 (define-key rmail-mode-map ">" 'rmail-last-message) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
352 (define-key rmail-mode-map " " 'scroll-up) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
353 (define-key rmail-mode-map "\177" 'scroll-down) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
354 (define-key rmail-mode-map "?" 'describe-mode) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
355 ) |
270 | 356 |
357 ;; Rmail mode is suitable only for specially formatted data. | |
358 (put 'rmail-mode 'mode-class 'special) | |
359 | |
1382
9b210c7d6c23
* rmail.el (rmail-mode): Make this autoload; we might find a file
Jim Blandy <jimb@redhat.com>
parents:
1372
diff
changeset
|
360 ;;;###autoload |
270 | 361 (defun rmail-mode () |
362 "Rmail Mode is used by \\<rmail-mode-map>\\[rmail] for editing Rmail files. | |
363 All normal editing commands are turned off. | |
364 Instead, these commands are available: | |
365 | |
366 \\[rmail-beginning-of-message] Move point to front of this message (same as \\[beginning-of-buffer]). | |
367 \\[scroll-up] Scroll to next screen of this message. | |
368 \\[scroll-down] Scroll to previous screen of this message. | |
369 \\[rmail-next-undeleted-message] Move to Next non-deleted message. | |
370 \\[rmail-previous-undeleted-message] Move to Previous non-deleted message. | |
371 \\[rmail-next-message] Move to Next message whether deleted or not. | |
372 \\[rmail-previous-message] Move to Previous message whether deleted or not. | |
373 \\[rmail-first-message] Move to the first message in Rmail file. | |
374 \\[rmail-last-message] Move to the last message in Rmail file. | |
375 \\[rmail-show-message] Jump to message specified by numeric position in file. | |
376 \\[rmail-search] Search for string and show message it is found in. | |
377 \\[rmail-delete-forward] Delete this message, move to next nondeleted. | |
378 \\[rmail-delete-backward] Delete this message, move to previous nondeleted. | |
379 \\[rmail-undelete-previous-message] Undelete message. Tries current message, then earlier messages | |
380 till a deleted message is found. | |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
381 \\[rmail-edit-current-message] Edit the current message. \\[rmail-cease-edit] to return to Rmail. |
270 | 382 \\[rmail-expunge] Expunge deleted messages. |
383 \\[rmail-expunge-and-save] Expunge and save the file. | |
384 \\[rmail-quit] Quit Rmail: expunge, save, then switch to another buffer. | |
385 \\[save-buffer] Save without expunging. | |
386 \\[rmail-get-new-mail] Move new mail from system spool directory or mbox into this file. | |
387 \\[rmail-mail] Mail a message (same as \\[mail-other-window]). | |
388 \\[rmail-continue] Continue composing outgoing message started before. | |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
389 \\[rmail-reply] Reply to this message. Like \\[rmail-mail] but initializes some fields. |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
390 \\[rmail-retry-failure] Send this message again. Used on a mailer failure message. |
270 | 391 \\[rmail-forward] Forward this message to another user. |
392 \\[rmail-output-to-rmail-file] Output this message to an Rmail file (append it). | |
393 \\[rmail-output] Output this message to a Unix-format mail file (append it). | |
394 \\[rmail-input] Input Rmail file. Run Rmail on that file. | |
395 \\[rmail-add-label] Add label to message. It will be displayed in the mode line. | |
396 \\[rmail-kill-label] Kill label. Remove a label from current message. | |
397 \\[rmail-next-labeled-message] Move to Next message with specified label | |
398 (label defaults to last one specified). | |
399 Standard labels: filed, unseen, answered, forwarded, deleted. | |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
400 Any other label is present only if you add it with \\[rmail-add-label]. |
270 | 401 \\[rmail-previous-labeled-message] Move to Previous message with specified label |
402 \\[rmail-summary] Show headers buffer, with a one line summary of each message. | |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
403 \\[rmail-summary-by-labels] Summarize only messages with particular label(s). |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
404 \\[rmail-summary-by-recipients] Summarize only messages with particular recipient(s). |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
405 \\[rmail-summary-by-regexp] Summarize only messages with particular regexp(s). |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
406 \\[rmail-summary-by-topic] Summarize only messages with subject line regexp(s). |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
407 \\[rmail-toggle-header] Toggle display of complete header." |
270 | 408 (interactive) |
409 (rmail-mode-2) | |
410 (rmail-set-message-counters) | |
411 (rmail-show-message)) | |
412 | |
413 (defun rmail-mode-2 () | |
414 (kill-all-local-variables) | |
415 (rmail-mode-1) | |
416 (rmail-variables) | |
417 (run-hooks 'rmail-mode-hook)) | |
418 | |
419 (defun rmail-mode-1 () | |
420 (setq major-mode 'rmail-mode) | |
421 (setq mode-name "RMAIL") | |
422 (setq buffer-read-only t) | |
423 ;; No need to auto save RMAIL files. | |
424 (setq buffer-auto-save-file-name nil) | |
425 (if (boundp 'mode-line-modified) | |
426 (setq mode-line-modified "--- ") | |
427 (setq mode-line-format | |
428 (cons "--- " (cdr (default-value 'mode-line-format))))) | |
429 (use-local-map rmail-mode-map) | |
430 (set-syntax-table text-mode-syntax-table) | |
431 (setq local-abbrev-table text-mode-abbrev-table)) | |
432 | |
433 (defun rmail-variables () | |
434 (make-local-variable 'revert-buffer-function) | |
435 (setq revert-buffer-function 'rmail-revert) | |
436 (make-local-variable 'rmail-last-label) | |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
437 (make-local-variable 'rmail-last-regexp) |
270 | 438 (make-local-variable 'rmail-deleted-vector) |
439 (make-local-variable 'rmail-summary-buffer) | |
440 (make-local-variable 'rmail-summary-vector) | |
441 (make-local-variable 'rmail-current-message) | |
442 (make-local-variable 'rmail-total-messages) | |
443 (make-local-variable 'require-final-newline) | |
444 (setq require-final-newline nil) | |
445 (make-local-variable 'version-control) | |
446 (setq version-control 'never) | |
447 (make-local-variable 'file-precious-flag) | |
448 (setq file-precious-flag t) | |
449 (make-local-variable 'rmail-message-vector) | |
450 (make-local-variable 'rmail-last-file) | |
451 (make-local-variable 'rmail-inbox-list) | |
452 (setq rmail-inbox-list (rmail-parse-file-inboxes)) | |
453 (make-local-variable 'rmail-keywords) | |
454 ;; this gets generated as needed | |
280
e6f9ccb230ad
*** empty log message ***
Michael I. Bushnell <mib@gnu.org>
parents:
270
diff
changeset
|
455 (setq rmail-keywords nil)) |
270 | 456 |
457 ;; Handle M-x revert-buffer done in an rmail-mode buffer. | |
458 (defun rmail-revert (arg noconfirm) | |
459 (let (revert-buffer-function) | |
460 ;; Call our caller again, but this time it does the default thing. | |
461 (if (revert-buffer arg noconfirm) | |
462 ;; If the user said "yes", and we changed something, | |
463 ;; reparse the messages. | |
464 (progn | |
465 (rmail-convert-file) | |
466 (goto-char (point-max)) | |
467 (rmail-set-message-counters) | |
468 (rmail-show-message))))) | |
469 | |
470 ;; Return a list of files from this buffer's Mail: option. | |
471 ;; Does not assume that messages have been parsed. | |
472 ;; Just returns nil if buffer does not look like Babyl format. | |
473 (defun rmail-parse-file-inboxes () | |
474 (save-excursion | |
475 (save-restriction | |
476 (widen) | |
477 (goto-char 1) | |
478 (cond ((looking-at "BABYL OPTIONS:") | |
479 (search-forward "\n\^_" nil 'move) | |
480 (narrow-to-region 1 (point)) | |
481 (goto-char 1) | |
482 (if (search-forward "\nMail:" nil t) | |
483 (progn | |
484 (narrow-to-region (point) (progn (end-of-line) (point))) | |
485 (goto-char (point-min)) | |
486 (mail-parse-comma-list)))))))) | |
487 | |
488 (defun rmail-expunge-and-save () | |
489 "Expunge and save RMAIL file." | |
490 (interactive) | |
491 (rmail-expunge) | |
492 (save-buffer)) | |
493 | |
494 (defun rmail-quit () | |
495 "Quit out of RMAIL." | |
496 (interactive) | |
497 (rmail-expunge-and-save) | |
498 ;; Don't switch to the summary buffer even if it was recently visible. | |
499 (if rmail-summary-buffer | |
500 (bury-buffer rmail-summary-buffer)) | |
501 (let ((obuf (current-buffer))) | |
502 (switch-to-buffer (other-buffer)) | |
503 (bury-buffer obuf))) | |
504 | |
505 ;;;###autoload | |
506 (defun rmail-input (filename) | |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
507 "Run Rmail on file FILENAME." |
270 | 508 (interactive "FRun rmail on RMAIL file: ") |
509 (rmail filename)) | |
510 | |
511 | |
512 ;;;; *** Rmail input *** | |
513 | |
514 ;; RLK feature not added in this version: | |
515 ;; argument specifies inbox file or files in various ways. | |
516 | |
517 (defun rmail-get-new-mail (&optional file-name) | |
518 "Move any new mail from this RMAIL file's inbox files. | |
519 The inbox files can be specified with the file's Mail: option. The | |
520 variable `rmail-primary-inbox-list' specifies the inboxes for your | |
521 primary RMAIL file if it has no Mail: option. These are normally your | |
522 ~/mbox and your /usr/spool/mail/$USER. | |
523 | |
524 You can also specify the file to get new mail from. In this case, the | |
525 file of new mail is not changed or deleted. Noninteractively, you can | |
526 pass the inbox file name as an argument. Interactively, a prefix | |
527 argument causes us to read a file name and use that file as the inbox." | |
528 (interactive | |
529 (list (if current-prefix-arg | |
530 (read-file-name "Get new mail from file: ")))) | |
531 (or (verify-visited-file-modtime (current-buffer)) | |
532 (progn | |
533 (find-file (buffer-file-name)) | |
2006
3f64e7ba7fdd
(rmail-get-new-mail): Reset read-only after find-file.
Richard M. Stallman <rms@gnu.org>
parents:
1757
diff
changeset
|
534 (setq buffer-read-only t) |
270 | 535 (if (verify-visited-file-modtime (current-buffer)) |
536 (rmail-forget-messages)))) | |
537 (rmail-maybe-set-message-counters) | |
538 (widen) | |
539 ;; Get rid of all undo records for this buffer. | |
540 (or (eq buffer-undo-list t) | |
541 (setq buffer-undo-list nil)) | |
542 (unwind-protect | |
543 (let ((opoint (point)) | |
544 (new-messages 0) | |
545 (delete-files ()) | |
546 ;; If buffer has not changed yet, and has not been saved yet, | |
547 ;; don't replace the old backup file now. | |
548 (make-backup-files (and make-backup-files (buffer-modified-p))) | |
549 (buffer-read-only nil) | |
550 ;; Don't make undo records for what we do in getting mail. | |
551 (buffer-undo-list t)) | |
552 (goto-char (point-max)) | |
553 (skip-chars-backward " \t\n") ; just in case of brain damage | |
554 (delete-region (point) (point-max)) ; caused by require-final-newline | |
555 (save-excursion | |
556 (save-restriction | |
557 (narrow-to-region (point) (point)) | |
558 ;; Read in the contents of the inbox files, | |
559 ;; renaming them as necessary, | |
560 ;; and adding to the list of files to delete eventually. | |
561 (if file-name | |
562 (rmail-insert-inbox-text (list file-name) nil) | |
563 (setq delete-files (rmail-insert-inbox-text rmail-inbox-list t))) | |
564 ;; Scan the new text and convert each message to babyl format. | |
565 (goto-char (point-min)) | |
566 (save-excursion | |
567 (setq new-messages (rmail-convert-to-babyl-format))) | |
568 (or (zerop new-messages) | |
569 (let (success) | |
570 (widen) | |
571 (search-backward "\n\^_") | |
572 (narrow-to-region (point) (point-max)) | |
573 (goto-char (1+ (point-min))) | |
574 (rmail-count-new-messages) | |
575 (save-buffer))) | |
576 ;; Delete the old files, now that babyl file is saved. | |
577 (while delete-files | |
578 (condition-case () | |
1165 | 579 ;; First, try deleting. |
580 (condition-case () | |
581 (delete-file (car delete-files)) | |
582 (file-error | |
583 ;; If we can't delete it, truncate it. | |
584 (write-region (point) (point) (car delete-files)))) | |
270 | 585 (file-error nil)) |
586 (setq delete-files (cdr delete-files))))) | |
587 (if (= new-messages 0) | |
588 (progn (goto-char opoint) | |
589 (if (or file-name rmail-inbox-list) | |
590 (message "(No new mail has arrived)"))) | |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
591 (if (rmail-summary-exists) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
592 (rmail-select-summary |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
593 (rmail-update-summary))) |
270 | 594 (message "%d new message%s read" |
595 new-messages (if (= 1 new-messages) "" "s")) | |
596 (and (boundp 'display-time-string) | |
597 (string-match " Mail" display-time-string) | |
598 (setq display-time-string | |
599 (concat | |
600 (substring display-time-string 0 (match-beginning 0)) | |
601 (substring display-time-string (match-end 0)))) | |
602 (force-mode-line-update 'all)))) | |
603 ;; Don't leave the buffer screwed up if we get a disk-full error. | |
604 (rmail-show-message))) | |
605 | |
606 (defun rmail-insert-inbox-text (files renamep) | |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
607 (let (file tofile delete-files movemail popmail) |
270 | 608 (while files |
609 (setq file (expand-file-name (substitute-in-file-name (car files))) | |
610 ;;>> un*x specific << | |
813 | 611 ;; The "+" used to be "~", which is an extremely poor choice; |
612 ;; it might accidentally be deleted when space is low | |
613 ;; (as happened to me!). | |
614 tofile (concat file "+")) | |
270 | 615 ;; If getting from mail spool directory, |
616 ;; use movemail to move rather than just renaming, | |
617 ;; so as to interlock with the mailer. | |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
618 (setq movemail (equal (file-name-directory file) rmail-spool-directory) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
619 popmail (string-match "^po:" (file-name-nondirectory file))) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
620 (if popmail (setq file (file-name-nondirectory file) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
621 renamep t)) |
270 | 622 (if movemail |
623 (progn | |
624 (setq tofile (expand-file-name | |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
625 ;; Generate name to move to from inbox name, |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
626 ;; in case of multiple inboxes that need moving. |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
627 (concat ".newmail-" (file-name-nondirectory file)) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
628 ;; Use the directory of this rmail file |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
629 ;; because it's a nuisance to use the homedir |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
630 ;; if that is on a full disk and this rmail |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
631 ;; file isn't. |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
632 (file-name-directory |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
633 (expand-file-name buffer-file-name)))) |
270 | 634 ;; On some systems, /usr/spool/mail/foo is a directory |
635 ;; and the actual inbox is /usr/spool/mail/foo/foo. | |
636 (if (file-directory-p file) | |
637 (setq file (expand-file-name (user-original-login-name) | |
638 file))))) | |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
639 (if popmail |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
640 (message "Getting mail from post office ...") |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
641 (if (or (and (file-exists-p tofile) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
642 (/= 0 (nth 7 (file-attributes tofile)))) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
643 (and (file-exists-p file) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
644 (/= 0 (nth 7 (file-attributes file))))) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
645 (message "Getting mail from %s..." file))) |
270 | 646 ;; Set TOFILE if have not already done so, and |
647 ;; rename or copy the file FILE to TOFILE if and as appropriate. | |
648 (cond ((not renamep) | |
649 (setq tofile file)) | |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
650 ((or (file-exists-p tofile) (and (not popmail) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
651 (not (file-exists-p file)))) |
270 | 652 nil) |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
653 ((and (not movemail) (not popmail)) |
1165 | 654 (rename-file file tofile nil) |
655 ;; Make the real inbox file empty. | |
656 ;; Leaving it deleted could cause lossage | |
657 ;; because mailers often won't create the file. | |
658 (condition-case () | |
659 (write-region (point) (point) file) | |
660 (file-error nil))) | |
270 | 661 (t |
662 (let ((errors nil)) | |
663 (unwind-protect | |
664 (save-excursion | |
665 (setq errors (generate-new-buffer " *rmail loss*")) | |
666 (buffer-disable-undo errors) | |
667 (call-process | |
668 (expand-file-name "movemail" exec-directory) | |
669 nil errors nil file tofile) | |
670 (if (not (buffer-modified-p errors)) | |
671 ;; No output => movemail won | |
672 nil | |
673 (set-buffer errors) | |
674 (subst-char-in-region (point-min) (point-max) | |
675 ?\n ?\ ) | |
676 (goto-char (point-max)) | |
677 (skip-chars-backward " \t") | |
678 (delete-region (point) (point-max)) | |
679 (goto-char (point-min)) | |
680 (if (looking-at "movemail: ") | |
681 (delete-region (point-min) (match-end 0))) | |
682 (beep t) | |
683 (message (concat "movemail: " | |
684 (buffer-substring (point-min) | |
685 (point-max)))) | |
686 (sit-for 3) | |
687 nil)) | |
688 (if errors (kill-buffer errors)))))) | |
689 ;; At this point, TOFILE contains the name to read: | |
690 ;; Either the alternate name (if we renamed) | |
691 ;; or the actual inbox (if not renaming). | |
692 (if (file-exists-p tofile) | |
693 (let (size) | |
694 (goto-char (point-max)) | |
695 (setq size (nth 1 (insert-file-contents tofile))) | |
696 (goto-char (point-max)) | |
697 (or (= (preceding-char) ?\n) | |
698 (zerop size) | |
699 (insert ?\n)) | |
700 (setq delete-files (cons tofile delete-files)))) | |
701 (message "") | |
702 (setq files (cdr files))) | |
703 delete-files)) | |
704 | |
705 ;; the rmail-break-forwarded-messages feature is not implemented | |
706 (defun rmail-convert-to-babyl-format () | |
707 (let ((count 0) start | |
402
14485c6a56aa
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
346
diff
changeset
|
708 (case-fold-search nil) |
14485c6a56aa
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
346
diff
changeset
|
709 (invalid-input-resync |
14485c6a56aa
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
346
diff
changeset
|
710 (function (lambda () |
14485c6a56aa
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
346
diff
changeset
|
711 (message "Invalid Babyl format in inbox!") |
14485c6a56aa
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
346
diff
changeset
|
712 (sit-for 1) |
14485c6a56aa
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
346
diff
changeset
|
713 ;; Try to get back in sync with a real message. |
14485c6a56aa
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
346
diff
changeset
|
714 (if (re-search-forward |
14485c6a56aa
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
346
diff
changeset
|
715 (concat mmdf-delim1 "\\|^From") nil t) |
14485c6a56aa
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
346
diff
changeset
|
716 (beginning-of-line) |
14485c6a56aa
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
346
diff
changeset
|
717 (goto-char (point-max))))))) |
270 | 718 (goto-char (point-min)) |
719 (save-restriction | |
720 (while (not (eobp)) | |
721 (cond ((looking-at "BABYL OPTIONS:");Babyl header | |
402
14485c6a56aa
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
346
diff
changeset
|
722 (if (search-forward "\n\^_" nil t) |
14485c6a56aa
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
346
diff
changeset
|
723 ;; If we find the proper terminator, delete through there. |
14485c6a56aa
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
346
diff
changeset
|
724 (delete-region (point-min) (point)) |
14485c6a56aa
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
346
diff
changeset
|
725 (funcall invalid-input-resync) |
405
698d5d6e8f8b
*** empty log message ***
Michael I. Bushnell <mib@gnu.org>
parents:
403
diff
changeset
|
726 (delete-region (point-min) (point)))) |
270 | 727 ;; Babyl format message |
728 ((looking-at "\^L") | |
729 (or (search-forward "\n\^_" nil t) | |
402
14485c6a56aa
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
346
diff
changeset
|
730 (funcall invalid-input-resync)) |
270 | 731 (setq count (1+ count)) |
732 ;; Make sure there is no extra white space after the ^_ | |
733 ;; at the end of the message. | |
734 ;; Narrowing will make sure that whatever follows the junk | |
735 ;; will be treated properly. | |
736 (delete-region (point) | |
737 (save-excursion | |
738 (skip-chars-forward " \t\n") | |
739 (point))) | |
740 (narrow-to-region (point) (point-max))) | |
741 ;;*** MMDF format | |
742 ((let ((case-fold-search t)) | |
743 (looking-at mmdf-delim1)) | |
744 (let ((case-fold-search t)) | |
745 (replace-match "\^L\n0, unseen,,\n*** EOOH ***\n") | |
746 (setq start (point)) | |
747 (re-search-forward mmdf-delim2 nil t) | |
748 (replace-match "\^_")) | |
749 (save-excursion | |
750 (save-restriction | |
751 (narrow-to-region start (1- (point))) | |
752 (goto-char (point-min)) | |
753 (while (search-forward "\n\^_" nil t); single char "\^_" | |
754 (replace-match "\n^_")))); 2 chars: "^" and "_" | |
755 (narrow-to-region (point) (point-max)) | |
756 (setq count (1+ count))) | |
757 ;;*** Mail format | |
758 ((looking-at "^From ") | |
759 (setq start (point)) | |
760 (insert "\^L\n0, unseen,,\n*** EOOH ***\n") | |
761 (rmail-nuke-pinhead-header) | |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
762 ;; If this message has a Content-Length field, |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
763 ;; skip to the end of the contents. |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
764 (let* ((header-end (save-excursion |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
765 (and (re-search-forward "\n\n" nil t) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
766 (point)))) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
767 (case-fold-search t) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
768 (size |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
769 ;; Get the numeric value from the Content-Length field. |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
770 (save-excursion |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
771 ;; Back up to end of prev line, |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
772 ;; in case the Content-Length field comes first. |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
773 (forward-char -1) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
774 (and (search-forward "\ncontent-length: " |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
775 header-end t) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
776 (let ((beg (point)) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
777 (eol (progn (end-of-line) (point)))) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
778 (read (buffer-substring beg eol))))))) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
779 (if size |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
780 (goto-char (+ header-end size)))) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
781 |
270 | 782 (if (re-search-forward |
783 (concat "^[\^_]?\\(" | |
617 | 784 rmail-unix-mail-delimiter |
785 "\\|" | |
270 | 786 mmdf-delim1 "\\|" |
787 "^BABYL OPTIONS:\\|" | |
788 "\^L\n[01],\\)") nil t) | |
789 (goto-char (match-beginning 1)) | |
790 (goto-char (point-max))) | |
791 (setq count (1+ count)) | |
792 (save-excursion | |
793 (save-restriction | |
794 (narrow-to-region start (point)) | |
795 (goto-char (point-min)) | |
796 (while (search-forward "\n\^_" nil t); single char | |
797 (replace-match "\n^_")))); 2 chars: "^" and "_" | |
798 (insert ?\^_) | |
799 (narrow-to-region (point) (point-max))) | |
800 ;; | |
801 ;;This is a kludge, in case we're wrong about mmdf not | |
802 ;;allowing anything in between. If it loses, we'll have | |
803 ;;to look for something else | |
405
698d5d6e8f8b
*** empty log message ***
Michael I. Bushnell <mib@gnu.org>
parents:
403
diff
changeset
|
804 (t (error "Cannot convert to babyl format"))))) |
270 | 805 count)) |
806 | |
807 ;; Delete the "From ..." line, creating various other headers with | |
808 ;; information from it if they don't already exist. Now puts the | |
809 ;; original line into a mail-from: header line for debugging. | |
810 (defun rmail-nuke-pinhead-header () | |
811 (save-excursion | |
812 (save-restriction | |
813 (let ((start (point)) | |
814 (end (progn | |
815 (condition-case () | |
816 (search-forward "\n\n") | |
817 (error | |
818 (goto-char (point-max)) | |
819 (insert "\n\n"))) | |
820 (point))) | |
821 has-from has-date) | |
822 (narrow-to-region start end) | |
823 (let ((case-fold-search t)) | |
824 (goto-char start) | |
825 (setq has-from (search-forward "\nFrom:" nil t)) | |
826 (goto-char start) | |
827 (setq has-date (and (search-forward "\nDate:" nil t) (point))) | |
828 (goto-char start)) | |
829 (let ((case-fold-search nil)) | |
617 | 830 (if (re-search-forward (concat "^" rmail-unix-mail-delimiter) nil t) |
270 | 831 (replace-match |
832 (concat | |
833 "Mail-from: \\&" | |
834 ;; Keep and reformat the date if we don't | |
835 ;; have a Date: field. | |
836 (if has-date | |
837 "" | |
1112 | 838 (concat |
839 "Date: \\3, \\5 \\4 \\9 \\6 " | |
840 | |
841 ;; The timezone could be matched by group 7 or group 10. | |
842 ;; If neither of them matched, assume EST, since only | |
843 ;; Easterners would be so sloppy. | |
844 ;; It's a shame the substitution can't use "\\10". | |
845 (cond | |
846 ((/= (match-beginning 7) (match-end 7)) "\\7") | |
847 ((/= (match-beginning 10) (match-end 10)) | |
848 (buffer-substring (match-beginning 10) | |
849 (match-end 10))) | |
850 (t "EST")) | |
851 "\n")) | |
270 | 852 ;; Keep and reformat the sender if we don't |
853 ;; have a From: field. | |
854 (if has-from | |
855 "" | |
856 "From: \\1\n"))))))))) | |
857 | |
858 ;;;; *** Rmail Message Formatting and Header Manipulation *** | |
859 | |
860 (defun rmail-reformat-message (beg end) | |
861 (goto-char beg) | |
862 (forward-line 1) | |
863 (if (/= (following-char) ?0) | |
864 (error "Bad format in RMAIL file.")) | |
865 (let ((buffer-read-only nil) | |
866 (delta (- (buffer-size) end))) | |
867 (delete-char 1) | |
868 (insert ?1) | |
869 (forward-line 1) | |
870 (if (looking-at "Summary-line: ") | |
871 (forward-line 1)) | |
872 (if (looking-at "\\*\\*\\* EOOH \\*\\*\\*\n") | |
873 (delete-region (point) | |
874 (progn (forward-line 1) (point)))) | |
875 (let ((str (buffer-substring (point) | |
876 (save-excursion (search-forward "\n\n" end 'move) | |
877 (point))))) | |
878 (insert str "*** EOOH ***\n") | |
879 (narrow-to-region (point) (- (buffer-size) delta))) | |
880 (goto-char (point-min)) | |
881 (if rmail-ignored-headers (rmail-clear-headers)) | |
882 (if rmail-message-filter (funcall rmail-message-filter)))) | |
883 | |
884 (defun rmail-clear-headers () | |
885 (if (search-forward "\n\n" nil t) | |
886 (save-restriction | |
887 (narrow-to-region (point-min) (point)) | |
888 (let ((buffer-read-only nil)) | |
889 (while (let ((case-fold-search t)) | |
890 (goto-char (point-min)) | |
891 (re-search-forward rmail-ignored-headers nil t)) | |
892 (beginning-of-line) | |
893 (delete-region (point) | |
894 (progn (re-search-forward "\n[^ \t]") | |
895 (forward-char -1) | |
896 (point)))))))) | |
897 | |
898 (defun rmail-toggle-header () | |
899 "Show original message header if pruned header currently shown, or vice versa." | |
900 (interactive) | |
901 (rmail-maybe-set-message-counters) | |
902 (narrow-to-region (rmail-msgbeg rmail-current-message) (point-max)) | |
903 (let ((buffer-read-only nil)) | |
904 (goto-char (point-min)) | |
905 (forward-line 1) | |
906 (if (= (following-char) ?1) | |
907 (progn (delete-char 1) | |
908 (insert ?0) | |
909 (forward-line 1) | |
910 (if (looking-at "Summary-Line:") | |
911 (forward-line 1)) | |
912 (insert "*** EOOH ***\n") | |
913 (forward-char -1) | |
914 (search-forward "\n*** EOOH ***\n") | |
915 (forward-line -1) | |
916 (let ((temp (point))) | |
917 (and (search-forward "\n\n" nil t) | |
918 (delete-region temp (point)))) | |
919 (goto-char (point-min)) | |
920 (search-forward "\n*** EOOH ***\n") | |
921 (narrow-to-region (point) (point-max))) | |
922 (rmail-reformat-message (point-min) (point-max))))) | |
923 | |
924 ;;;; *** Rmail Attributes and Keywords *** | |
925 | |
926 ;; Make a string describing current message's attributes and keywords | |
927 ;; and set it up as the name of a minor mode | |
928 ;; so it will appear in the mode line. | |
929 (defun rmail-display-labels () | |
930 (let ((blurb "") (beg (point-min-marker)) (end (point-max-marker))) | |
931 (save-excursion | |
932 (unwind-protect | |
933 (progn | |
934 (widen) | |
935 (goto-char (rmail-msgbeg rmail-current-message)) | |
936 (forward-line 1) | |
937 (if (looking-at "[01],") | |
938 (progn | |
939 (narrow-to-region (point) (progn (end-of-line) (point))) | |
940 ;; Truly valid BABYL format requires a space before each | |
941 ;; attribute or keyword name. Put them in if missing. | |
942 (let (buffer-read-only) | |
943 (goto-char (point-min)) | |
944 (while (search-forward "," nil t) | |
945 (or (looking-at "[ ,]") (eobp) | |
946 (insert " ")))) | |
947 (goto-char (point-max)) | |
948 (if (search-backward ",," nil 'move) | |
949 (progn | |
950 (if (> (point) (1+ (point-min))) | |
951 (setq blurb (buffer-substring (+ 1 (point-min)) (point)))) | |
952 (if (> (- (point-max) (point)) 2) | |
953 (setq blurb | |
954 (concat blurb | |
955 ";" | |
956 (buffer-substring (+ (point) 3) | |
957 (1- (point-max))))))))))) | |
958 ;; Note: we don't use save-restriction because that does not work right | |
959 ;; if changes are made outside the saved restriction | |
960 ;; before that restriction is restored. | |
961 (narrow-to-region beg end) | |
962 (set-marker beg nil) | |
963 (set-marker end nil))) | |
964 (while (string-match " +," blurb) | |
965 (setq blurb (concat (substring blurb 0 (match-beginning 0)) "," | |
966 (substring blurb (match-end 0))))) | |
967 (while (string-match ", +" blurb) | |
968 (setq blurb (concat (substring blurb 0 (match-beginning 0)) "," | |
969 (substring blurb (match-end 0))))) | |
970 (setq mode-line-process | |
971 (concat " " rmail-current-message "/" rmail-total-messages | |
972 blurb)))) | |
973 | |
974 ;; Turn an attribute of a message on or off according to STATE. | |
975 ;; ATTR is the name of the attribute, as a string. | |
976 ;; MSGNUM is message number to change; nil means current message. | |
977 (defun rmail-set-attribute (attr state &optional msgnum) | |
978 (let ((omax (point-max-marker)) | |
979 (omin (point-min-marker)) | |
980 (buffer-read-only nil)) | |
981 (or msgnum (setq msgnum rmail-current-message)) | |
982 (unwind-protect | |
983 (save-excursion | |
984 (widen) | |
985 (goto-char (+ 3 (rmail-msgbeg msgnum))) | |
986 (let ((curstate | |
987 (not | |
988 (null (search-backward (concat ", " attr ",") | |
989 (prog1 (point) (end-of-line)) t))))) | |
990 (or (eq curstate (not (not state))) | |
991 (if curstate | |
992 (delete-region (point) (1- (match-end 0))) | |
993 (beginning-of-line) | |
994 (forward-char 2) | |
995 (insert " " attr ",")))) | |
996 (if (string= attr "deleted") | |
997 (rmail-set-message-deleted-p msgnum state))) | |
998 ;; Note: we don't use save-restriction because that does not work right | |
999 ;; if changes are made outside the saved restriction | |
1000 ;; before that restriction is restored. | |
1001 (narrow-to-region omin omax) | |
1002 (set-marker omin nil) | |
1003 (set-marker omax nil) | |
1004 (if (= msgnum rmail-current-message) | |
1005 (rmail-display-labels))))) | |
1006 | |
1007 ;; Return t if the attributes/keywords line of msg number MSG | |
1008 ;; contains a match for the regexp LABELS. | |
1009 (defun rmail-message-labels-p (msg labels) | |
1010 (save-excursion | |
1011 (save-restriction | |
1012 (widen) | |
1013 (goto-char (rmail-msgbeg msg)) | |
1014 (forward-char 3) | |
1015 (re-search-backward labels (prog1 (point) (end-of-line)) t)))) | |
1016 | |
1017 ;;;; *** Rmail Message Selection And Support *** | |
1018 | |
1019 (defun rmail-msgend (n) | |
1020 (marker-position (aref rmail-message-vector (1+ n)))) | |
1021 | |
1022 (defun rmail-msgbeg (n) | |
1023 (marker-position (aref rmail-message-vector n))) | |
1024 | |
1025 (defun rmail-widen-to-current-msgbeg (function) | |
1026 "Call FUNCTION with point at start of internal data of current message. | |
1027 Assumes that bounds were previously narrowed to display the message in Rmail. | |
1028 The bounds are widened enough to move point where desired, then narrowed | |
1029 again afterward. | |
1030 | |
1031 FUNCTION may not change the visible text of the message, but it may | |
1032 change the invisible header text." | |
1033 (save-excursion | |
344 | 1034 (let ((obeg (- (point-max) (point-min)))) |
270 | 1035 (unwind-protect |
1036 (progn | |
1037 (narrow-to-region (rmail-msgbeg rmail-current-message) | |
1038 (point-max)) | |
1039 (goto-char (point-min)) | |
1040 (funcall function)) | |
1041 ;; Note: we don't use save-restriction because that does not work right | |
1042 ;; if changes are made outside the saved restriction | |
1043 ;; before that restriction is restored. | |
1044 ;; Here we assume that changes made by FUNCTION | |
1045 ;; occur before the visible region of the message. | |
344 | 1046 (narrow-to-region (- (point-max) obeg) (point-max)))))) |
270 | 1047 |
1048 (defun rmail-forget-messages () | |
1049 (unwind-protect | |
1050 (if (vectorp rmail-message-vector) | |
1051 (let* ((i 0) | |
1052 (v rmail-message-vector) | |
1053 (n (length v))) | |
1054 (while (< i n) | |
1055 (move-marker (aref v i) nil) | |
1056 (setq i (1+ i))))) | |
1057 (setq rmail-message-vector nil) | |
1058 (setq rmail-deleted-vector nil))) | |
1059 | |
1060 (defun rmail-maybe-set-message-counters () | |
1061 (if (not (and rmail-deleted-vector | |
1062 rmail-message-vector | |
1063 rmail-current-message | |
1064 rmail-total-messages)) | |
1065 (rmail-set-message-counters))) | |
1066 | |
1067 (defun rmail-count-new-messages (&optional nomsg) | |
1068 (let* ((case-fold-search nil) | |
1069 (total-messages 0) | |
1070 (messages-head nil) | |
1071 (deleted-head nil)) | |
1072 (or nomsg (message "Counting new messages...")) | |
1073 (goto-char (point-max)) | |
1074 ;; Put at the end of messages-head | |
1075 ;; the entry for message N+1, which marks | |
1076 ;; the end of message N. (N = number of messages). | |
1077 (search-backward "\n\^_") | |
1078 (forward-char 1) | |
1079 (setq messages-head (list (point-marker))) | |
1080 (rmail-set-message-counters-counter (point-min)) | |
1081 (setq rmail-current-message (1+ rmail-total-messages)) | |
1082 (setq rmail-total-messages | |
1083 (+ rmail-total-messages total-messages)) | |
1084 (setq rmail-message-vector | |
1085 (vconcat rmail-message-vector (cdr messages-head))) | |
1086 (aset rmail-message-vector | |
1087 rmail-current-message (car messages-head)) | |
1088 (setq rmail-deleted-vector | |
1089 (concat rmail-deleted-vector deleted-head)) | |
1090 (setq rmail-summary-vector | |
1091 (vconcat rmail-summary-vector (make-vector total-messages nil))) | |
1092 (goto-char (point-min)) | |
1093 (or nomsg (message "Counting new messages...done (%d)" total-messages)))) | |
1094 | |
1095 (defun rmail-set-message-counters () | |
1096 (rmail-forget-messages) | |
1097 (save-excursion | |
1098 (save-restriction | |
1099 (widen) | |
1100 (let* ((point-save (point)) | |
1101 (total-messages 0) | |
1102 (messages-after-point) | |
1103 (case-fold-search nil) | |
1104 (messages-head nil) | |
1105 (deleted-head nil)) | |
1106 (message "Counting messages...") | |
1107 (goto-char (point-max)) | |
1108 ;; Put at the end of messages-head | |
1109 ;; the entry for message N+1, which marks | |
1110 ;; the end of message N. (N = number of messages). | |
1111 (search-backward "\n\^_") | |
1112 (forward-char 1) | |
1113 (setq messages-head (list (point-marker))) | |
1114 (rmail-set-message-counters-counter (min (point) point-save)) | |
1115 (setq messages-after-point total-messages) | |
1116 (rmail-set-message-counters-counter) | |
1117 (setq rmail-total-messages total-messages) | |
1118 (setq rmail-current-message | |
1119 (min total-messages | |
1120 (max 1 (- total-messages messages-after-point)))) | |
1121 (setq rmail-message-vector | |
1122 (apply 'vector (cons (point-min-marker) messages-head)) | |
1123 rmail-deleted-vector (concat "D" deleted-head) | |
1124 rmail-summary-vector (make-vector rmail-total-messages nil)) | |
1125 (message "Counting messages...done"))))) | |
1126 | |
1127 (defun rmail-set-message-counters-counter (&optional stop) | |
1128 (while (search-backward "\n\^_\^L\n" stop t) | |
1129 (forward-char 1) | |
1130 (setq messages-head (cons (point-marker) messages-head)) | |
1131 (save-excursion | |
1132 (setq deleted-head | |
1133 (cons (if (search-backward ", deleted," | |
1134 (prog1 (point) | |
1135 (forward-line 2)) | |
1136 t) | |
1137 ?D ?\ ) | |
1138 deleted-head))) | |
1139 (if (zerop (% (setq total-messages (1+ total-messages)) 20)) | |
1140 (message "Counting messages...%d" total-messages)))) | |
1141 | |
1142 (defun rmail-beginning-of-message () | |
1143 "Show current message starting from the beginning." | |
1144 (interactive) | |
1145 (rmail-show-message rmail-current-message)) | |
1146 | |
1147 (defun rmail-show-message (&optional n) | |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1148 "Show message number N (prefix argument), counting from start of file. |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1149 If summary buffer is currently displayed, update current message there also." |
270 | 1150 (interactive "p") |
1151 (rmail-maybe-set-message-counters) | |
1152 (widen) | |
1153 (if (zerop rmail-total-messages) | |
1154 (progn (narrow-to-region (point-min) (1- (point-max))) | |
1155 (goto-char (point-min)) | |
1156 (setq mode-line-process nil)) | |
1157 (let (blurb) | |
1158 (if (not n) | |
1159 (setq n rmail-current-message) | |
1160 (cond ((<= n 0) | |
1161 (setq n 1 | |
1162 rmail-current-message 1 | |
1163 blurb "No previous message")) | |
1164 ((> n rmail-total-messages) | |
1165 (setq n rmail-total-messages | |
1166 rmail-current-message rmail-total-messages | |
1167 blurb "No following message")) | |
1168 (t | |
1169 (setq rmail-current-message n)))) | |
1170 (let ((beg (rmail-msgbeg n)) | |
1171 (end (rmail-msgend n))) | |
1172 (goto-char beg) | |
1173 (forward-line 1) | |
1174 (if (= (following-char) ?0) | |
1175 (progn | |
1176 (rmail-reformat-message beg end) | |
1177 (rmail-set-attribute "unseen" nil)) | |
1178 (search-forward "\n*** EOOH ***\n" end t) | |
1179 (narrow-to-region (point) end)) | |
1180 (goto-char (point-min)) | |
1181 (rmail-display-labels) | |
1182 (run-hooks 'rmail-show-message-hook) | |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1183 ;; If there is a summary buffer, try to move to this message |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1184 ;; in that buffer. But don't complain if this message |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1185 ;; is not mentioned in the summary. |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1186 (if (rmail-summary-exists) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1187 (let ((curr-msg rmail-current-message)) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1188 (rmail-select-summary |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1189 (rmail-summary-goto-msg curr-msg t t)))) |
270 | 1190 (if blurb |
1191 (message blurb)))))) | |
1192 | |
1193 (defun rmail-next-message (n) | |
1194 "Show following message whether deleted or not. | |
1195 With prefix arg N, moves forward N messages, or backward if N is negative." | |
1196 (interactive "p") | |
1197 (rmail-maybe-set-message-counters) | |
1198 (rmail-show-message (+ rmail-current-message n))) | |
1199 | |
1200 (defun rmail-previous-message (n) | |
1201 "Show previous message whether deleted or not. | |
1202 With prefix arg N, moves backward N messages, or forward if N is negative." | |
1203 (interactive "p") | |
1204 (rmail-next-message (- n))) | |
1205 | |
1206 (defun rmail-next-undeleted-message (n) | |
1207 "Show following non-deleted message. | |
1208 With prefix arg N, moves forward N non-deleted messages, | |
1209 or backward if N is negative." | |
1210 (interactive "p") | |
1211 (rmail-maybe-set-message-counters) | |
1212 (let ((lastwin rmail-current-message) | |
1213 (current rmail-current-message)) | |
1214 (while (and (> n 0) (< current rmail-total-messages)) | |
1215 (setq current (1+ current)) | |
1216 (if (not (rmail-message-deleted-p current)) | |
1217 (setq lastwin current n (1- n)))) | |
1218 (while (and (< n 0) (> current 1)) | |
1219 (setq current (1- current)) | |
1220 (if (not (rmail-message-deleted-p current)) | |
1221 (setq lastwin current n (1+ n)))) | |
1222 (if (/= lastwin rmail-current-message) | |
1223 (rmail-show-message lastwin)) | |
1224 (if (< n 0) | |
997
894201c58bb8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
937
diff
changeset
|
1225 (message "No previous nondeleted message")) |
270 | 1226 (if (> n 0) |
997
894201c58bb8
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
937
diff
changeset
|
1227 (message "No following nondeleted message")))) |
270 | 1228 |
1229 (defun rmail-previous-undeleted-message (n) | |
1230 "Show previous non-deleted message. | |
1231 With prefix argument N, moves backward N non-deleted messages, | |
1232 or forward if N is negative." | |
1233 (interactive "p") | |
1234 (rmail-next-undeleted-message (- n))) | |
1235 | |
1236 (defun rmail-first-message () | |
1237 "Show first message in file." | |
1238 (interactive) | |
1239 (rmail-maybe-set-message-counters) | |
1240 (rmail-show-message 1)) | |
1241 | |
1242 (defun rmail-last-message () | |
1243 "Show last message in file." | |
1244 (interactive) | |
1245 (rmail-maybe-set-message-counters) | |
1246 (rmail-show-message rmail-total-messages)) | |
1247 | |
1248 (defun rmail-what-message () | |
1249 (let ((where (point)) | |
1250 (low 1) | |
1251 (high rmail-total-messages) | |
1252 (mid (/ rmail-total-messages 2))) | |
1253 (while (> (- high low) 1) | |
1254 (if (>= where (rmail-msgbeg mid)) | |
1255 (setq low mid) | |
1256 (setq high mid)) | |
1257 (setq mid (+ low (/ (- high low) 2)))) | |
1258 (if (>= where (rmail-msgbeg high)) high low))) | |
1259 | |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1260 (defun rmail-message-recipients-p (msg recipients &optional primary-only) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1261 (save-restriction |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1262 (goto-char (rmail-msgbeg msg)) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1263 (search-forward "\n*** EOOH ***\n") |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1264 (narrow-to-region (point) (progn (search-forward "\n\n") (point))) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1265 (or (string-match recipients (or (mail-fetch-field "To") "")) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1266 (string-match recipients (or (mail-fetch-field "From") "")) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1267 (if (not primary-only) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1268 (string-match recipients (or (mail-fetch-field "Cc") "")))))) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1269 |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1270 (defun rmail-message-regexp-p (msg regexp) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1271 "Return t, if for message number MSG, regexp REGEXP matches in the header." |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1272 (goto-char (rmail-msgbeg msg)) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1273 (let ((end |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1274 (save-excursion |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1275 (search-forward "*** EOOH ***" (point-max)) (point)))) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1276 (re-search-forward regexp end t))) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1277 |
270 | 1278 (defvar rmail-search-last-regexp nil) |
874
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1279 (defun rmail-search (regexp &optional n) |
270 | 1280 "Show message containing next match for REGEXP. |
874
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1281 Prefix argument gives repeat count; negative argument means search |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1282 backwards (through earlier messages). |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1283 Interactively, empty argument means use same regexp used last time." |
270 | 1284 (interactive |
1285 (let* ((reversep (< (prefix-numeric-value current-prefix-arg) 0)) | |
1286 (prompt | |
1287 (concat (if reversep "Reverse " "") "Rmail search (regexp): ")) | |
1288 regexp) | |
1289 (if rmail-search-last-regexp | |
1290 (setq prompt (concat prompt | |
1291 "(default " | |
1292 rmail-search-last-regexp | |
1293 ") "))) | |
1294 (setq regexp (read-string prompt)) | |
1295 (cond ((not (equal regexp "")) | |
1296 (setq rmail-search-last-regexp regexp)) | |
1297 ((not rmail-search-last-regexp) | |
1298 (error "No previous Rmail search string"))) | |
874
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1299 (list rmail-search-last-regexp |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1300 (prefix-numeric-value current-prefix-arg)))) |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1301 (or n (setq n 1)) |
270 | 1302 (message "%sRmail search for %s..." |
937
0f082d63bfd6
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
874
diff
changeset
|
1303 (if (< n 0) "Reverse " "") |
270 | 1304 regexp) |
1305 (rmail-maybe-set-message-counters) | |
1306 (let ((omin (point-min)) | |
1307 (omax (point-max)) | |
1308 (opoint (point)) | |
1309 win | |
874
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1310 (reversep (< n 0)) |
270 | 1311 (msg rmail-current-message)) |
1312 (unwind-protect | |
1313 (progn | |
1314 (widen) | |
874
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1315 (while (/= n 0) |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1316 ;; Check messages one by one, advancing message number up or down |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1317 ;; but searching forward through each message. |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1318 (if reversep |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1319 (while (and (null win) (> msg 1)) |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1320 (goto-char (rmail-msgbeg (setq msg (1- msg)))) |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1321 (setq win (re-search-forward |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1322 regexp (rmail-msgend msg) t))) |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1323 (while (and (null win) (< msg rmail-total-messages)) |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1324 (goto-char (rmail-msgbeg (setq msg (1+ msg)))) |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1325 (setq win (re-search-forward regexp (rmail-msgend msg) t)))) |
937
0f082d63bfd6
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
874
diff
changeset
|
1326 (setq n (+ n (if reversep 1 -1))))) |
270 | 1327 (if win |
1328 (progn | |
1329 ;; If this is a reverse search and we found a message, | |
1330 ;; search backward thru this message to position point. | |
1331 (if reversep | |
1332 (progn | |
1333 (goto-char (rmail-msgend msg)) | |
1334 (re-search-backward | |
1335 regexp (rmail-msgbeg msg) t))) | |
1336 (setq win (point)) | |
1337 (rmail-show-message msg) | |
1338 (message "%sRmail search for %s...done" | |
1339 (if reversep "Reverse " "") | |
1340 regexp) | |
1341 (goto-char win)) | |
1342 (goto-char opoint) | |
1343 (narrow-to-region omin omax) | |
1344 (ding) | |
1345 (message "Search failed: %s" regexp))))) | |
1346 | |
874
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1347 (defun rmail-search-backwards (regexp &optional n) |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1348 "Show message containing previous match for REGEXP. |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1349 Prefix argument gives repeat count; negative argument means search |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1350 forward (through later messages). |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1351 Interactively, empty argument means use same regexp used last time." |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1352 (interactive |
937
0f082d63bfd6
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
874
diff
changeset
|
1353 (let* ((reversep (>= (prefix-numeric-value current-prefix-arg) 0)) |
874
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1354 (prompt |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1355 (concat (if reversep "Reverse " "") "Rmail search (regexp): ")) |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1356 regexp) |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1357 (if rmail-search-last-regexp |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1358 (setq prompt (concat prompt |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1359 "(default " |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1360 rmail-search-last-regexp |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1361 ") "))) |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1362 (setq regexp (read-string prompt)) |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1363 (cond ((not (equal regexp "")) |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1364 (setq rmail-search-last-regexp regexp)) |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1365 ((not rmail-search-last-regexp) |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1366 (error "No previous Rmail search string"))) |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1367 (list rmail-search-last-regexp |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1368 (prefix-numeric-value current-prefix-arg)))) |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1369 (rmail-search regexp (- (or n -1)))) |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1370 |
270 | 1371 ;; Show the first message which has the `unseen' attribute. |
1372 (defun rmail-first-unseen-message () | |
1360
9cb1a4b90b5c
Cleaned up rmail-first-unseen-message.
Joseph Arceneaux <jla@gnu.org>
parents:
1342
diff
changeset
|
1373 (rmail-maybe-set-message-counters) |
270 | 1374 (let ((current 1) |
1375 found) | |
1376 (save-restriction | |
1377 (widen) | |
1378 (while (and (not found) (< current rmail-total-messages)) | |
1379 (if (rmail-message-labels-p current ", ?\\(unseen\\),") | |
346 | 1380 (setq found current)) |
1381 (setq current (1+ current)))) | |
1342
776d4c59f256
* rmail.el (rmail-first-unseen-message): Don't show the message,
Joseph Arceneaux <jla@gnu.org>
parents:
1267
diff
changeset
|
1382 ;; Let the caller show the message. |
776d4c59f256
* rmail.el (rmail-first-unseen-message): Don't show the message,
Joseph Arceneaux <jla@gnu.org>
parents:
1267
diff
changeset
|
1383 ;; (if found |
776d4c59f256
* rmail.el (rmail-first-unseen-message): Don't show the message,
Joseph Arceneaux <jla@gnu.org>
parents:
1267
diff
changeset
|
1384 ;; (rmail-show-message found)) |
776d4c59f256
* rmail.el (rmail-first-unseen-message): Don't show the message,
Joseph Arceneaux <jla@gnu.org>
parents:
1267
diff
changeset
|
1385 found)) |
270 | 1386 |
1387 ;;;; *** Rmail Message Deletion Commands *** | |
1388 | |
1389 (defun rmail-message-deleted-p (n) | |
1390 (= (aref rmail-deleted-vector n) ?D)) | |
1391 | |
1392 (defun rmail-set-message-deleted-p (n state) | |
1393 (aset rmail-deleted-vector n (if state ?D ?\ ))) | |
1394 | |
1395 (defun rmail-delete-message () | |
1396 "Delete this message and stay on it." | |
1397 (interactive) | |
1398 (rmail-set-attribute "deleted" t)) | |
1399 | |
1400 (defun rmail-undelete-previous-message () | |
1401 "Back up to deleted message, select it, and undelete it." | |
1402 (interactive) | |
1403 (let ((msg rmail-current-message)) | |
1404 (while (and (> msg 0) | |
1405 (not (rmail-message-deleted-p msg))) | |
1406 (setq msg (1- msg))) | |
1407 (if (= msg 0) | |
1408 (error "No previous deleted message") | |
1409 (if (/= msg rmail-current-message) | |
1410 (rmail-show-message msg)) | |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1411 (rmail-set-attribute "deleted" nil) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1412 (if (rmail-summary-exists) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1413 (save-excursion |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1414 (set-buffer rmail-summary-buffer) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1415 (rmail-summary-mark-undeleted msg))) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1416 (rmail-maybe-display-summary)))) |
270 | 1417 |
1418 (defun rmail-delete-forward (&optional backward) | |
1419 "Delete this message and move to next nondeleted one. | |
1420 Deleted messages stay in the file until the \\[rmail-expunge] command is given. | |
819
5bbabfcef929
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
814
diff
changeset
|
1421 With prefix argument, delete and move backward." |
270 | 1422 (interactive "P") |
1423 (rmail-set-attribute "deleted" t) | |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1424 (let ((del-msg rmail-current-message)) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1425 (if (rmail-summary-exists) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1426 (save-excursion |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1427 (set-buffer rmail-summary-buffer) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1428 (rmail-summary-mark-deleted del-msg))) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1429 (rmail-next-undeleted-message (if backward -1 1)) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1430 (rmail-maybe-display-summary))) |
270 | 1431 |
1432 (defun rmail-delete-backward () | |
1433 "Delete this message and move to previous nondeleted one. | |
1434 Deleted messages stay in the file until the \\[rmail-expunge] command is given." | |
1435 (interactive) | |
1436 (rmail-delete-forward t)) | |
1437 | |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1438 (defun rmail-only-expunge () |
270 | 1439 "Actually erase all deleted messages in the file." |
1440 (interactive) | |
1441 (message "Expunging deleted messages...") | |
1442 ;; Discard all undo records for this buffer. | |
1443 (or (eq buffer-undo-list t) | |
1444 (setq buffer-undo-list nil)) | |
1445 (rmail-maybe-set-message-counters) | |
1446 (let* ((omax (- (buffer-size) (point-max))) | |
1447 (omin (- (buffer-size) (point-min))) | |
1448 (opoint (if (and (> rmail-current-message 0) | |
1449 (= ?D (aref rmail-deleted-vector rmail-current-message))) | |
1450 0 (- (point) (point-min)))) | |
1451 (messages-head (cons (aref rmail-message-vector 0) nil)) | |
1452 (messages-tail messages-head) | |
1453 ;; Don't make any undo records for the expunging. | |
1454 (buffer-undo-list t) | |
1455 (win)) | |
1456 (unwind-protect | |
1457 (save-excursion | |
1458 (widen) | |
1459 (goto-char (point-min)) | |
1460 (let ((counter 0) | |
1461 (number 1) | |
1462 (total rmail-total-messages) | |
1463 (new-message-number rmail-current-message) | |
1464 (new-summary nil) | |
1465 (buffer-read-only nil) | |
1466 (messages rmail-message-vector) | |
1467 (deleted rmail-deleted-vector) | |
1468 (summary rmail-summary-vector)) | |
1469 (setq rmail-total-messages nil | |
1470 rmail-current-message nil | |
1471 rmail-message-vector nil | |
1472 rmail-deleted-vector nil | |
1473 rmail-summary-vector nil) | |
1474 (while (<= number total) | |
1475 (if (= (aref deleted number) ?D) | |
1476 (progn | |
1477 (delete-region | |
1478 (marker-position (aref messages number)) | |
1479 (marker-position (aref messages (1+ number)))) | |
1480 (move-marker (aref messages number) nil) | |
1481 (if (> new-message-number counter) | |
1482 (setq new-message-number (1- new-message-number)))) | |
1483 (setq counter (1+ counter)) | |
1484 (setq messages-tail | |
1485 (setcdr messages-tail | |
1486 (cons (aref messages number) nil))) | |
1487 (setq new-summary | |
1488 (cons (if (= counter number) (aref summary (1- number))) | |
1489 new-summary))) | |
1490 (if (zerop (% (setq number (1+ number)) 20)) | |
1491 (message "Expunging deleted messages...%d" number))) | |
1492 (setq messages-tail | |
1493 (setcdr messages-tail | |
1494 (cons (aref messages number) nil))) | |
1495 (setq rmail-current-message new-message-number | |
1496 rmail-total-messages counter | |
1497 rmail-message-vector (apply 'vector messages-head) | |
1498 rmail-deleted-vector (make-string (1+ counter) ?\ ) | |
1499 rmail-summary-vector (vconcat (nreverse new-summary)) | |
1500 win t))) | |
1501 (message "Expunging deleted messages...done") | |
1502 (if (not win) | |
1503 (narrow-to-region (- (buffer-size) omin) (- (buffer-size) omax))) | |
1504 (rmail-show-message | |
1505 (if (zerop rmail-current-message) 1 nil)) | |
1506 (forward-char opoint)))) | |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1507 |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1508 (defun rmail-expunge () |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1509 "Erase deleted messages from Rmail file and summary buffer." |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1510 (interactive) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1511 (rmail-only-expunge) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1512 (if (rmail-summary-exists) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1513 (rmail-select-summary |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1514 (rmail-update-summary)))) |
270 | 1515 |
1516 ;;;; *** Rmail Mailing Commands *** | |
1517 | |
1518 (defun rmail-mail () | |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1519 "Send mail in another window. |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1520 While composing the message, use \\[mail-yank-original] to yank the |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1521 original message into it." |
270 | 1522 (interactive) |
1523 (mail-other-window nil nil nil nil nil (current-buffer))) | |
1524 | |
1525 (defun rmail-continue () | |
1526 "Continue composing outgoing message previously being composed." | |
1527 (interactive) | |
1528 (mail-other-window t)) | |
1529 | |
1530 (defun rmail-reply (just-sender) | |
1531 "Reply to the current message. | |
1532 Normally include CC: to all other recipients of original message; | |
1533 prefix argument means ignore them. While composing the reply, | |
1534 use \\[mail-yank-original] to yank the original message into it." | |
1535 (interactive "P") | |
1536 (let (from reply-to cc subject date to message-id resent-reply-to) | |
1537 (save-excursion | |
1538 (save-restriction | |
1539 (widen) | |
1540 (goto-char (rmail-msgbeg rmail-current-message)) | |
1541 (forward-line 1) | |
1542 (if (= (following-char) ?0) | |
1543 (narrow-to-region | |
1544 (progn (forward-line 2) | |
1545 (point)) | |
1546 (progn (search-forward "\n\n" (rmail-msgend rmail-current-message) | |
1547 'move) | |
1548 (point))) | |
1549 (narrow-to-region (point) | |
1550 (progn (search-forward "\n*** EOOH ***\n") | |
1551 (beginning-of-line) (point)))) | |
1552 (setq resent-reply-to (mail-fetch-field "resent-reply-to" t) | |
1553 from (mail-fetch-field "from") | |
1554 reply-to (or resent-reply-to | |
1555 (mail-fetch-field "reply-to" nil t) | |
1556 from) | |
1557 cc (cond (just-sender nil) | |
1558 (resent-reply-to (mail-fetch-field "resent-cc" t)) | |
1559 (t (mail-fetch-field "cc" nil t))) | |
1560 subject (or (and resent-reply-to | |
1561 (mail-fetch-field "resent-subject" t)) | |
1562 (mail-fetch-field "subject")) | |
1563 date (cond (resent-reply-to | |
1564 (mail-fetch-field "resent-date" t)) | |
1565 ((mail-fetch-field "date"))) | |
1566 to (cond (resent-reply-to | |
1567 (mail-fetch-field "resent-to" t)) | |
1568 ((mail-fetch-field "to" nil t)) | |
1569 ;((mail-fetch-field "apparently-to")) ack gag barf | |
1570 (t "")) | |
1571 message-id (cond (resent-reply-to | |
1572 (mail-fetch-field "resent-message-id" t)) | |
1573 ((mail-fetch-field "message-id")))))) | |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1574 (and (stringp subject) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1575 (or (string-match (concat "\\`" (regexp-quote rmail-reply-prefix)) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1576 subject) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1577 (setq subject (concat rmail-reply-prefix subject)))) |
270 | 1578 (mail-other-window nil |
1579 (mail-strip-quoted-names reply-to) | |
1580 subject | |
1581 (rmail-make-in-reply-to-field from date message-id) | |
1582 (if just-sender | |
1583 nil | |
1584 (let* ((cc-list (rmail-dont-reply-to | |
1585 (mail-strip-quoted-names | |
1586 (if (null cc) to (concat to ", " cc)))))) | |
1587 (if (string= cc-list "") nil cc-list))) | |
1588 (current-buffer) | |
1589 (list (list '(lambda (buf msgnum) | |
1590 (save-excursion | |
1591 (set-buffer buf) | |
1592 (rmail-set-attribute "answered" t msgnum))) | |
1593 (current-buffer) rmail-current-message))))) | |
1594 | |
1595 (defun rmail-make-in-reply-to-field (from date message-id) | |
1596 (cond ((not from) | |
1597 (if message-id | |
1598 message-id | |
1599 nil)) | |
1600 (mail-use-rfc822 | |
1601 (require 'rfc822) | |
1602 (let ((tem (car (rfc822-addresses from)))) | |
1603 (if message-id | |
1604 (if (string-match | |
1605 (regexp-quote (if (string-match "@[^@]*\\'" tem) | |
1606 (substring tem 0 (match-beginning 0)) | |
1607 tem)) | |
1608 message-id) | |
1609 ;; Message-ID is sufficiently informative | |
1610 message-id | |
1611 (concat message-id " (" tem ")")) | |
1612 ;; Use prin1 to fake RFC822 quoting | |
1613 (let ((field (prin1-to-string tem))) | |
1614 (if date | |
1615 (concat field "'s message of " date) | |
1616 field))))) | |
1617 ((let* ((foo "[^][\000-\037\177-\377()<>@,;:\\\" ]+") | |
1618 (bar "[^][\000-\037\177-\377()<>@,;:\\\"]+")) | |
1619 ;; Can't use format because format loses on \000 (unix *^&%*^&%$!!) | |
1620 (or (string-match (concat "\\`[ \t]*\\(" bar | |
1621 "\\)\\(<" foo "@" foo ">\\)?[ \t]*\\'") | |
1622 ;; "Unix Loser <Foo@bar.edu>" => "Unix Loser" | |
1623 from) | |
1624 (string-match (concat "\\`[ \t]*<" foo "@" foo ">[ \t]*(\\(" | |
1625 bar "\\))[ \t]*\\'") | |
1626 ;; "<Bugs@bar.edu>" (Losing Unix) => "Losing Unix" | |
1627 from))) | |
1628 (let ((start (match-beginning 1)) | |
1629 (end (match-end 1))) | |
1630 ;; Trim whitespace which above regexp match allows | |
1631 (while (and (< start end) | |
1632 (memq (aref from start) '(?\t ?\ ))) | |
1633 (setq start (1+ start))) | |
1634 (while (and (< start end) | |
1635 (memq (aref from (1- end)) '(?\t ?\ ))) | |
1636 (setq end (1- end))) | |
1637 (let ((field (substring from start end))) | |
1638 (if date (setq field (concat "message from " field " on " date))) | |
1639 (if message-id | |
1640 ;; "<AA259@bar.edu> (message from Unix Loser on 1-Apr-89)" | |
1641 (concat message-id " (" field ")") | |
1642 field)))) | |
1643 (t | |
1644 ;; If we can't kludge it simply, do it correctly | |
1645 (let ((mail-use-rfc822 t)) | |
1646 (rmail-make-in-reply-to-field from date message-id))))) | |
1647 | |
1648 (defun rmail-forward () | |
1649 "Forward the current message to another user." | |
1650 (interactive) | |
1651 (let ((forward-buffer (current-buffer)) | |
1652 (subject (concat "[" | |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1653 (let ((from (or (mail-fetch-field "From") |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1654 (mail-fetch-field ">From")))) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1655 (if from |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1656 (concat (mail-strip-quoted-names from) ": ") |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1657 "")) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1658 (or (mail-fetch-field "Subject") "") |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1659 "]"))) |
1137
6f2689fa1c37
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1135
diff
changeset
|
1660 ;; Turn off the usual actions for initializing the message body |
6f2689fa1c37
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1135
diff
changeset
|
1661 ;; because we want to get only the text from the failure message. |
6f2689fa1c37
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1135
diff
changeset
|
1662 (let (mail-signature mail-setup-hook) |
6f2689fa1c37
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1135
diff
changeset
|
1663 ;; If only one window, use it for the mail buffer. |
6f2689fa1c37
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1135
diff
changeset
|
1664 ;; Otherwise, use another window for the mail buffer |
6f2689fa1c37
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1135
diff
changeset
|
1665 ;; so that the Rmail buffer remains visible |
6f2689fa1c37
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1135
diff
changeset
|
1666 ;; and sending the mail will get back to it. |
6f2689fa1c37
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1135
diff
changeset
|
1667 (if (funcall (if (one-window-p t) |
6f2689fa1c37
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1135
diff
changeset
|
1668 (function mail) |
6f2689fa1c37
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1135
diff
changeset
|
1669 (function mail-other-window)) |
6f2689fa1c37
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1135
diff
changeset
|
1670 nil nil subject nil nil nil |
6f2689fa1c37
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1135
diff
changeset
|
1671 (list (list (function (lambda (buf msgnum) |
6f2689fa1c37
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1135
diff
changeset
|
1672 (save-excursion |
6f2689fa1c37
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1135
diff
changeset
|
1673 (set-buffer buf) |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1674 (rmail-set-attribute |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1675 "forwarded" t msgnum)))) |
1137
6f2689fa1c37
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1135
diff
changeset
|
1676 (current-buffer) |
6f2689fa1c37
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1135
diff
changeset
|
1677 rmail-current-message))) |
6f2689fa1c37
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1135
diff
changeset
|
1678 (save-excursion |
6f2689fa1c37
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1135
diff
changeset
|
1679 (goto-char (point-max)) |
6f2689fa1c37
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1135
diff
changeset
|
1680 (forward-line 1) |
6f2689fa1c37
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1135
diff
changeset
|
1681 (insert-buffer forward-buffer)))))) |
270 | 1682 |
1683 (defun rmail-resend (address &optional from comment mail-alias-file) | |
1684 "Resend current message to ADDRESSES. | |
1685 ADDRESSES should be a single address, a a string consisting of several | |
1686 addresses separated by commas, or a list of addresses. | |
1687 | |
1688 Optional FROM is the address to resend the message from, and | |
1689 defaults to the username of the person redistributing the message. | |
1690 Optional COMMENT is a string that will be inserted as a comment in the | |
1691 resent message. | |
1692 Optional ALIAS-FILE is alternate aliases file to be used by sendmail, | |
1693 typically for purposes of moderating a list." | |
1694 (interactive "sResend to: ") | |
1695 (if (not from) (setq from (user-login-name))) | |
1696 (let ((tembuf (generate-new-buffer " sendmail temp")) | |
1697 (mail-header-separator "") | |
1698 (case-fold-search nil) | |
1699 (mailbuf (current-buffer))) | |
1700 (unwind-protect | |
1701 (save-excursion | |
1702 ;;>> Copy message into temp buffer | |
1703 (set-buffer tembuf) | |
1704 (insert-buffer-substring mailbuf) | |
1705 (goto-char (point-min)) | |
1706 ;;>> Insert resent-from: | |
1707 (insert "Resent-From: " from "\n") | |
1708 (insert "Resent-Date: " (current-time-string) "\n") | |
1709 ;;>> Insert resent-to: and bcc if need be. | |
1710 (let ((before (point))) | |
1711 (insert "Resent-To: " (if (stringp address) | |
1712 address | |
1713 (mapconcat 'identity address ",\n\t")) | |
1714 "\n") | |
1715 (expand-mail-aliases before (point))) | |
1716 ;;>> Set up comment, if any. | |
1717 (if (and (sequencep comment) (not (zerop (length comment)))) | |
1718 (let ((before (point)) | |
1719 after) | |
1720 (insert comment) | |
1721 (or (eolp) (insert "\n")) | |
1722 (setq after (point)) | |
1723 (goto-char before) | |
1724 (while (< (point) after) | |
1725 (insert "Resent-Comment: ") | |
1726 (forward-line 1)))) | |
1727 ;; Don't expand aliases in the destination fields | |
1728 ;; of the original message. | |
1729 (let (mail-aliases) | |
1730 (sendmail-send-it))) | |
1731 (kill-buffer tembuf)))) | |
1732 | |
1267
1e1a54ebb29b
(mail-unsent-separator): Add another alternative.
Richard M. Stallman <rms@gnu.org>
parents:
1165
diff
changeset
|
1733 (defvar mail-unsent-separator |
1370
c017b62c8073
(mail-unsent-separator): Allow "original message" as alternative.
Richard M. Stallman <rms@gnu.org>
parents:
1360
diff
changeset
|
1734 (concat "^ *---+ +Unsent message follows +---+ *$\\|" |
c017b62c8073
(mail-unsent-separator): Allow "original message" as alternative.
Richard M. Stallman <rms@gnu.org>
parents:
1360
diff
changeset
|
1735 "^ *---+ +Returned message +---+ *$\\|" |
1372
e839dc00fc2e
(mail-unsent-separator): Handle "Message text follows".
Richard M. Stallman <rms@gnu.org>
parents:
1370
diff
changeset
|
1736 "^ *---+ +Original message +---+ *$\\|" |
1757
7e85913523ef
(mail-unsent-separator): Add `-- begin message --'.
Richard M. Stallman <rms@gnu.org>
parents:
1704
diff
changeset
|
1737 "^ *--+ +begin message +--+ *$\\|" |
1372
e839dc00fc2e
(mail-unsent-separator): Handle "Message text follows".
Richard M. Stallman <rms@gnu.org>
parents:
1370
diff
changeset
|
1738 "^|? *---+ +Message text follows: +---+ *|?$")) |
270 | 1739 |
1740 (defun rmail-retry-failure () | |
1741 "Edit a mail message which is based on the contents of the current message. | |
1742 For a message rejected by the mail system, extract the interesting headers and | |
1743 the body of the original message; otherwise copy the current message." | |
1744 (interactive) | |
1745 (require 'mail-utils) | |
1746 (let (to subj irp2 cc orig-message) | |
1747 (save-excursion | |
1748 ;; Narrow down to just the quoted original message | |
1749 (rmail-beginning-of-message) | |
1370
c017b62c8073
(mail-unsent-separator): Allow "original message" as alternative.
Richard M. Stallman <rms@gnu.org>
parents:
1360
diff
changeset
|
1750 (let ((case-fold-search t)) |
c017b62c8073
(mail-unsent-separator): Allow "original message" as alternative.
Richard M. Stallman <rms@gnu.org>
parents:
1360
diff
changeset
|
1751 (or (re-search-forward mail-unsent-separator nil t) |
c017b62c8073
(mail-unsent-separator): Allow "original message" as alternative.
Richard M. Stallman <rms@gnu.org>
parents:
1360
diff
changeset
|
1752 (error "Cannot parse this as a failure message"))) |
270 | 1753 (save-restriction |
1754 (narrow-to-region (point) (point-max)) | |
1755 ;; Now mail-fetch-field will get from headers of the original message, | |
1756 ;; not from the headers of the rejection. | |
1757 (setq to (mail-fetch-field "To") | |
1758 subj (mail-fetch-field "Subject") | |
1759 irp2 (mail-fetch-field "In-reply-to") | |
1760 cc (mail-fetch-field "Cc")) | |
1761 ;; Get the entire text (not headers) of the original message. | |
1762 (setq orig-message | |
1763 (buffer-substring | |
1764 (progn (search-forward "\n\n") (point)) | |
1765 (point-max))))) | |
1766 ;; Start sending a new message; default header fields from the original. | |
1135
e33f6475229a
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1112
diff
changeset
|
1767 ;; Turn off the usual actions for initializing the message body |
e33f6475229a
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1112
diff
changeset
|
1768 ;; because we want to get only the text from the failure message. |
e33f6475229a
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1112
diff
changeset
|
1769 (let (mail-signature mail-setup-hook) |
e33f6475229a
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1112
diff
changeset
|
1770 (if (mail-other-window nil to subj irp2 cc (current-buffer)) |
e33f6475229a
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1112
diff
changeset
|
1771 ;; Insert original text as initial text of new draft message. |
e33f6475229a
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1112
diff
changeset
|
1772 (progn |
e33f6475229a
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1112
diff
changeset
|
1773 (goto-char (point-max)) |
e33f6475229a
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1112
diff
changeset
|
1774 (insert orig-message) |
e33f6475229a
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1112
diff
changeset
|
1775 (goto-char (point-min)) |
e33f6475229a
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1112
diff
changeset
|
1776 (end-of-line)))))) |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1777 |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1778 (defun rmail-bury () |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1779 "Bury current Rmail buffer and its summary buffer." |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1780 (interactive) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1781 (let ((rmail-buffer (current-buffer))) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1782 (if (rmail-summary-exists) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1783 (let (window) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1784 (while (setq window (get-buffer-window rmail-summary-buffer)) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1785 (set-window-buffer (other-buffer rmail-summary-buffer))) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1786 (bury-buffer rmail-summary-buffer))) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1787 (switch-to-buffer (other-buffer (current-buffer))) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1788 (bury-buffer rmail-buffer))) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1789 |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1790 (defun rmail-summary-exists () |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1791 "Non-nil iff in an RMAIL buffer and an associated summary buffer exists. |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1792 Non-nil value returned is the summary buffer." |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1793 (and rmail-summary-buffer (buffer-name rmail-summary-buffer) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1794 rmail-summary-buffer)) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1795 |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1796 (defun rmail-summary-displayed () |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1797 "t iff in RMAIL buffer and an associated summary buffer is displayed." |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1798 (and rmail-summary-buffer (get-buffer-window rmail-summary-buffer))) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1799 |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1800 (defvar rmail-redisplay-summary nil |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1801 "*Non-nil means Rmail should show the summary when it changes. |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1802 This has an effect only if a summary buffer exists.") |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1803 |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1804 ;; Put the summary buffer back on the screen, if user wants that. |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1805 (defun rmail-maybe-display-summary () |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1806 (and rmail-summary-buffer (buffer-name rmail-summary-buffer) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1807 rmail-redisplay-summary |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1808 (display-buffer rmail-summary-buffer))) |
270 | 1809 |
1810 ;;;; *** Rmail Specify Inbox Files *** | |
1811 | |
1812 (autoload 'set-rmail-inbox-list "rmailmsc" | |
1813 "Set the inbox list of the current RMAIL file to FILE-NAME. | |
1814 This may be a list of file names separated by commas. | |
1815 If FILE-NAME is empty, remove any inbox list." | |
1816 t) | |
1817 | |
1818 ;;;; *** Rmail Commands for Labels *** | |
1819 | |
1820 (autoload 'rmail-add-label "rmailkwd" | |
1821 "Add LABEL to labels associated with current RMAIL message. | |
1822 Completion is performed over known labels when reading." | |
1823 t) | |
1824 | |
1825 (autoload 'rmail-kill-label "rmailkwd" | |
1826 "Remove LABEL from labels associated with current RMAIL message. | |
1827 Completion is performed over known labels when reading." | |
1828 t) | |
1829 | |
1830 (autoload 'rmail-next-labeled-message "rmailkwd" | |
1831 "Show next message with LABEL. Defaults to last label used. | |
1832 With prefix argument N moves forward N messages with this label." | |
1833 t) | |
1834 | |
1835 (autoload 'rmail-previous-labeled-message "rmailkwd" | |
1836 "Show previous message with LABEL. Defaults to last label used. | |
1837 With prefix argument N moves backward N messages with this label." | |
1838 t) | |
1839 | |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1840 (autoload 'rmail-read-label "rmailkwd" |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1841 "PROMPT and read with completion an Rmail message label." |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1842 t) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1843 |
270 | 1844 ;;;; *** Rmail Edit Mode *** |
1845 | |
1846 (autoload 'rmail-edit-current-message "rmailedit" | |
1847 "Edit the contents of the current message" | |
1848 t) | |
1849 | |
1850 ;;;; *** Rmail Summary Mode *** | |
1851 | |
1852 (autoload 'rmail-summary "rmailsum" | |
1853 "Display a summary of all messages, one line per message." | |
1854 t) | |
1855 | |
1856 (autoload 'rmail-summary-by-labels "rmailsum" | |
1857 "Display a summary of all messages with one or more LABELS. | |
1858 LABELS should be a string containing the desired labels, separated by commas." | |
1859 t) | |
1860 | |
1861 (autoload 'rmail-summary-by-recipients "rmailsum" | |
1862 "Display a summary of all messages with the given RECIPIENTS. | |
1863 Normally checks the To, From and Cc fields of headers; but if PRIMARY-ONLY | |
1864 is non-nil (prefix arg given), only look in the To and From fields. | |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1865 RECIPIENTS is a string of regexps separated by commas." |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1866 t) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1867 |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1868 (autoload 'rmail-summary-by-regexp "rmailsum" |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1869 "Display a summary of all messages according to regexp REGEXP. |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1870 If the regular expression is found in the header of the message |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1871 \(including in the date and other lines, as well as the subject line), |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1872 Emacs will list the header line in the RMAIL-summary." |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1873 t) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1874 |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1875 (autoload 'rmail-summary-by-topic "rmailsum" |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1876 "Display a summary of all messages with the given SUBJECT. |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1877 Normally checks the Subject field of headers; |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1878 but if WHOLE-MESSAGE is non-nil (prefix arg given), |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1879 look in the whole message. |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1880 SUBJECT is a string of regexps separated by commas." |
270 | 1881 t) |
1882 | |
1883 ;;;; *** Rmail output messages to files *** | |
1884 | |
1885 (autoload 'rmail-output-to-rmail-file "rmailout" | |
1886 "Append the current message to an Rmail file named FILE-NAME. | |
1887 If the file does not exist, ask if it should be created. | |
1888 If file is being visited, the message is appended to the Emacs | |
1889 buffer visiting that file." | |
1890 t) | |
1891 | |
1892 (autoload 'rmail-output "rmailout" | |
1893 "Append this message to Unix mail file named FILE-NAME." | |
1894 t) | |
1895 | |
1896 ;;;; *** Rmail undigestification *** | |
1897 | |
1898 (autoload 'undigestify-rmail-message "undigest" | |
1899 "Break up a digest message into its constituent messages. | |
1900 Leaves original message, deleted, before the undigestified messages." | |
1901 t) | |
584 | 1902 |
1903 (provide 'rmail) | |
1904 | |
658
7cbd4fcd8b0f
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
621
diff
changeset
|
1905 ;;; rmail.el ends here |