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