Mercurial > emacs
annotate lisp/mail/rmail.el @ 6405:190ecc6ee636
(X_WINDOWS_SUPPORT): Don't include term/x-win.
author | Roland McGrath <roland@gnu.org> |
---|---|
date | Fri, 18 Mar 1994 06:46:54 +0000 |
parents | 9b45e828c2a7 |
children | 185b1fd3a525 |
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 '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
|
42 (fboundp 'buffer-flush-undo) |
2571
b65cf676a09b
All fsets changed to defaliases.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2423
diff
changeset
|
43 (defalias 'buffer-disable-undo 'buffer-flush-undo)) |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
44 |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
45 ; These variables now declared in paths.el. |
270 | 46 ;(defvar rmail-spool-directory "/usr/spool/mail/" |
47 ; "This is the name of the directory used by the system mailer for\n\ | |
48 ;delivering new mail. It's name should end with a slash.") | |
49 ;(defvar rmail-file-name | |
50 ; (expand-file-name "~/RMAIL") | |
51 ; "") | |
52 | |
53 ;;;###autoload | |
54 (defvar rmail-dont-reply-to-names nil "\ | |
55 *A regexp specifying names to prune of reply to messages. | |
3931 | 56 A value of nil means exclude your own name only.") |
270 | 57 |
58 ;;;###autoload | |
59 (defvar rmail-default-dont-reply-to-names "info-" "\ | |
60 A regular expression specifying part of the value of the default value of | |
61 the variable `rmail-dont-reply-to-names', for when the user does not set | |
62 `rmail-dont-reply-to-names' explicitly. (The other part of the default | |
63 value is the user's name.) | |
3931 | 64 It is useful to set this variable in the site customization file.") |
270 | 65 |
66 ;;;###autoload | |
6289
85693b7d5231
(rmail-ignored-headers): Add several x400 header types.
Richard M. Stallman <rms@gnu.org>
parents:
6203
diff
changeset
|
67 (defvar rmail-ignored-headers "^via:\\|^mail-from:\\|^origin:\\|^status:\\|^received:\\|^x400-originator:\\|^x400-recipients:\\|^x400-received:\\|^x400-mts-identifier:\\|^x400-content-type:\\|^message-id:\\|^summary-line:" "\ |
85693b7d5231
(rmail-ignored-headers): Add several x400 header types.
Richard M. Stallman <rms@gnu.org>
parents:
6203
diff
changeset
|
68 *Regexp to match Header fields that rmail should normally hide.") |
270 | 69 |
70 ;;;###autoload | |
71 (defvar rmail-delete-after-output nil "\ | |
72 *Non-nil means automatically delete a message that is copied to a file.") | |
73 | |
74 ;;;###autoload | |
3631
0c063224b5d2
(rmail-primary-inbox-list): Use defvar, not defconst.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
75 (defvar rmail-primary-inbox-list nil "\ |
2423
5dd3b7338f71
(rmail): Don't use mbox as inbox by default.
Richard M. Stallman <rms@gnu.org>
parents:
2076
diff
changeset
|
76 *List of files which are inboxes for user's primary mail file `~/RMAIL'. |
5dd3b7338f71
(rmail): Don't use mbox as inbox by default.
Richard M. Stallman <rms@gnu.org>
parents:
2076
diff
changeset
|
77 `nil' means the default, which is (\"/usr/spool/mail/$USER\") |
5dd3b7338f71
(rmail): Don't use mbox as inbox by default.
Richard M. Stallman <rms@gnu.org>
parents:
2076
diff
changeset
|
78 \(the name varies depending on the operating system, |
270 | 79 and the value of the environment variable MAIL overrides it).") |
80 | |
4108
e4fbcd480455
(rmail-mail-new-frame): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4071
diff
changeset
|
81 ;;;###autoload |
e4fbcd480455
(rmail-mail-new-frame): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4071
diff
changeset
|
82 (defvar rmail-mail-new-frame nil |
e4fbcd480455
(rmail-mail-new-frame): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4071
diff
changeset
|
83 "*Non-nil means Rmail makes a new frame for composing outgoing mail.") |
e4fbcd480455
(rmail-mail-new-frame): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4071
diff
changeset
|
84 |
4844
25d94807689e
(rmail-retry-setup-hook): New hook variable.
Richard M. Stallman <rms@gnu.org>
parents:
4838
diff
changeset
|
85 ;;;###autoload |
25d94807689e
(rmail-retry-setup-hook): New hook variable.
Richard M. Stallman <rms@gnu.org>
parents:
4838
diff
changeset
|
86 (defvar rmail-retry-setup-hook nil |
25d94807689e
(rmail-retry-setup-hook): New hook variable.
Richard M. Stallman <rms@gnu.org>
parents:
4838
diff
changeset
|
87 "Hook that `rmail-retry-failure' uses in place of `mail-setup-hook'.") |
25d94807689e
(rmail-retry-setup-hook): New hook variable.
Richard M. Stallman <rms@gnu.org>
parents:
4838
diff
changeset
|
88 |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
89 ;; 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
|
90 ;; 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
|
91 ;; files). |
270 | 92 |
93 (defvar mmdf-delim1 "^\001\001\001\001\n" | |
94 "Regexp marking the start of an mmdf message") | |
95 (defvar mmdf-delim2 "^\001\001\001\001\n" | |
96 "Regexp marking the end of an mmdf message") | |
97 | |
98 (defvar rmail-message-filter nil | |
6203
e353e98cdd77
(rmail-message-filter): Doc fix.
Karl Heuer <kwzh@gnu.org>
parents:
6035
diff
changeset
|
99 "If non nil, a filter function for new messages in RMAIL. |
e353e98cdd77
(rmail-message-filter): Doc fix.
Karl Heuer <kwzh@gnu.org>
parents:
6035
diff
changeset
|
100 Called with region narrowed to the message, including headers.") |
270 | 101 |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
102 (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
|
103 "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
|
104 |
270 | 105 (defvar rmail-mode-map nil) |
106 | |
107 (defvar rmail-inbox-list nil) | |
108 (defvar rmail-keywords nil) | |
109 | |
110 ;; Message counters and markers. Deleted flags. | |
111 | |
112 (defvar rmail-current-message nil) | |
113 (defvar rmail-total-messages nil) | |
114 (defvar rmail-message-vector nil) | |
115 (defvar rmail-deleted-vector nil) | |
116 | |
117 ;; These are used by autoloaded rmail-summary. | |
118 | |
119 (defvar rmail-summary-buffer nil) | |
120 (defvar rmail-summary-vector nil) | |
121 | |
122 ;; `Sticky' default variables. | |
123 | |
124 ;; Last individual label specified to a or k. | |
125 (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
|
126 ;; Last set of values specified to C-M-n, C-M-p, C-M-s or C-M-l. |
270 | 127 (defvar rmail-last-multi-labels nil) |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
128 (defvar rmail-last-regexp nil) |
5591
55fdac09e7a9
(rmail-default-file): Renamed from rmail-last-file.
Richard M. Stallman <rms@gnu.org>
parents:
5586
diff
changeset
|
129 (defvar rmail-default-file nil |
55fdac09e7a9
(rmail-default-file): Renamed from rmail-last-file.
Richard M. Stallman <rms@gnu.org>
parents:
5586
diff
changeset
|
130 "*Default file name for \\[rmail-output].") |
55fdac09e7a9
(rmail-default-file): Renamed from rmail-last-file.
Richard M. Stallman <rms@gnu.org>
parents:
5586
diff
changeset
|
131 (defvar rmail-default-rmail-file (expand-file-name "~/XMAIL") |
55fdac09e7a9
(rmail-default-file): Renamed from rmail-last-file.
Richard M. Stallman <rms@gnu.org>
parents:
5586
diff
changeset
|
132 "*Default file name for \\[rmail-output-to-rmail-file].") |
617 | 133 |
621 | 134 ;;; Regexp matching the delimiter of messages in UNIX mail format |
135 ;;; (UNIX From lines), minus the initial ^. Note that if you change | |
136 ;;; this expression, you must change the code in rmail-nuke-pinhead-header | |
137 ;;; that knows the exact ordering of the \\( \\) subexpressions. | |
617 | 138 (defvar rmail-unix-mail-delimiter |
1112 | 139 (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
|
140 (concat "\\([A-Z]?[A-Z][A-Z][A-Z]\\( DST\\)?" |
1112 | 141 "\\|[-+]?[0-9][0-9][0-9][0-9]" |
142 "\\|" | |
143 "\\) *"))) | |
144 (concat | |
145 "From " | |
146 | |
147 ;; Username, perhaps with a quoted section that can contain spaces. | |
148 "\\(" | |
149 "[^ \n]*" | |
150 "\\(\\|\".*\"[^ \n]*\\)" | |
151 "\\) ?" | |
152 | |
153 ;; The time the message was sent. | |
154 "\\([^ \n]*\\) *" ; day of the week | |
155 "\\([^ ]*\\) *" ; month | |
156 "\\([0-9]*\\) *" ; day of month | |
157 "\\([0-9:]*\\) *" ; time of day | |
158 | |
159 ;; Perhaps a time zone, specified by an abbreviation, or by a | |
160 ;; numeric offset. | |
161 time-zone-regexp | |
162 | |
163 ;; The year. | |
164 " [0-9][0-9]\\([0-9]*\\) *" | |
165 | |
166 ;; On some systems the time zone can appear after the year, too. | |
167 time-zone-regexp | |
168 | |
169 ;; I'm not sure what this is. | |
170 "\\(remote from [^\n]*\\)?" | |
171 | |
172 "\n")) | |
173 nil) | |
174 | |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
175 ;; 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
|
176 ;; 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
|
177 (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
|
178 (` (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
|
179 (let ((window (selected-window))) |
3462
2624c18df764
(rmail-select-summary): Add a save-excursion.
Richard M. Stallman <rms@gnu.org>
parents:
3083
diff
changeset
|
180 (save-excursion |
2624c18df764
(rmail-select-summary): Add a save-excursion.
Richard M. Stallman <rms@gnu.org>
parents:
3083
diff
changeset
|
181 (unwind-protect |
2624c18df764
(rmail-select-summary): Add a save-excursion.
Richard M. Stallman <rms@gnu.org>
parents:
3083
diff
changeset
|
182 (progn |
2624c18df764
(rmail-select-summary): Add a save-excursion.
Richard M. Stallman <rms@gnu.org>
parents:
3083
diff
changeset
|
183 (pop-to-buffer rmail-summary-buffer) |
2624c18df764
(rmail-select-summary): Add a save-excursion.
Richard M. Stallman <rms@gnu.org>
parents:
3083
diff
changeset
|
184 (,@ body)) |
2624c18df764
(rmail-select-summary): Add a save-excursion.
Richard M. Stallman <rms@gnu.org>
parents:
3083
diff
changeset
|
185 (select-window window)))) |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
186 (save-excursion |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
187 (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
|
188 (progn (,@ body)))) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
189 (rmail-maybe-display-summary)))) |
270 | 190 |
191 ;;;; *** Rmail Mode *** | |
192 | |
193 ;;;###autoload | |
194 (defun rmail (&optional file-name-arg) | |
195 "Read and edit incoming mail. | |
4838
754b38c0e941
(rmail): Really don't get new mail if file name was given.
Richard M. Stallman <rms@gnu.org>
parents:
4819
diff
changeset
|
196 Moves messages into file named by `rmail-file-name' (a babyl format file) |
270 | 197 and edits that file in RMAIL Mode. |
198 Type \\[describe-mode] once editing that file, for a list of RMAIL commands. | |
199 | |
5274
89b71a85be3e
(rmail-quit): Expunge without updating summary.
Richard M. Stallman <rms@gnu.org>
parents:
5192
diff
changeset
|
200 May be called with file name as argument; then performs rmail editing on |
89b71a85be3e
(rmail-quit): Expunge without updating summary.
Richard M. Stallman <rms@gnu.org>
parents:
5192
diff
changeset
|
201 that file, but does not copy any new mail into the file. |
89b71a85be3e
(rmail-quit): Expunge without updating summary.
Richard M. Stallman <rms@gnu.org>
parents:
5192
diff
changeset
|
202 Interactively, if you supply a prefix argument, then you |
89b71a85be3e
(rmail-quit): Expunge without updating summary.
Richard M. Stallman <rms@gnu.org>
parents:
5192
diff
changeset
|
203 have a chance to specify a file name with the minibuffer." |
270 | 204 (interactive (if current-prefix-arg |
205 (list (read-file-name "Run rmail on RMAIL file: " | |
206 nil nil t)))) | |
5591
55fdac09e7a9
(rmail-default-file): Renamed from rmail-last-file.
Richard M. Stallman <rms@gnu.org>
parents:
5586
diff
changeset
|
207 (or rmail-default-file |
55fdac09e7a9
(rmail-default-file): Renamed from rmail-last-file.
Richard M. Stallman <rms@gnu.org>
parents:
5586
diff
changeset
|
208 (setq rmail-default-file (expand-file-name "~/xmail"))) |
270 | 209 (let* ((file-name (expand-file-name (or file-name-arg rmail-file-name))) |
210 (existed (get-file-buffer file-name))) | |
211 ;; Like find-file, but in the case where a buffer existed | |
212 ;; and the file was reverted, recompute the message-data. | |
213 (if (and existed (not (verify-visited-file-modtime existed))) | |
214 (progn | |
215 ;; Don't be confused by apparent local-variables spec | |
216 ;; in the last message in the RMAIL file. | |
1024
ceb4469d3cd7
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
997
diff
changeset
|
217 (let ((enable-local-variables nil)) |
270 | 218 (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
|
219 (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
|
220 (eq major-mode 'rmail-mode)) |
270 | 221 (progn (rmail-forget-messages) |
222 (rmail-set-message-counters)))) | |
1024
ceb4469d3cd7
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
997
diff
changeset
|
223 (let ((enable-local-variables nil)) |
270 | 224 (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
|
225 (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
|
226 (error "Exit Rmail Edit mode before getting new mail.")) |
270 | 227 (if (and existed (> (buffer-size) 0)) |
228 ;; Buffer not new and not empty; ensure in proper mode, but that's all. | |
229 (or (eq major-mode 'rmail-mode) | |
230 (rmail-mode-2)) | |
231 (rmail-mode-2) | |
232 ;; Convert all or part to Babyl file if possible. | |
233 (rmail-convert-file) | |
234 (goto-char (point-max)) | |
235 (if (null rmail-inbox-list) | |
236 (progn | |
237 (rmail-set-message-counters) | |
238 (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
|
239 (let ((existing-unseen (rmail-first-unseen-message))) |
4838
754b38c0e941
(rmail): Really don't get new mail if file name was given.
Richard M. Stallman <rms@gnu.org>
parents:
4819
diff
changeset
|
240 (or file-name-arg |
754b38c0e941
(rmail): Really don't get new mail if file name was given.
Richard M. Stallman <rms@gnu.org>
parents:
4819
diff
changeset
|
241 (rmail-get-new-mail)) |
1342
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 |
3591
507f64624555
Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents:
3540
diff
changeset
|
245 ;; positions on the first new message, thus marking it as seen. |
1342
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"))) | |
4764
0e239209a6db
(rmail-convert-file): If the file is empty, don't convert it after
Brian Fox <bfox@gnu.org>
parents:
4724
diff
changeset
|
278 ((equal (point-min) (point-max)) |
0e239209a6db
(rmail-convert-file): If the file is empty, don't convert it after
Brian Fox <bfox@gnu.org>
parents:
4724
diff
changeset
|
279 ;; Empty RMAIL file. Just insert the header. |
0e239209a6db
(rmail-convert-file): If the file is empty, don't convert it after
Brian Fox <bfox@gnu.org>
parents:
4724
diff
changeset
|
280 (rmail-insert-rmail-file-header)) |
270 | 281 (t |
4764
0e239209a6db
(rmail-convert-file): If the file is empty, don't convert it after
Brian Fox <bfox@gnu.org>
parents:
4724
diff
changeset
|
282 ;; Non-empty file in non-RMAIL format. Add header and convert. |
270 | 283 (setq convert t) |
284 (rmail-insert-rmail-file-header))) | |
285 ;; If file was not a Babyl file or if there are | |
286 ;; Unix format messages added at the end, | |
287 ;; convert file as necessary. | |
288 (if (or convert | |
4673
047e8f8469d9
(rmail-convert-file): Exclude the Babyl header
Richard M. Stallman <rms@gnu.org>
parents:
4579
diff
changeset
|
289 (save-excursion |
047e8f8469d9
(rmail-convert-file): Exclude the Babyl header
Richard M. Stallman <rms@gnu.org>
parents:
4579
diff
changeset
|
290 (goto-char (point-max)) |
047e8f8469d9
(rmail-convert-file): Exclude the Babyl header
Richard M. Stallman <rms@gnu.org>
parents:
4579
diff
changeset
|
291 (search-backward "\^_") |
047e8f8469d9
(rmail-convert-file): Exclude the Babyl header
Richard M. Stallman <rms@gnu.org>
parents:
4579
diff
changeset
|
292 (forward-char 1) |
047e8f8469d9
(rmail-convert-file): Exclude the Babyl header
Richard M. Stallman <rms@gnu.org>
parents:
4579
diff
changeset
|
293 (looking-at "\n*From "))) |
270 | 294 (let ((buffer-read-only nil)) |
295 (message "Converting to Babyl format...") | |
4673
047e8f8469d9
(rmail-convert-file): Exclude the Babyl header
Richard M. Stallman <rms@gnu.org>
parents:
4579
diff
changeset
|
296 ;; If file needs conversion, convert it all, |
047e8f8469d9
(rmail-convert-file): Exclude the Babyl header
Richard M. Stallman <rms@gnu.org>
parents:
4579
diff
changeset
|
297 ;; except for the BABYL header. |
047e8f8469d9
(rmail-convert-file): Exclude the Babyl header
Richard M. Stallman <rms@gnu.org>
parents:
4579
diff
changeset
|
298 ;; (rmail-convert-to-babyl-format would delete the header.) |
047e8f8469d9
(rmail-convert-file): Exclude the Babyl header
Richard M. Stallman <rms@gnu.org>
parents:
4579
diff
changeset
|
299 (goto-char (point-min)) |
047e8f8469d9
(rmail-convert-file): Exclude the Babyl header
Richard M. Stallman <rms@gnu.org>
parents:
4579
diff
changeset
|
300 (search-forward "\n\^_" nil t) |
4698
196fac1c1086
(rmail-convert-file): Narrow to exclude the Babyl header.
Richard M. Stallman <rms@gnu.org>
parents:
4673
diff
changeset
|
301 (narrow-to-region (point) (point-max)) |
270 | 302 (rmail-convert-to-babyl-format) |
303 (message "Converting to Babyl format...done"))))) | |
304 | |
4764
0e239209a6db
(rmail-convert-file): If the file is empty, don't convert it after
Brian Fox <bfox@gnu.org>
parents:
4724
diff
changeset
|
305 ;;; I have checked that adding "-*- rmail -*-" to the BABYL OPTIONS line |
0e239209a6db
(rmail-convert-file): If the file is empty, don't convert it after
Brian Fox <bfox@gnu.org>
parents:
4724
diff
changeset
|
306 ;;; will not cause emacs 18.55 problems. |
270 | 307 |
308 (defun rmail-insert-rmail-file-header () | |
309 (let ((buffer-read-only nil)) | |
310 (insert "BABYL OPTIONS: -*- rmail -*- | |
311 Version: 5 | |
312 Labels: | |
313 Note: This is the header of an rmail file. | |
314 Note: If you are seeing it in rmail, | |
315 Note: it means the file has no messages in it.\n\^_"))) | |
316 | |
317 (if rmail-mode-map | |
318 nil | |
319 (setq rmail-mode-map (make-keymap)) | |
320 (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
|
321 (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
|
322 (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
|
323 (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
|
324 (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
|
325 (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
|
326 (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
|
327 (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
|
328 (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
|
329 (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
|
330 (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
|
331 (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
|
332 (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
|
333 (define-key rmail-mode-map "l" 'rmail-summary-by-labels) |
270 | 334 (define-key rmail-mode-map "\e\C-h" 'rmail-summary) |
335 (define-key rmail-mode-map "\e\C-l" 'rmail-summary-by-labels) | |
336 (define-key rmail-mode-map "\e\C-r" 'rmail-summary-by-recipients) | |
337 (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
|
338 (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
|
339 (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
|
340 (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
|
341 (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
|
342 (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
|
343 (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
|
344 (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
|
345 (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
|
346 (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
|
347 (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
|
348 (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
|
349 (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
|
350 (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
|
351 ;; 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
|
352 ;; (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
|
353 (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
|
354 (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
|
355 (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
|
356 (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
|
357 (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
|
358 (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
|
359 (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
|
360 (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
|
361 (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
|
362 (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
|
363 (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
|
364 (define-key rmail-mode-map "?" 'describe-mode) |
3877
da9b565f9878
Add autoloads for rmailsort commands.
Richard M. Stallman <rms@gnu.org>
parents:
3864
diff
changeset
|
365 (define-key rmail-mode-map "\C-c\C-s\C-d" 'rmail-sort-by-date) |
da9b565f9878
Add autoloads for rmailsort commands.
Richard M. Stallman <rms@gnu.org>
parents:
3864
diff
changeset
|
366 (define-key rmail-mode-map "\C-c\C-s\C-s" 'rmail-sort-by-subject) |
da9b565f9878
Add autoloads for rmailsort commands.
Richard M. Stallman <rms@gnu.org>
parents:
3864
diff
changeset
|
367 (define-key rmail-mode-map "\C-c\C-s\C-a" 'rmail-sort-by-author) |
da9b565f9878
Add autoloads for rmailsort commands.
Richard M. Stallman <rms@gnu.org>
parents:
3864
diff
changeset
|
368 (define-key rmail-mode-map "\C-c\C-s\C-r" 'rmail-sort-by-recipient) |
da9b565f9878
Add autoloads for rmailsort commands.
Richard M. Stallman <rms@gnu.org>
parents:
3864
diff
changeset
|
369 (define-key rmail-mode-map "\C-c\C-s\C-c" 'rmail-sort-by-correspondent) |
da9b565f9878
Add autoloads for rmailsort commands.
Richard M. Stallman <rms@gnu.org>
parents:
3864
diff
changeset
|
370 (define-key rmail-mode-map "\C-c\C-s\C-l" 'rmail-sort-by-lines) |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
371 ) |
3863
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
372 |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
373 (define-key rmail-mode-map [menu-bar] (make-sparse-keymap)) |
270 | 374 |
3863
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
375 (define-key rmail-mode-map [menu-bar classify] |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
376 (cons "Classify" (make-sparse-keymap "Classify"))) |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
377 |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
378 (define-key rmail-mode-map [menu-bar classify output-inbox] |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
379 '("Output (inbox)" . rmail-output)) |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
380 |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
381 (define-key rmail-mode-map [menu-bar classify output] |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
382 '("Output (Rmail)" . rmail-output-to-rmail-file)) |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
383 |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
384 (define-key rmail-mode-map [menu-bar classify kill-label] |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
385 '("Kill Label" . rmail-kill-label)) |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
386 |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
387 (define-key rmail-mode-map [menu-bar classify add-label] |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
388 '("Add Label" . rmail-add-label)) |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
389 |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
390 (define-key rmail-mode-map [menu-bar summary] |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
391 (cons "Summary" (make-sparse-keymap "Summary"))) |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
392 |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
393 (define-key rmail-mode-map [menu-bar summary labels] |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
394 '("By Labels" . rmail-summary-by-labels)) |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
395 |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
396 (define-key rmail-mode-map [menu-bar summary recipients] |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
397 '("By Recipients" . rmail-summary-by-recipients)) |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
398 |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
399 (define-key rmail-mode-map [menu-bar summary topic] |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
400 '("By Topic" . rmail-summary-by-topic)) |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
401 |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
402 (define-key rmail-mode-map [menu-bar summary regexp] |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
403 '("By Regexp" . rmail-summary-by-regexp)) |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
404 |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
405 (define-key rmail-mode-map [menu-bar summary all] |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
406 '("All" . rmail-summary)) |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
407 |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
408 (define-key rmail-mode-map [menu-bar mail] |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
409 (cons "Mail" (make-sparse-keymap "Mail"))) |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
410 |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
411 (define-key rmail-mode-map [menu-bar mail continue] |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
412 '("Continue" . rmail-continue)) |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
413 |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
414 (define-key rmail-mode-map [menu-bar mail forward] |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
415 '("Forward" . rmail-forward)) |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
416 |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
417 (define-key rmail-mode-map [menu-bar mail retry] |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
418 '("Retry" . rmail-retry-failure)) |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
419 |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
420 (define-key rmail-mode-map [menu-bar mail reply] |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
421 '("Reply" . rmail-reply)) |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
422 |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
423 (define-key rmail-mode-map [menu-bar mail mail] |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
424 '("Mail" . rmail-mail)) |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
425 |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
426 (define-key rmail-mode-map [menu-bar delete] |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
427 (cons "Delete" (make-sparse-keymap "Delete"))) |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
428 |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
429 (define-key rmail-mode-map [menu-bar delete expunge/save] |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
430 '("Expunge/Save" . rmail-expunge-and-save)) |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
431 |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
432 (define-key rmail-mode-map [menu-bar delete expunge] |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
433 '("Expunge" . rmail-expunge)) |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
434 |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
435 (define-key rmail-mode-map [menu-bar delete undelete] |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
436 '("Undelete" . rmail-undelete-previous-message)) |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
437 |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
438 (define-key rmail-mode-map [menu-bar delete delete] |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
439 '("Delete" . rmail-delete-forward)) |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
440 |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
441 (define-key rmail-mode-map [menu-bar move] |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
442 (cons "Move" (make-sparse-keymap "Move"))) |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
443 |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
444 (define-key rmail-mode-map [menu-bar move search-back] |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
445 '("Search Back" . rmail-search-backward)) |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
446 |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
447 (define-key rmail-mode-map [menu-bar move search] |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
448 '("Search" . rmail-search)) |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
449 |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
450 (define-key rmail-mode-map [menu-bar move previous] |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
451 '("Previous Nondeleted" . rmail-previous-undeleted-message)) |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
452 |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
453 (define-key rmail-mode-map [menu-bar move next] |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
454 '("Next Nondeleted" . rmail-next-undeleted-message)) |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
455 |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
456 (define-key rmail-mode-map [menu-bar move last] |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
457 '("Last" . rmail-last-message)) |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
458 |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
459 (define-key rmail-mode-map [menu-bar move first] |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
460 '("First" . rmail-first-message)) |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
461 |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
462 (define-key rmail-mode-map [menu-bar move previous] |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
463 '("Previous" . rmail-previous-message)) |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
464 |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
465 (define-key rmail-mode-map [menu-bar move next] |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
466 '("Next" . rmail-next-message)) |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
467 |
270 | 468 ;; Rmail mode is suitable only for specially formatted data. |
469 (put 'rmail-mode 'mode-class 'special) | |
470 | |
1382
9b210c7d6c23
* rmail.el (rmail-mode): Make this autoload; we might find a file
Jim Blandy <jimb@redhat.com>
parents:
1372
diff
changeset
|
471 ;;;###autoload |
270 | 472 (defun rmail-mode () |
473 "Rmail Mode is used by \\<rmail-mode-map>\\[rmail] for editing Rmail files. | |
474 All normal editing commands are turned off. | |
475 Instead, these commands are available: | |
476 | |
477 \\[rmail-beginning-of-message] Move point to front of this message (same as \\[beginning-of-buffer]). | |
478 \\[scroll-up] Scroll to next screen of this message. | |
479 \\[scroll-down] Scroll to previous screen of this message. | |
480 \\[rmail-next-undeleted-message] Move to Next non-deleted message. | |
481 \\[rmail-previous-undeleted-message] Move to Previous non-deleted message. | |
482 \\[rmail-next-message] Move to Next message whether deleted or not. | |
483 \\[rmail-previous-message] Move to Previous message whether deleted or not. | |
484 \\[rmail-first-message] Move to the first message in Rmail file. | |
485 \\[rmail-last-message] Move to the last message in Rmail file. | |
486 \\[rmail-show-message] Jump to message specified by numeric position in file. | |
487 \\[rmail-search] Search for string and show message it is found in. | |
488 \\[rmail-delete-forward] Delete this message, move to next nondeleted. | |
489 \\[rmail-delete-backward] Delete this message, move to previous nondeleted. | |
490 \\[rmail-undelete-previous-message] Undelete message. Tries current message, then earlier messages | |
491 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
|
492 \\[rmail-edit-current-message] Edit the current message. \\[rmail-cease-edit] to return to Rmail. |
270 | 493 \\[rmail-expunge] Expunge deleted messages. |
494 \\[rmail-expunge-and-save] Expunge and save the file. | |
495 \\[rmail-quit] Quit Rmail: expunge, save, then switch to another buffer. | |
496 \\[save-buffer] Save without expunging. | |
2423
5dd3b7338f71
(rmail): Don't use mbox as inbox by default.
Richard M. Stallman <rms@gnu.org>
parents:
2076
diff
changeset
|
497 \\[rmail-get-new-mail] Move new mail from system spool directory into this file. |
270 | 498 \\[rmail-mail] Mail a message (same as \\[mail-other-window]). |
499 \\[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
|
500 \\[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
|
501 \\[rmail-retry-failure] Send this message again. Used on a mailer failure message. |
270 | 502 \\[rmail-forward] Forward this message to another user. |
503 \\[rmail-output-to-rmail-file] Output this message to an Rmail file (append it). | |
504 \\[rmail-output] Output this message to a Unix-format mail file (append it). | |
505 \\[rmail-input] Input Rmail file. Run Rmail on that file. | |
506 \\[rmail-add-label] Add label to message. It will be displayed in the mode line. | |
507 \\[rmail-kill-label] Kill label. Remove a label from current message. | |
508 \\[rmail-next-labeled-message] Move to Next message with specified label | |
509 (label defaults to last one specified). | |
510 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
|
511 Any other label is present only if you add it with \\[rmail-add-label]. |
270 | 512 \\[rmail-previous-labeled-message] Move to Previous message with specified label |
513 \\[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
|
514 \\[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
|
515 \\[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
|
516 \\[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
|
517 \\[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
|
518 \\[rmail-toggle-header] Toggle display of complete header." |
270 | 519 (interactive) |
520 (rmail-mode-2) | |
521 (rmail-set-message-counters) | |
3864
ee987f852b10
(rmail-mode): Move to the last message.
Richard M. Stallman <rms@gnu.org>
parents:
3863
diff
changeset
|
522 (rmail-show-message rmail-total-messages)) |
270 | 523 |
524 (defun rmail-mode-2 () | |
525 (kill-all-local-variables) | |
526 (rmail-mode-1) | |
527 (rmail-variables) | |
528 (run-hooks 'rmail-mode-hook)) | |
529 | |
530 (defun rmail-mode-1 () | |
531 (setq major-mode 'rmail-mode) | |
532 (setq mode-name "RMAIL") | |
533 (setq buffer-read-only t) | |
5330 | 534 ;; No need to auto save RMAIL files in normal circumstances |
535 ;; because they contain no info except attribute changes | |
536 ;; and deletion of messages. | |
537 ;; The one exception is when messages are copied into an Rmail mode buffer. | |
538 ;; rmail-output-to-rmail-file enables auto save when you do that. | |
270 | 539 (setq buffer-auto-save-file-name nil) |
540 (if (boundp 'mode-line-modified) | |
541 (setq mode-line-modified "--- ") | |
542 (setq mode-line-format | |
543 (cons "--- " (cdr (default-value 'mode-line-format))))) | |
544 (use-local-map rmail-mode-map) | |
545 (set-syntax-table text-mode-syntax-table) | |
546 (setq local-abbrev-table text-mode-abbrev-table)) | |
547 | |
548 (defun rmail-variables () | |
549 (make-local-variable 'revert-buffer-function) | |
550 (setq revert-buffer-function 'rmail-revert) | |
551 (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
|
552 (make-local-variable 'rmail-last-regexp) |
270 | 553 (make-local-variable 'rmail-deleted-vector) |
554 (make-local-variable 'rmail-summary-buffer) | |
555 (make-local-variable 'rmail-summary-vector) | |
556 (make-local-variable 'rmail-current-message) | |
557 (make-local-variable 'rmail-total-messages) | |
558 (make-local-variable 'require-final-newline) | |
559 (setq require-final-newline nil) | |
560 (make-local-variable 'version-control) | |
561 (setq version-control 'never) | |
562 (make-local-variable 'file-precious-flag) | |
563 (setq file-precious-flag t) | |
564 (make-local-variable 'rmail-message-vector) | |
565 (make-local-variable 'rmail-last-file) | |
566 (make-local-variable 'rmail-inbox-list) | |
567 (setq rmail-inbox-list (rmail-parse-file-inboxes)) | |
3540
c14c0f2954fd
(rmail-variables): Default rmail-inbox-list here.
Richard M. Stallman <rms@gnu.org>
parents:
3484
diff
changeset
|
568 ;; Provide default set of inboxes for primary mail file ~/RMAIL. |
c14c0f2954fd
(rmail-variables): Default rmail-inbox-list here.
Richard M. Stallman <rms@gnu.org>
parents:
3484
diff
changeset
|
569 (and (null rmail-inbox-list) |
4010
735b8dc6cdd2
(rmail-variables): Compare truename as well as given name
Richard M. Stallman <rms@gnu.org>
parents:
3931
diff
changeset
|
570 (or (equal buffer-file-name (expand-file-name rmail-file-name)) |
5192
3fb665ab94c1
(rmail-variables): Abbreviate truename for comparison.
Richard M. Stallman <rms@gnu.org>
parents:
5047
diff
changeset
|
571 (equal buffer-file-truename |
3fb665ab94c1
(rmail-variables): Abbreviate truename for comparison.
Richard M. Stallman <rms@gnu.org>
parents:
5047
diff
changeset
|
572 (abbreviate-file-name (file-truename rmail-file-name)))) |
3540
c14c0f2954fd
(rmail-variables): Default rmail-inbox-list here.
Richard M. Stallman <rms@gnu.org>
parents:
3484
diff
changeset
|
573 (setq rmail-inbox-list |
c14c0f2954fd
(rmail-variables): Default rmail-inbox-list here.
Richard M. Stallman <rms@gnu.org>
parents:
3484
diff
changeset
|
574 (or rmail-primary-inbox-list |
c14c0f2954fd
(rmail-variables): Default rmail-inbox-list here.
Richard M. Stallman <rms@gnu.org>
parents:
3484
diff
changeset
|
575 (list (or (getenv "MAIL") |
c14c0f2954fd
(rmail-variables): Default rmail-inbox-list here.
Richard M. Stallman <rms@gnu.org>
parents:
3484
diff
changeset
|
576 (concat rmail-spool-directory |
5913
3d155c2636bf
(rmail-variables, rmail-insert-inbox-text): Change user-original-login-name to
Karl Heuer <kwzh@gnu.org>
parents:
5860
diff
changeset
|
577 (user-login-name))))))) |
270 | 578 (make-local-variable 'rmail-keywords) |
579 ;; this gets generated as needed | |
5850
dc5249a23957
(rmail-variables): Make local variables permanent, so the user can safely
Karl Heuer <kwzh@gnu.org>
parents:
5782
diff
changeset
|
580 (setq rmail-keywords nil) |
dc5249a23957
(rmail-variables): Make local variables permanent, so the user can safely
Karl Heuer <kwzh@gnu.org>
parents:
5782
diff
changeset
|
581 ;; Make everything permanent, in case the user switches major modes |
dc5249a23957
(rmail-variables): Make local variables permanent, so the user can safely
Karl Heuer <kwzh@gnu.org>
parents:
5782
diff
changeset
|
582 ;; during an edit. |
dc5249a23957
(rmail-variables): Make local variables permanent, so the user can safely
Karl Heuer <kwzh@gnu.org>
parents:
5782
diff
changeset
|
583 (put 'revert-buffer-function 'permanent-local t) |
dc5249a23957
(rmail-variables): Make local variables permanent, so the user can safely
Karl Heuer <kwzh@gnu.org>
parents:
5782
diff
changeset
|
584 (put 'rmail-last-label 'permanent-local t) |
dc5249a23957
(rmail-variables): Make local variables permanent, so the user can safely
Karl Heuer <kwzh@gnu.org>
parents:
5782
diff
changeset
|
585 (put 'rmail-last-regexp 'permanent-local t) |
dc5249a23957
(rmail-variables): Make local variables permanent, so the user can safely
Karl Heuer <kwzh@gnu.org>
parents:
5782
diff
changeset
|
586 (put 'rmail-deleted-vector 'permanent-local t) |
dc5249a23957
(rmail-variables): Make local variables permanent, so the user can safely
Karl Heuer <kwzh@gnu.org>
parents:
5782
diff
changeset
|
587 (put 'rmail-summary-buffer 'permanent-local t) |
dc5249a23957
(rmail-variables): Make local variables permanent, so the user can safely
Karl Heuer <kwzh@gnu.org>
parents:
5782
diff
changeset
|
588 (put 'rmail-summary-vector 'permanent-local t) |
dc5249a23957
(rmail-variables): Make local variables permanent, so the user can safely
Karl Heuer <kwzh@gnu.org>
parents:
5782
diff
changeset
|
589 (put 'rmail-current-message 'permanent-local t) |
dc5249a23957
(rmail-variables): Make local variables permanent, so the user can safely
Karl Heuer <kwzh@gnu.org>
parents:
5782
diff
changeset
|
590 (put 'rmail-total-messages 'permanent-local t) |
dc5249a23957
(rmail-variables): Make local variables permanent, so the user can safely
Karl Heuer <kwzh@gnu.org>
parents:
5782
diff
changeset
|
591 (put 'require-final-newline 'permanent-local t) |
dc5249a23957
(rmail-variables): Make local variables permanent, so the user can safely
Karl Heuer <kwzh@gnu.org>
parents:
5782
diff
changeset
|
592 (put 'version-control 'permanent-local t) |
dc5249a23957
(rmail-variables): Make local variables permanent, so the user can safely
Karl Heuer <kwzh@gnu.org>
parents:
5782
diff
changeset
|
593 (put 'file-precious-flag 'permanent-local t) |
dc5249a23957
(rmail-variables): Make local variables permanent, so the user can safely
Karl Heuer <kwzh@gnu.org>
parents:
5782
diff
changeset
|
594 (put 'rmail-message-vector 'permanent-local t) |
dc5249a23957
(rmail-variables): Make local variables permanent, so the user can safely
Karl Heuer <kwzh@gnu.org>
parents:
5782
diff
changeset
|
595 (put 'rmail-last-file 'permanent-local t) |
dc5249a23957
(rmail-variables): Make local variables permanent, so the user can safely
Karl Heuer <kwzh@gnu.org>
parents:
5782
diff
changeset
|
596 (put 'rmail-inbox-list 'permanent-local t) |
dc5249a23957
(rmail-variables): Make local variables permanent, so the user can safely
Karl Heuer <kwzh@gnu.org>
parents:
5782
diff
changeset
|
597 (put 'rmail-keywords 'permanent-local t)) |
270 | 598 |
599 ;; Handle M-x revert-buffer done in an rmail-mode buffer. | |
600 (defun rmail-revert (arg noconfirm) | |
601 (let (revert-buffer-function) | |
602 ;; Call our caller again, but this time it does the default thing. | |
603 (if (revert-buffer arg noconfirm) | |
604 ;; If the user said "yes", and we changed something, | |
605 ;; reparse the messages. | |
606 (progn | |
607 (rmail-convert-file) | |
608 (goto-char (point-max)) | |
609 (rmail-set-message-counters) | |
610 (rmail-show-message))))) | |
611 | |
612 ;; Return a list of files from this buffer's Mail: option. | |
613 ;; Does not assume that messages have been parsed. | |
614 ;; Just returns nil if buffer does not look like Babyl format. | |
615 (defun rmail-parse-file-inboxes () | |
616 (save-excursion | |
617 (save-restriction | |
618 (widen) | |
619 (goto-char 1) | |
620 (cond ((looking-at "BABYL OPTIONS:") | |
621 (search-forward "\n\^_" nil 'move) | |
622 (narrow-to-region 1 (point)) | |
623 (goto-char 1) | |
624 (if (search-forward "\nMail:" nil t) | |
625 (progn | |
626 (narrow-to-region (point) (progn (end-of-line) (point))) | |
627 (goto-char (point-min)) | |
628 (mail-parse-comma-list)))))))) | |
629 | |
630 (defun rmail-expunge-and-save () | |
631 "Expunge and save RMAIL file." | |
632 (interactive) | |
633 (rmail-expunge) | |
5860
ba1ff614b8f2
(rmail-expunge-and-save): Mark summary buffer as unmodified.
Karl Heuer <kwzh@gnu.org>
parents:
5850
diff
changeset
|
634 (save-buffer) |
ba1ff614b8f2
(rmail-expunge-and-save): Mark summary buffer as unmodified.
Karl Heuer <kwzh@gnu.org>
parents:
5850
diff
changeset
|
635 (if (rmail-summary-exists) |
ba1ff614b8f2
(rmail-expunge-and-save): Mark summary buffer as unmodified.
Karl Heuer <kwzh@gnu.org>
parents:
5850
diff
changeset
|
636 (rmail-select-summary (set-buffer-modified-p nil)))) |
270 | 637 |
638 (defun rmail-quit () | |
639 "Quit out of RMAIL." | |
640 (interactive) | |
641 (rmail-expunge-and-save) | |
642 ;; Don't switch to the summary buffer even if it was recently visible. | |
643 (if rmail-summary-buffer | |
644 (bury-buffer rmail-summary-buffer)) | |
645 (let ((obuf (current-buffer))) | |
646 (switch-to-buffer (other-buffer)) | |
647 (bury-buffer obuf))) | |
648 | |
649 ;;;###autoload | |
650 (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
|
651 "Run Rmail on file FILENAME." |
270 | 652 (interactive "FRun rmail on RMAIL file: ") |
653 (rmail filename)) | |
654 | |
655 | |
656 ;;;; *** Rmail input *** | |
657 | |
658 ;; RLK feature not added in this version: | |
659 ;; argument specifies inbox file or files in various ways. | |
660 | |
661 (defun rmail-get-new-mail (&optional file-name) | |
662 "Move any new mail from this RMAIL file's inbox files. | |
663 The inbox files can be specified with the file's Mail: option. The | |
664 variable `rmail-primary-inbox-list' specifies the inboxes for your | |
2423
5dd3b7338f71
(rmail): Don't use mbox as inbox by default.
Richard M. Stallman <rms@gnu.org>
parents:
2076
diff
changeset
|
665 primary RMAIL file if it has no Mail: option. By default, this is |
5dd3b7338f71
(rmail): Don't use mbox as inbox by default.
Richard M. Stallman <rms@gnu.org>
parents:
2076
diff
changeset
|
666 your /usr/spool/mail/$USER. |
270 | 667 |
668 You can also specify the file to get new mail from. In this case, the | |
669 file of new mail is not changed or deleted. Noninteractively, you can | |
670 pass the inbox file name as an argument. Interactively, a prefix | |
671 argument causes us to read a file name and use that file as the inbox." | |
672 (interactive | |
673 (list (if current-prefix-arg | |
674 (read-file-name "Get new mail from file: ")))) | |
675 (or (verify-visited-file-modtime (current-buffer)) | |
676 (progn | |
677 (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
|
678 (setq buffer-read-only t) |
270 | 679 (if (verify-visited-file-modtime (current-buffer)) |
680 (rmail-forget-messages)))) | |
681 (rmail-maybe-set-message-counters) | |
682 (widen) | |
683 ;; Get rid of all undo records for this buffer. | |
684 (or (eq buffer-undo-list t) | |
685 (setq buffer-undo-list nil)) | |
686 (unwind-protect | |
687 (let ((opoint (point)) | |
688 (new-messages 0) | |
689 (delete-files ()) | |
690 ;; If buffer has not changed yet, and has not been saved yet, | |
691 ;; don't replace the old backup file now. | |
692 (make-backup-files (and make-backup-files (buffer-modified-p))) | |
693 (buffer-read-only nil) | |
694 ;; Don't make undo records for what we do in getting mail. | |
695 (buffer-undo-list t)) | |
696 (goto-char (point-max)) | |
697 (skip-chars-backward " \t\n") ; just in case of brain damage | |
698 (delete-region (point) (point-max)) ; caused by require-final-newline | |
699 (save-excursion | |
700 (save-restriction | |
701 (narrow-to-region (point) (point)) | |
702 ;; Read in the contents of the inbox files, | |
703 ;; renaming them as necessary, | |
704 ;; and adding to the list of files to delete eventually. | |
705 (if file-name | |
706 (rmail-insert-inbox-text (list file-name) nil) | |
707 (setq delete-files (rmail-insert-inbox-text rmail-inbox-list t))) | |
708 ;; Scan the new text and convert each message to babyl format. | |
709 (goto-char (point-min)) | |
710 (save-excursion | |
711 (setq new-messages (rmail-convert-to-babyl-format))) | |
712 (or (zerop new-messages) | |
713 (let (success) | |
714 (widen) | |
5611
16c603bdc2a3
(rmail-get-new-mail): Avoid error if file is empty.
Richard M. Stallman <rms@gnu.org>
parents:
5591
diff
changeset
|
715 (search-backward "\n\^_" nil t) |
270 | 716 (narrow-to-region (point) (point-max)) |
717 (goto-char (1+ (point-min))) | |
718 (rmail-count-new-messages) | |
719 (save-buffer))) | |
720 ;; Delete the old files, now that babyl file is saved. | |
721 (while delete-files | |
722 (condition-case () | |
1165 | 723 ;; First, try deleting. |
724 (condition-case () | |
725 (delete-file (car delete-files)) | |
726 (file-error | |
727 ;; If we can't delete it, truncate it. | |
728 (write-region (point) (point) (car delete-files)))) | |
270 | 729 (file-error nil)) |
730 (setq delete-files (cdr delete-files))))) | |
731 (if (= new-messages 0) | |
732 (progn (goto-char opoint) | |
733 (if (or file-name rmail-inbox-list) | |
734 (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
|
735 (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
|
736 (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
|
737 (rmail-update-summary))) |
270 | 738 (message "%d new message%s read" |
739 new-messages (if (= 1 new-messages) "" "s")) | |
740 (and (boundp 'display-time-string) | |
5419
a35739cc2026
(rmail-get-new-mail): Cope if display-time-string is nil.
Richard M. Stallman <rms@gnu.org>
parents:
5330
diff
changeset
|
741 (stringp display-time-string) |
270 | 742 (string-match " Mail" display-time-string) |
743 (setq display-time-string | |
744 (concat | |
745 (substring display-time-string 0 (match-beginning 0)) | |
746 (substring display-time-string (match-end 0)))) | |
747 (force-mode-line-update 'all)))) | |
748 ;; Don't leave the buffer screwed up if we get a disk-full error. | |
749 (rmail-show-message))) | |
750 | |
751 (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
|
752 (let (file tofile delete-files movemail popmail) |
270 | 753 (while files |
6035
a96a9f6cb250
(rmail-insert-inbox-text): Recognize the spool directory even if symlinks are
Karl Heuer <kwzh@gnu.org>
parents:
5913
diff
changeset
|
754 (setq file (file-truename |
a96a9f6cb250
(rmail-insert-inbox-text): Recognize the spool directory even if symlinks are
Karl Heuer <kwzh@gnu.org>
parents:
5913
diff
changeset
|
755 (expand-file-name (substitute-in-file-name (car files)))) |
270 | 756 ;;>> un*x specific << |
813 | 757 ;; The "+" used to be "~", which is an extremely poor choice; |
758 ;; it might accidentally be deleted when space is low | |
759 ;; (as happened to me!). | |
760 tofile (concat file "+")) | |
270 | 761 ;; If getting from mail spool directory, |
762 ;; use movemail to move rather than just renaming, | |
763 ;; so as to interlock with the mailer. | |
6035
a96a9f6cb250
(rmail-insert-inbox-text): Recognize the spool directory even if symlinks are
Karl Heuer <kwzh@gnu.org>
parents:
5913
diff
changeset
|
764 (setq movemail (string= (file-name-directory file) |
a96a9f6cb250
(rmail-insert-inbox-text): Recognize the spool directory even if symlinks are
Karl Heuer <kwzh@gnu.org>
parents:
5913
diff
changeset
|
765 (file-truename rmail-spool-directory)) |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
766 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
|
767 (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
|
768 renamep t)) |
270 | 769 (if movemail |
770 (progn | |
771 (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
|
772 ;; 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
|
773 ;; 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
|
774 (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
|
775 ;; 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
|
776 ;; 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
|
777 ;; 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
|
778 ;; 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
|
779 (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
|
780 (expand-file-name buffer-file-name)))) |
270 | 781 ;; On some systems, /usr/spool/mail/foo is a directory |
782 ;; and the actual inbox is /usr/spool/mail/foo/foo. | |
783 (if (file-directory-p file) | |
5913
3d155c2636bf
(rmail-variables, rmail-insert-inbox-text): Change user-original-login-name to
Karl Heuer <kwzh@gnu.org>
parents:
5860
diff
changeset
|
784 (setq file (expand-file-name (user-login-name) |
270 | 785 file))))) |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
786 (if popmail |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
787 (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
|
788 (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
|
789 (/= 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
|
790 (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
|
791 (/= 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
|
792 (message "Getting mail from %s..." file))) |
270 | 793 ;; Set TOFILE if have not already done so, and |
794 ;; rename or copy the file FILE to TOFILE if and as appropriate. | |
795 (cond ((not renamep) | |
796 (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
|
797 ((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
|
798 (not (file-exists-p file)))) |
270 | 799 nil) |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
800 ((and (not movemail) (not popmail)) |
4071
4f387cc0a49f
(rmail-insert-inbox-text): If inbox is not in the
Richard M. Stallman <rms@gnu.org>
parents:
4020
diff
changeset
|
801 ;; Try copying. If that fails (perhaps no space), |
4f387cc0a49f
(rmail-insert-inbox-text): If inbox is not in the
Richard M. Stallman <rms@gnu.org>
parents:
4020
diff
changeset
|
802 ;; rename instead. |
4f387cc0a49f
(rmail-insert-inbox-text): If inbox is not in the
Richard M. Stallman <rms@gnu.org>
parents:
4020
diff
changeset
|
803 (condition-case nil |
4f387cc0a49f
(rmail-insert-inbox-text): If inbox is not in the
Richard M. Stallman <rms@gnu.org>
parents:
4020
diff
changeset
|
804 (copy-file file tofile nil) |
4f387cc0a49f
(rmail-insert-inbox-text): If inbox is not in the
Richard M. Stallman <rms@gnu.org>
parents:
4020
diff
changeset
|
805 (error |
5325
2c747b081be1
(rmail-insert-inbox-text): If copy-file fails,
Richard M. Stallman <rms@gnu.org>
parents:
5274
diff
changeset
|
806 ;; Third arg is t so we can replace existing file TOFILE. |
2c747b081be1
(rmail-insert-inbox-text): If copy-file fails,
Richard M. Stallman <rms@gnu.org>
parents:
5274
diff
changeset
|
807 (rename-file file tofile t))) |
1165 | 808 ;; Make the real inbox file empty. |
809 ;; Leaving it deleted could cause lossage | |
810 ;; because mailers often won't create the file. | |
811 (condition-case () | |
812 (write-region (point) (point) file) | |
813 (file-error nil))) | |
270 | 814 (t |
815 (let ((errors nil)) | |
816 (unwind-protect | |
817 (save-excursion | |
818 (setq errors (generate-new-buffer " *rmail loss*")) | |
819 (buffer-disable-undo errors) | |
820 (call-process | |
821 (expand-file-name "movemail" exec-directory) | |
822 nil errors nil file tofile) | |
823 (if (not (buffer-modified-p errors)) | |
824 ;; No output => movemail won | |
825 nil | |
826 (set-buffer errors) | |
827 (subst-char-in-region (point-min) (point-max) | |
828 ?\n ?\ ) | |
829 (goto-char (point-max)) | |
830 (skip-chars-backward " \t") | |
831 (delete-region (point) (point-max)) | |
832 (goto-char (point-min)) | |
833 (if (looking-at "movemail: ") | |
834 (delete-region (point-min) (match-end 0))) | |
835 (beep t) | |
836 (message (concat "movemail: " | |
837 (buffer-substring (point-min) | |
838 (point-max)))) | |
839 (sit-for 3) | |
840 nil)) | |
841 (if errors (kill-buffer errors)))))) | |
842 ;; At this point, TOFILE contains the name to read: | |
843 ;; Either the alternate name (if we renamed) | |
844 ;; or the actual inbox (if not renaming). | |
845 (if (file-exists-p tofile) | |
846 (let (size) | |
847 (goto-char (point-max)) | |
848 (setq size (nth 1 (insert-file-contents tofile))) | |
849 (goto-char (point-max)) | |
850 (or (= (preceding-char) ?\n) | |
851 (zerop size) | |
852 (insert ?\n)) | |
853 (setq delete-files (cons tofile delete-files)))) | |
854 (message "") | |
855 (setq files (cdr files))) | |
856 delete-files)) | |
857 | |
858 ;; the rmail-break-forwarded-messages feature is not implemented | |
859 (defun rmail-convert-to-babyl-format () | |
860 (let ((count 0) start | |
402
14485c6a56aa
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
346
diff
changeset
|
861 (case-fold-search nil) |
14485c6a56aa
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
346
diff
changeset
|
862 (invalid-input-resync |
14485c6a56aa
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
346
diff
changeset
|
863 (function (lambda () |
14485c6a56aa
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
346
diff
changeset
|
864 (message "Invalid Babyl format in inbox!") |
14485c6a56aa
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
346
diff
changeset
|
865 (sit-for 1) |
14485c6a56aa
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
346
diff
changeset
|
866 ;; Try to get back in sync with a real message. |
14485c6a56aa
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
346
diff
changeset
|
867 (if (re-search-forward |
14485c6a56aa
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
346
diff
changeset
|
868 (concat mmdf-delim1 "\\|^From") nil t) |
14485c6a56aa
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
346
diff
changeset
|
869 (beginning-of-line) |
14485c6a56aa
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
346
diff
changeset
|
870 (goto-char (point-max))))))) |
270 | 871 (goto-char (point-min)) |
872 (save-restriction | |
873 (while (not (eobp)) | |
874 (cond ((looking-at "BABYL OPTIONS:");Babyl header | |
402
14485c6a56aa
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
346
diff
changeset
|
875 (if (search-forward "\n\^_" nil t) |
14485c6a56aa
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
346
diff
changeset
|
876 ;; If we find the proper terminator, delete through there. |
14485c6a56aa
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
346
diff
changeset
|
877 (delete-region (point-min) (point)) |
14485c6a56aa
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
346
diff
changeset
|
878 (funcall invalid-input-resync) |
405
698d5d6e8f8b
*** empty log message ***
Michael I. Bushnell <mib@gnu.org>
parents:
403
diff
changeset
|
879 (delete-region (point-min) (point)))) |
270 | 880 ;; Babyl format message |
881 ((looking-at "\^L") | |
882 (or (search-forward "\n\^_" nil t) | |
402
14485c6a56aa
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
346
diff
changeset
|
883 (funcall invalid-input-resync)) |
270 | 884 (setq count (1+ count)) |
885 ;; Make sure there is no extra white space after the ^_ | |
886 ;; at the end of the message. | |
887 ;; Narrowing will make sure that whatever follows the junk | |
888 ;; will be treated properly. | |
889 (delete-region (point) | |
890 (save-excursion | |
891 (skip-chars-forward " \t\n") | |
892 (point))) | |
893 (narrow-to-region (point) (point-max))) | |
894 ;;*** MMDF format | |
895 ((let ((case-fold-search t)) | |
896 (looking-at mmdf-delim1)) | |
897 (let ((case-fold-search t)) | |
898 (replace-match "\^L\n0, unseen,,\n*** EOOH ***\n") | |
899 (setq start (point)) | |
900 (re-search-forward mmdf-delim2 nil t) | |
901 (replace-match "\^_")) | |
902 (save-excursion | |
903 (save-restriction | |
904 (narrow-to-region start (1- (point))) | |
905 (goto-char (point-min)) | |
906 (while (search-forward "\n\^_" nil t); single char "\^_" | |
907 (replace-match "\n^_")))); 2 chars: "^" and "_" | |
908 (narrow-to-region (point) (point-max)) | |
909 (setq count (1+ count))) | |
910 ;;*** Mail format | |
911 ((looking-at "^From ") | |
912 (setq start (point)) | |
913 (insert "\^L\n0, unseen,,\n*** EOOH ***\n") | |
914 (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
|
915 ;; 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
|
916 ;; 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
|
917 (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
|
918 (and (re-search-forward "\n\n" nil t) |
5466
794b93d511b9
(rmail-convert-to-babyl-format):
Richard M. Stallman <rms@gnu.org>
parents:
5419
diff
changeset
|
919 (1- (point))))) |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
920 (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
|
921 (size |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
922 ;; 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
|
923 (save-excursion |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
924 ;; 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
|
925 ;; 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
|
926 (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
|
927 (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
|
928 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
|
929 (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
|
930 (eol (progn (end-of-line) (point)))) |
6389
9b45e828c2a7
(rmail-convert-to-babyl-format): Check Content-Length field for consistency.
Karl Heuer <kwzh@gnu.org>
parents:
6289
diff
changeset
|
931 (string-to-int (buffer-substring beg eol))))))) |
9b45e828c2a7
(rmail-convert-to-babyl-format): Check Content-Length field for consistency.
Karl Heuer <kwzh@gnu.org>
parents:
6289
diff
changeset
|
932 (and size |
9b45e828c2a7
(rmail-convert-to-babyl-format): Check Content-Length field for consistency.
Karl Heuer <kwzh@gnu.org>
parents:
6289
diff
changeset
|
933 (if (and (natnump size) |
9b45e828c2a7
(rmail-convert-to-babyl-format): Check Content-Length field for consistency.
Karl Heuer <kwzh@gnu.org>
parents:
6289
diff
changeset
|
934 (<= (+ header-end size) (point-max)) |
9b45e828c2a7
(rmail-convert-to-babyl-format): Check Content-Length field for consistency.
Karl Heuer <kwzh@gnu.org>
parents:
6289
diff
changeset
|
935 ;; Make sure this would put us at a position |
9b45e828c2a7
(rmail-convert-to-babyl-format): Check Content-Length field for consistency.
Karl Heuer <kwzh@gnu.org>
parents:
6289
diff
changeset
|
936 ;; that we could continue from. |
9b45e828c2a7
(rmail-convert-to-babyl-format): Check Content-Length field for consistency.
Karl Heuer <kwzh@gnu.org>
parents:
6289
diff
changeset
|
937 (save-excursion |
9b45e828c2a7
(rmail-convert-to-babyl-format): Check Content-Length field for consistency.
Karl Heuer <kwzh@gnu.org>
parents:
6289
diff
changeset
|
938 (goto-char (+ header-end size)) |
9b45e828c2a7
(rmail-convert-to-babyl-format): Check Content-Length field for consistency.
Karl Heuer <kwzh@gnu.org>
parents:
6289
diff
changeset
|
939 (skip-chars-forward "\n") |
9b45e828c2a7
(rmail-convert-to-babyl-format): Check Content-Length field for consistency.
Karl Heuer <kwzh@gnu.org>
parents:
6289
diff
changeset
|
940 (or (eobp) |
9b45e828c2a7
(rmail-convert-to-babyl-format): Check Content-Length field for consistency.
Karl Heuer <kwzh@gnu.org>
parents:
6289
diff
changeset
|
941 (and (looking-at "BABYL OPTIONS:") |
9b45e828c2a7
(rmail-convert-to-babyl-format): Check Content-Length field for consistency.
Karl Heuer <kwzh@gnu.org>
parents:
6289
diff
changeset
|
942 (search-forward "\n\^_" nil t)) |
9b45e828c2a7
(rmail-convert-to-babyl-format): Check Content-Length field for consistency.
Karl Heuer <kwzh@gnu.org>
parents:
6289
diff
changeset
|
943 (and (looking-at "\^L") |
9b45e828c2a7
(rmail-convert-to-babyl-format): Check Content-Length field for consistency.
Karl Heuer <kwzh@gnu.org>
parents:
6289
diff
changeset
|
944 (search-forward "\n\^_" nil t)) |
9b45e828c2a7
(rmail-convert-to-babyl-format): Check Content-Length field for consistency.
Karl Heuer <kwzh@gnu.org>
parents:
6289
diff
changeset
|
945 (let ((case-fold-search t)) |
9b45e828c2a7
(rmail-convert-to-babyl-format): Check Content-Length field for consistency.
Karl Heuer <kwzh@gnu.org>
parents:
6289
diff
changeset
|
946 (looking-at mmdf-delim1)) |
9b45e828c2a7
(rmail-convert-to-babyl-format): Check Content-Length field for consistency.
Karl Heuer <kwzh@gnu.org>
parents:
6289
diff
changeset
|
947 (looking-at "From ")))) |
9b45e828c2a7
(rmail-convert-to-babyl-format): Check Content-Length field for consistency.
Karl Heuer <kwzh@gnu.org>
parents:
6289
diff
changeset
|
948 (goto-char (+ header-end size)) |
9b45e828c2a7
(rmail-convert-to-babyl-format): Check Content-Length field for consistency.
Karl Heuer <kwzh@gnu.org>
parents:
6289
diff
changeset
|
949 (message "Ignoring invalid Content-Length field") |
9b45e828c2a7
(rmail-convert-to-babyl-format): Check Content-Length field for consistency.
Karl Heuer <kwzh@gnu.org>
parents:
6289
diff
changeset
|
950 (sit-for 1 0 t)))) |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
951 |
270 | 952 (if (re-search-forward |
953 (concat "^[\^_]?\\(" | |
617 | 954 rmail-unix-mail-delimiter |
955 "\\|" | |
270 | 956 mmdf-delim1 "\\|" |
957 "^BABYL OPTIONS:\\|" | |
958 "\^L\n[01],\\)") nil t) | |
959 (goto-char (match-beginning 1)) | |
960 (goto-char (point-max))) | |
961 (setq count (1+ count)) | |
962 (save-excursion | |
963 (save-restriction | |
964 (narrow-to-region start (point)) | |
965 (goto-char (point-min)) | |
966 (while (search-forward "\n\^_" nil t); single char | |
967 (replace-match "\n^_")))); 2 chars: "^" and "_" | |
968 (insert ?\^_) | |
969 (narrow-to-region (point) (point-max))) | |
970 ;; | |
2700
9de57e00caf7
(rmail-convert-to-babyl-format): Delete 1 char
Richard M. Stallman <rms@gnu.org>
parents:
2687
diff
changeset
|
971 ;; This kludge is because some versions of sendmail.el |
9de57e00caf7
(rmail-convert-to-babyl-format): Delete 1 char
Richard M. Stallman <rms@gnu.org>
parents:
2687
diff
changeset
|
972 ;; insert an extra newline at the beginning that shouldn't |
9de57e00caf7
(rmail-convert-to-babyl-format): Delete 1 char
Richard M. Stallman <rms@gnu.org>
parents:
2687
diff
changeset
|
973 ;; be there. sendmail.el has been fixed, but old versions |
9de57e00caf7
(rmail-convert-to-babyl-format): Delete 1 char
Richard M. Stallman <rms@gnu.org>
parents:
2687
diff
changeset
|
974 ;; may still be in use. -- rms, 7 May 1993. |
9de57e00caf7
(rmail-convert-to-babyl-format): Delete 1 char
Richard M. Stallman <rms@gnu.org>
parents:
2687
diff
changeset
|
975 ((eolp) (delete-char 1)) |
405
698d5d6e8f8b
*** empty log message ***
Michael I. Bushnell <mib@gnu.org>
parents:
403
diff
changeset
|
976 (t (error "Cannot convert to babyl format"))))) |
270 | 977 count)) |
978 | |
979 ;; Delete the "From ..." line, creating various other headers with | |
980 ;; information from it if they don't already exist. Now puts the | |
4838
754b38c0e941
(rmail): Really don't get new mail if file name was given.
Richard M. Stallman <rms@gnu.org>
parents:
4819
diff
changeset
|
981 ;; original line into a mail-from: header line for debugging and for |
754b38c0e941
(rmail): Really don't get new mail if file name was given.
Richard M. Stallman <rms@gnu.org>
parents:
4819
diff
changeset
|
982 ;; use by the rmail-output function. |
270 | 983 (defun rmail-nuke-pinhead-header () |
984 (save-excursion | |
985 (save-restriction | |
986 (let ((start (point)) | |
987 (end (progn | |
988 (condition-case () | |
989 (search-forward "\n\n") | |
990 (error | |
991 (goto-char (point-max)) | |
992 (insert "\n\n"))) | |
993 (point))) | |
994 has-from has-date) | |
995 (narrow-to-region start end) | |
996 (let ((case-fold-search t)) | |
997 (goto-char start) | |
998 (setq has-from (search-forward "\nFrom:" nil t)) | |
999 (goto-char start) | |
1000 (setq has-date (and (search-forward "\nDate:" nil t) (point))) | |
1001 (goto-char start)) | |
1002 (let ((case-fold-search nil)) | |
617 | 1003 (if (re-search-forward (concat "^" rmail-unix-mail-delimiter) nil t) |
270 | 1004 (replace-match |
1005 (concat | |
1006 "Mail-from: \\&" | |
1007 ;; Keep and reformat the date if we don't | |
1008 ;; have a Date: field. | |
1009 (if has-date | |
1010 "" | |
1112 | 1011 (concat |
1012 "Date: \\3, \\5 \\4 \\9 \\6 " | |
1013 | |
1014 ;; The timezone could be matched by group 7 or group 10. | |
1015 ;; If neither of them matched, assume EST, since only | |
1016 ;; Easterners would be so sloppy. | |
1017 ;; It's a shame the substitution can't use "\\10". | |
1018 (cond | |
1019 ((/= (match-beginning 7) (match-end 7)) "\\7") | |
1020 ((/= (match-beginning 10) (match-end 10)) | |
1021 (buffer-substring (match-beginning 10) | |
1022 (match-end 10))) | |
1023 (t "EST")) | |
1024 "\n")) | |
270 | 1025 ;; Keep and reformat the sender if we don't |
1026 ;; have a From: field. | |
1027 (if has-from | |
1028 "" | |
4340
505fb5222dea
(rmail-nuke-pinhead-header): Tell replace-match not to alter the case.
Richard M. Stallman <rms@gnu.org>
parents:
4332
diff
changeset
|
1029 "From: \\1\n")) |
505fb5222dea
(rmail-nuke-pinhead-header): Tell replace-match not to alter the case.
Richard M. Stallman <rms@gnu.org>
parents:
4332
diff
changeset
|
1030 t))))))) |
270 | 1031 |
1032 ;;;; *** Rmail Message Formatting and Header Manipulation *** | |
1033 | |
1034 (defun rmail-reformat-message (beg end) | |
1035 (goto-char beg) | |
1036 (forward-line 1) | |
1037 (if (/= (following-char) ?0) | |
1038 (error "Bad format in RMAIL file.")) | |
1039 (let ((buffer-read-only nil) | |
1040 (delta (- (buffer-size) end))) | |
1041 (delete-char 1) | |
1042 (insert ?1) | |
1043 (forward-line 1) | |
4340
505fb5222dea
(rmail-nuke-pinhead-header): Tell replace-match not to alter the case.
Richard M. Stallman <rms@gnu.org>
parents:
4332
diff
changeset
|
1044 (let ((case-fold-search t)) |
4838
754b38c0e941
(rmail): Really don't get new mail if file name was given.
Richard M. Stallman <rms@gnu.org>
parents:
4819
diff
changeset
|
1045 (while (looking-at "Summary-line:\\|Mail-From:") |
754b38c0e941
(rmail): Really don't get new mail if file name was given.
Richard M. Stallman <rms@gnu.org>
parents:
4819
diff
changeset
|
1046 (forward-line 1))) |
270 | 1047 (if (looking-at "\\*\\*\\* EOOH \\*\\*\\*\n") |
1048 (delete-region (point) | |
1049 (progn (forward-line 1) (point)))) | |
1050 (let ((str (buffer-substring (point) | |
1051 (save-excursion (search-forward "\n\n" end 'move) | |
1052 (point))))) | |
1053 (insert str "*** EOOH ***\n") | |
1054 (narrow-to-region (point) (- (buffer-size) delta))) | |
1055 (goto-char (point-min)) | |
1056 (if rmail-ignored-headers (rmail-clear-headers)) | |
1057 (if rmail-message-filter (funcall rmail-message-filter)))) | |
1058 | |
1059 (defun rmail-clear-headers () | |
1060 (if (search-forward "\n\n" nil t) | |
1061 (save-restriction | |
1062 (narrow-to-region (point-min) (point)) | |
1063 (let ((buffer-read-only nil)) | |
1064 (while (let ((case-fold-search t)) | |
1065 (goto-char (point-min)) | |
1066 (re-search-forward rmail-ignored-headers nil t)) | |
1067 (beginning-of-line) | |
1068 (delete-region (point) | |
1069 (progn (re-search-forward "\n[^ \t]") | |
1070 (forward-char -1) | |
1071 (point)))))))) | |
1072 | |
1073 (defun rmail-toggle-header () | |
1074 "Show original message header if pruned header currently shown, or vice versa." | |
1075 (interactive) | |
1076 (rmail-maybe-set-message-counters) | |
1077 (narrow-to-region (rmail-msgbeg rmail-current-message) (point-max)) | |
1078 (let ((buffer-read-only nil)) | |
1079 (goto-char (point-min)) | |
1080 (forward-line 1) | |
1081 (if (= (following-char) ?1) | |
1082 (progn (delete-char 1) | |
1083 (insert ?0) | |
1084 (forward-line 1) | |
4340
505fb5222dea
(rmail-nuke-pinhead-header): Tell replace-match not to alter the case.
Richard M. Stallman <rms@gnu.org>
parents:
4332
diff
changeset
|
1085 (let ((case-fold-search t)) |
4838
754b38c0e941
(rmail): Really don't get new mail if file name was given.
Richard M. Stallman <rms@gnu.org>
parents:
4819
diff
changeset
|
1086 (while (looking-at "Summary-Line:\\|Mail-From:") |
754b38c0e941
(rmail): Really don't get new mail if file name was given.
Richard M. Stallman <rms@gnu.org>
parents:
4819
diff
changeset
|
1087 (forward-line 1))) |
270 | 1088 (insert "*** EOOH ***\n") |
1089 (forward-char -1) | |
1090 (search-forward "\n*** EOOH ***\n") | |
1091 (forward-line -1) | |
1092 (let ((temp (point))) | |
1093 (and (search-forward "\n\n" nil t) | |
1094 (delete-region temp (point)))) | |
1095 (goto-char (point-min)) | |
1096 (search-forward "\n*** EOOH ***\n") | |
1097 (narrow-to-region (point) (point-max))) | |
1098 (rmail-reformat-message (point-min) (point-max))))) | |
1099 | |
1100 ;;;; *** Rmail Attributes and Keywords *** | |
1101 | |
1102 ;; Make a string describing current message's attributes and keywords | |
1103 ;; and set it up as the name of a minor mode | |
1104 ;; so it will appear in the mode line. | |
1105 (defun rmail-display-labels () | |
1106 (let ((blurb "") (beg (point-min-marker)) (end (point-max-marker))) | |
1107 (save-excursion | |
1108 (unwind-protect | |
1109 (progn | |
1110 (widen) | |
1111 (goto-char (rmail-msgbeg rmail-current-message)) | |
1112 (forward-line 1) | |
1113 (if (looking-at "[01],") | |
1114 (progn | |
1115 (narrow-to-region (point) (progn (end-of-line) (point))) | |
1116 ;; Truly valid BABYL format requires a space before each | |
1117 ;; attribute or keyword name. Put them in if missing. | |
1118 (let (buffer-read-only) | |
1119 (goto-char (point-min)) | |
1120 (while (search-forward "," nil t) | |
1121 (or (looking-at "[ ,]") (eobp) | |
1122 (insert " ")))) | |
1123 (goto-char (point-max)) | |
1124 (if (search-backward ",," nil 'move) | |
1125 (progn | |
1126 (if (> (point) (1+ (point-min))) | |
1127 (setq blurb (buffer-substring (+ 1 (point-min)) (point)))) | |
1128 (if (> (- (point-max) (point)) 2) | |
1129 (setq blurb | |
1130 (concat blurb | |
1131 ";" | |
1132 (buffer-substring (+ (point) 3) | |
1133 (1- (point-max))))))))))) | |
1134 ;; Note: we don't use save-restriction because that does not work right | |
1135 ;; if changes are made outside the saved restriction | |
1136 ;; before that restriction is restored. | |
1137 (narrow-to-region beg end) | |
1138 (set-marker beg nil) | |
1139 (set-marker end nil))) | |
1140 (while (string-match " +," blurb) | |
1141 (setq blurb (concat (substring blurb 0 (match-beginning 0)) "," | |
1142 (substring blurb (match-end 0))))) | |
1143 (while (string-match ", +" blurb) | |
1144 (setq blurb (concat (substring blurb 0 (match-beginning 0)) "," | |
1145 (substring blurb (match-end 0))))) | |
1146 (setq mode-line-process | |
1147 (concat " " rmail-current-message "/" rmail-total-messages | |
1148 blurb)))) | |
1149 | |
1150 ;; Turn an attribute of a message on or off according to STATE. | |
1151 ;; ATTR is the name of the attribute, as a string. | |
1152 ;; MSGNUM is message number to change; nil means current message. | |
1153 (defun rmail-set-attribute (attr state &optional msgnum) | |
1154 (let ((omax (point-max-marker)) | |
1155 (omin (point-min-marker)) | |
1156 (buffer-read-only nil)) | |
1157 (or msgnum (setq msgnum rmail-current-message)) | |
5047
1ada11e2d89a
(rmail-set-attribute): Do nothing if MSGNUM is 0.
Richard M. Stallman <rms@gnu.org>
parents:
4969
diff
changeset
|
1158 (if (> msgnum 0) |
1ada11e2d89a
(rmail-set-attribute): Do nothing if MSGNUM is 0.
Richard M. Stallman <rms@gnu.org>
parents:
4969
diff
changeset
|
1159 (unwind-protect |
1ada11e2d89a
(rmail-set-attribute): Do nothing if MSGNUM is 0.
Richard M. Stallman <rms@gnu.org>
parents:
4969
diff
changeset
|
1160 (save-excursion |
1ada11e2d89a
(rmail-set-attribute): Do nothing if MSGNUM is 0.
Richard M. Stallman <rms@gnu.org>
parents:
4969
diff
changeset
|
1161 (widen) |
1ada11e2d89a
(rmail-set-attribute): Do nothing if MSGNUM is 0.
Richard M. Stallman <rms@gnu.org>
parents:
4969
diff
changeset
|
1162 (goto-char (+ 3 (rmail-msgbeg msgnum))) |
1ada11e2d89a
(rmail-set-attribute): Do nothing if MSGNUM is 0.
Richard M. Stallman <rms@gnu.org>
parents:
4969
diff
changeset
|
1163 (let ((curstate |
1ada11e2d89a
(rmail-set-attribute): Do nothing if MSGNUM is 0.
Richard M. Stallman <rms@gnu.org>
parents:
4969
diff
changeset
|
1164 (not |
1ada11e2d89a
(rmail-set-attribute): Do nothing if MSGNUM is 0.
Richard M. Stallman <rms@gnu.org>
parents:
4969
diff
changeset
|
1165 (null (search-backward (concat ", " attr ",") |
1ada11e2d89a
(rmail-set-attribute): Do nothing if MSGNUM is 0.
Richard M. Stallman <rms@gnu.org>
parents:
4969
diff
changeset
|
1166 (prog1 (point) (end-of-line)) t))))) |
1ada11e2d89a
(rmail-set-attribute): Do nothing if MSGNUM is 0.
Richard M. Stallman <rms@gnu.org>
parents:
4969
diff
changeset
|
1167 (or (eq curstate (not (not state))) |
1ada11e2d89a
(rmail-set-attribute): Do nothing if MSGNUM is 0.
Richard M. Stallman <rms@gnu.org>
parents:
4969
diff
changeset
|
1168 (if curstate |
1ada11e2d89a
(rmail-set-attribute): Do nothing if MSGNUM is 0.
Richard M. Stallman <rms@gnu.org>
parents:
4969
diff
changeset
|
1169 (delete-region (point) (1- (match-end 0))) |
1ada11e2d89a
(rmail-set-attribute): Do nothing if MSGNUM is 0.
Richard M. Stallman <rms@gnu.org>
parents:
4969
diff
changeset
|
1170 (beginning-of-line) |
1ada11e2d89a
(rmail-set-attribute): Do nothing if MSGNUM is 0.
Richard M. Stallman <rms@gnu.org>
parents:
4969
diff
changeset
|
1171 (forward-char 2) |
1ada11e2d89a
(rmail-set-attribute): Do nothing if MSGNUM is 0.
Richard M. Stallman <rms@gnu.org>
parents:
4969
diff
changeset
|
1172 (insert " " attr ",")))) |
1ada11e2d89a
(rmail-set-attribute): Do nothing if MSGNUM is 0.
Richard M. Stallman <rms@gnu.org>
parents:
4969
diff
changeset
|
1173 (if (string= attr "deleted") |
1ada11e2d89a
(rmail-set-attribute): Do nothing if MSGNUM is 0.
Richard M. Stallman <rms@gnu.org>
parents:
4969
diff
changeset
|
1174 (rmail-set-message-deleted-p msgnum state))) |
1ada11e2d89a
(rmail-set-attribute): Do nothing if MSGNUM is 0.
Richard M. Stallman <rms@gnu.org>
parents:
4969
diff
changeset
|
1175 ;; Note: we don't use save-restriction because that does not work right |
1ada11e2d89a
(rmail-set-attribute): Do nothing if MSGNUM is 0.
Richard M. Stallman <rms@gnu.org>
parents:
4969
diff
changeset
|
1176 ;; if changes are made outside the saved restriction |
1ada11e2d89a
(rmail-set-attribute): Do nothing if MSGNUM is 0.
Richard M. Stallman <rms@gnu.org>
parents:
4969
diff
changeset
|
1177 ;; before that restriction is restored. |
1ada11e2d89a
(rmail-set-attribute): Do nothing if MSGNUM is 0.
Richard M. Stallman <rms@gnu.org>
parents:
4969
diff
changeset
|
1178 (narrow-to-region omin omax) |
1ada11e2d89a
(rmail-set-attribute): Do nothing if MSGNUM is 0.
Richard M. Stallman <rms@gnu.org>
parents:
4969
diff
changeset
|
1179 (set-marker omin nil) |
1ada11e2d89a
(rmail-set-attribute): Do nothing if MSGNUM is 0.
Richard M. Stallman <rms@gnu.org>
parents:
4969
diff
changeset
|
1180 (set-marker omax nil) |
1ada11e2d89a
(rmail-set-attribute): Do nothing if MSGNUM is 0.
Richard M. Stallman <rms@gnu.org>
parents:
4969
diff
changeset
|
1181 (if (= msgnum rmail-current-message) |
1ada11e2d89a
(rmail-set-attribute): Do nothing if MSGNUM is 0.
Richard M. Stallman <rms@gnu.org>
parents:
4969
diff
changeset
|
1182 (rmail-display-labels)))))) |
270 | 1183 |
1184 ;; Return t if the attributes/keywords line of msg number MSG | |
1185 ;; contains a match for the regexp LABELS. | |
1186 (defun rmail-message-labels-p (msg labels) | |
1187 (save-excursion | |
1188 (save-restriction | |
1189 (widen) | |
1190 (goto-char (rmail-msgbeg msg)) | |
1191 (forward-char 3) | |
1192 (re-search-backward labels (prog1 (point) (end-of-line)) t)))) | |
1193 | |
1194 ;;;; *** Rmail Message Selection And Support *** | |
1195 | |
1196 (defun rmail-msgend (n) | |
1197 (marker-position (aref rmail-message-vector (1+ n)))) | |
1198 | |
1199 (defun rmail-msgbeg (n) | |
1200 (marker-position (aref rmail-message-vector n))) | |
1201 | |
1202 (defun rmail-widen-to-current-msgbeg (function) | |
1203 "Call FUNCTION with point at start of internal data of current message. | |
1204 Assumes that bounds were previously narrowed to display the message in Rmail. | |
1205 The bounds are widened enough to move point where desired, then narrowed | |
1206 again afterward. | |
1207 | |
1208 FUNCTION may not change the visible text of the message, but it may | |
1209 change the invisible header text." | |
1210 (save-excursion | |
344 | 1211 (let ((obeg (- (point-max) (point-min)))) |
270 | 1212 (unwind-protect |
1213 (progn | |
1214 (narrow-to-region (rmail-msgbeg rmail-current-message) | |
1215 (point-max)) | |
1216 (goto-char (point-min)) | |
1217 (funcall function)) | |
1218 ;; Note: we don't use save-restriction because that does not work right | |
1219 ;; if changes are made outside the saved restriction | |
1220 ;; before that restriction is restored. | |
1221 ;; Here we assume that changes made by FUNCTION | |
1222 ;; occur before the visible region of the message. | |
344 | 1223 (narrow-to-region (- (point-max) obeg) (point-max)))))) |
270 | 1224 |
1225 (defun rmail-forget-messages () | |
1226 (unwind-protect | |
1227 (if (vectorp rmail-message-vector) | |
1228 (let* ((i 0) | |
1229 (v rmail-message-vector) | |
1230 (n (length v))) | |
1231 (while (< i n) | |
1232 (move-marker (aref v i) nil) | |
1233 (setq i (1+ i))))) | |
1234 (setq rmail-message-vector nil) | |
1235 (setq rmail-deleted-vector nil))) | |
1236 | |
1237 (defun rmail-maybe-set-message-counters () | |
1238 (if (not (and rmail-deleted-vector | |
1239 rmail-message-vector | |
1240 rmail-current-message | |
1241 rmail-total-messages)) | |
1242 (rmail-set-message-counters))) | |
1243 | |
1244 (defun rmail-count-new-messages (&optional nomsg) | |
1245 (let* ((case-fold-search nil) | |
1246 (total-messages 0) | |
1247 (messages-head nil) | |
1248 (deleted-head nil)) | |
1249 (or nomsg (message "Counting new messages...")) | |
1250 (goto-char (point-max)) | |
1251 ;; Put at the end of messages-head | |
1252 ;; the entry for message N+1, which marks | |
1253 ;; the end of message N. (N = number of messages). | |
1254 (search-backward "\n\^_") | |
1255 (forward-char 1) | |
1256 (setq messages-head (list (point-marker))) | |
1257 (rmail-set-message-counters-counter (point-min)) | |
1258 (setq rmail-current-message (1+ rmail-total-messages)) | |
1259 (setq rmail-total-messages | |
1260 (+ rmail-total-messages total-messages)) | |
1261 (setq rmail-message-vector | |
1262 (vconcat rmail-message-vector (cdr messages-head))) | |
1263 (aset rmail-message-vector | |
1264 rmail-current-message (car messages-head)) | |
1265 (setq rmail-deleted-vector | |
1266 (concat rmail-deleted-vector deleted-head)) | |
1267 (setq rmail-summary-vector | |
1268 (vconcat rmail-summary-vector (make-vector total-messages nil))) | |
1269 (goto-char (point-min)) | |
1270 (or nomsg (message "Counting new messages...done (%d)" total-messages)))) | |
1271 | |
1272 (defun rmail-set-message-counters () | |
1273 (rmail-forget-messages) | |
1274 (save-excursion | |
1275 (save-restriction | |
1276 (widen) | |
1277 (let* ((point-save (point)) | |
1278 (total-messages 0) | |
1279 (messages-after-point) | |
1280 (case-fold-search nil) | |
1281 (messages-head nil) | |
1282 (deleted-head nil)) | |
1283 (message "Counting messages...") | |
1284 (goto-char (point-max)) | |
1285 ;; Put at the end of messages-head | |
1286 ;; the entry for message N+1, which marks | |
1287 ;; the end of message N. (N = number of messages). | |
5586
fdf1d3924296
(rmail-bury): Rename local rmail-buffer to buffer-to-bury.
Richard M. Stallman <rms@gnu.org>
parents:
5470
diff
changeset
|
1288 (search-backward "\n\^_" nil t) |
fdf1d3924296
(rmail-bury): Rename local rmail-buffer to buffer-to-bury.
Richard M. Stallman <rms@gnu.org>
parents:
5470
diff
changeset
|
1289 (if (/= (point) (point-max)) (forward-char 1)) |
270 | 1290 (setq messages-head (list (point-marker))) |
1291 (rmail-set-message-counters-counter (min (point) point-save)) | |
1292 (setq messages-after-point total-messages) | |
1293 (rmail-set-message-counters-counter) | |
1294 (setq rmail-total-messages total-messages) | |
1295 (setq rmail-current-message | |
1296 (min total-messages | |
1297 (max 1 (- total-messages messages-after-point)))) | |
1298 (setq rmail-message-vector | |
1299 (apply 'vector (cons (point-min-marker) messages-head)) | |
1300 rmail-deleted-vector (concat "D" deleted-head) | |
1301 rmail-summary-vector (make-vector rmail-total-messages nil)) | |
1302 (message "Counting messages...done"))))) | |
1303 | |
1304 (defun rmail-set-message-counters-counter (&optional stop) | |
1305 (while (search-backward "\n\^_\^L\n" stop t) | |
1306 (forward-char 1) | |
1307 (setq messages-head (cons (point-marker) messages-head)) | |
1308 (save-excursion | |
1309 (setq deleted-head | |
1310 (cons (if (search-backward ", deleted," | |
1311 (prog1 (point) | |
1312 (forward-line 2)) | |
1313 t) | |
1314 ?D ?\ ) | |
1315 deleted-head))) | |
1316 (if (zerop (% (setq total-messages (1+ total-messages)) 20)) | |
1317 (message "Counting messages...%d" total-messages)))) | |
1318 | |
1319 (defun rmail-beginning-of-message () | |
1320 "Show current message starting from the beginning." | |
1321 (interactive) | |
1322 (rmail-show-message rmail-current-message)) | |
1323 | |
1324 (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
|
1325 "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
|
1326 If summary buffer is currently displayed, update current message there also." |
270 | 1327 (interactive "p") |
1328 (rmail-maybe-set-message-counters) | |
1329 (widen) | |
1330 (if (zerop rmail-total-messages) | |
1331 (progn (narrow-to-region (point-min) (1- (point-max))) | |
1332 (goto-char (point-min)) | |
1333 (setq mode-line-process nil)) | |
1334 (let (blurb) | |
1335 (if (not n) | |
1336 (setq n rmail-current-message) | |
1337 (cond ((<= n 0) | |
1338 (setq n 1 | |
1339 rmail-current-message 1 | |
1340 blurb "No previous message")) | |
1341 ((> n rmail-total-messages) | |
1342 (setq n rmail-total-messages | |
1343 rmail-current-message rmail-total-messages | |
1344 blurb "No following message")) | |
1345 (t | |
1346 (setq rmail-current-message n)))) | |
1347 (let ((beg (rmail-msgbeg n)) | |
1348 (end (rmail-msgend n))) | |
1349 (goto-char beg) | |
1350 (forward-line 1) | |
1351 (if (= (following-char) ?0) | |
1352 (progn | |
1353 (rmail-reformat-message beg end) | |
1354 (rmail-set-attribute "unseen" nil)) | |
1355 (search-forward "\n*** EOOH ***\n" end t) | |
1356 (narrow-to-region (point) end)) | |
1357 (goto-char (point-min)) | |
1358 (rmail-display-labels) | |
1359 (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
|
1360 ;; 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
|
1361 ;; 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
|
1362 ;; 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
|
1363 (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
|
1364 (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
|
1365 (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
|
1366 (rmail-summary-goto-msg curr-msg t t)))) |
270 | 1367 (if blurb |
1368 (message blurb)))))) | |
1369 | |
1370 (defun rmail-next-message (n) | |
1371 "Show following message whether deleted or not. | |
1372 With prefix arg N, moves forward N messages, or backward if N is negative." | |
1373 (interactive "p") | |
1374 (rmail-maybe-set-message-counters) | |
1375 (rmail-show-message (+ rmail-current-message n))) | |
1376 | |
1377 (defun rmail-previous-message (n) | |
1378 "Show previous message whether deleted or not. | |
1379 With prefix arg N, moves backward N messages, or forward if N is negative." | |
1380 (interactive "p") | |
1381 (rmail-next-message (- n))) | |
1382 | |
1383 (defun rmail-next-undeleted-message (n) | |
1384 "Show following non-deleted message. | |
1385 With prefix arg N, moves forward N non-deleted messages, | |
4838
754b38c0e941
(rmail): Really don't get new mail if file name was given.
Richard M. Stallman <rms@gnu.org>
parents:
4819
diff
changeset
|
1386 or backward if N is negative. |
754b38c0e941
(rmail): Really don't get new mail if file name was given.
Richard M. Stallman <rms@gnu.org>
parents:
4819
diff
changeset
|
1387 |
754b38c0e941
(rmail): Really don't get new mail if file name was given.
Richard M. Stallman <rms@gnu.org>
parents:
4819
diff
changeset
|
1388 Returns t if a new message is being shown, nil otherwise." |
270 | 1389 (interactive "p") |
1390 (rmail-maybe-set-message-counters) | |
1391 (let ((lastwin rmail-current-message) | |
1392 (current rmail-current-message)) | |
1393 (while (and (> n 0) (< current rmail-total-messages)) | |
1394 (setq current (1+ current)) | |
1395 (if (not (rmail-message-deleted-p current)) | |
1396 (setq lastwin current n (1- n)))) | |
1397 (while (and (< n 0) (> current 1)) | |
1398 (setq current (1- current)) | |
1399 (if (not (rmail-message-deleted-p current)) | |
1400 (setq lastwin current n (1+ n)))) | |
1401 (if (/= lastwin rmail-current-message) | |
4838
754b38c0e941
(rmail): Really don't get new mail if file name was given.
Richard M. Stallman <rms@gnu.org>
parents:
4819
diff
changeset
|
1402 (progn (rmail-show-message lastwin) |
754b38c0e941
(rmail): Really don't get new mail if file name was given.
Richard M. Stallman <rms@gnu.org>
parents:
4819
diff
changeset
|
1403 t) |
754b38c0e941
(rmail): Really don't get new mail if file name was given.
Richard M. Stallman <rms@gnu.org>
parents:
4819
diff
changeset
|
1404 (if (< n 0) |
754b38c0e941
(rmail): Really don't get new mail if file name was given.
Richard M. Stallman <rms@gnu.org>
parents:
4819
diff
changeset
|
1405 (message "No previous nondeleted message")) |
754b38c0e941
(rmail): Really don't get new mail if file name was given.
Richard M. Stallman <rms@gnu.org>
parents:
4819
diff
changeset
|
1406 (if (> n 0) |
754b38c0e941
(rmail): Really don't get new mail if file name was given.
Richard M. Stallman <rms@gnu.org>
parents:
4819
diff
changeset
|
1407 (message "No following nondeleted message")) |
754b38c0e941
(rmail): Really don't get new mail if file name was given.
Richard M. Stallman <rms@gnu.org>
parents:
4819
diff
changeset
|
1408 nil))) |
270 | 1409 |
1410 (defun rmail-previous-undeleted-message (n) | |
1411 "Show previous non-deleted message. | |
1412 With prefix argument N, moves backward N non-deleted messages, | |
1413 or forward if N is negative." | |
1414 (interactive "p") | |
1415 (rmail-next-undeleted-message (- n))) | |
1416 | |
1417 (defun rmail-first-message () | |
1418 "Show first message in file." | |
1419 (interactive) | |
1420 (rmail-maybe-set-message-counters) | |
1421 (rmail-show-message 1)) | |
1422 | |
1423 (defun rmail-last-message () | |
1424 "Show last message in file." | |
1425 (interactive) | |
1426 (rmail-maybe-set-message-counters) | |
1427 (rmail-show-message rmail-total-messages)) | |
1428 | |
1429 (defun rmail-what-message () | |
1430 (let ((where (point)) | |
1431 (low 1) | |
1432 (high rmail-total-messages) | |
1433 (mid (/ rmail-total-messages 2))) | |
1434 (while (> (- high low) 1) | |
1435 (if (>= where (rmail-msgbeg mid)) | |
1436 (setq low mid) | |
1437 (setq high mid)) | |
1438 (setq mid (+ low (/ (- high low) 2)))) | |
1439 (if (>= where (rmail-msgbeg high)) high low))) | |
1440 | |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1441 (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
|
1442 (save-restriction |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1443 (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
|
1444 (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
|
1445 (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
|
1446 (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
|
1447 (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
|
1448 (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
|
1449 (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
|
1450 |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1451 (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
|
1452 "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
|
1453 (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
|
1454 (let ((end |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1455 (save-excursion |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1456 (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
|
1457 (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
|
1458 |
3863
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
1459 (defun rmail-search-backward (regexp &optional n) |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
1460 "Show message containing next match for REGEXP. |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
1461 Prefix argument gives repeat count; negative argument means search |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
1462 backwards (through earlier messages). |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
1463 Interactively, empty argument means use same regexp used last time." |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
1464 (interactive |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
1465 (let* ((reversep (>= (prefix-numeric-value current-prefix-arg) 0)) |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
1466 (prompt |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
1467 (concat (if reversep "Reverse " "") "Rmail search (regexp): ")) |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
1468 regexp) |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
1469 (if rmail-search-last-regexp |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
1470 (setq prompt (concat prompt |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
1471 "(default " |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
1472 rmail-search-last-regexp |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
1473 ") "))) |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
1474 (setq regexp (read-string prompt)) |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
1475 (cond ((not (equal regexp "")) |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
1476 (setq rmail-search-last-regexp regexp)) |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
1477 ((not rmail-search-last-regexp) |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
1478 (error "No previous Rmail search string"))) |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
1479 (list rmail-search-last-regexp |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
1480 (prefix-numeric-value current-prefix-arg)))) |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
1481 (rmail-search regexp (- n))) |
049283382a10
(rmail-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents:
3631
diff
changeset
|
1482 |
270 | 1483 (defvar rmail-search-last-regexp nil) |
874
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1484 (defun rmail-search (regexp &optional n) |
270 | 1485 "Show message containing next match for REGEXP. |
874
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1486 Prefix argument gives repeat count; negative argument means search |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1487 backwards (through earlier messages). |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1488 Interactively, empty argument means use same regexp used last time." |
270 | 1489 (interactive |
1490 (let* ((reversep (< (prefix-numeric-value current-prefix-arg) 0)) | |
1491 (prompt | |
1492 (concat (if reversep "Reverse " "") "Rmail search (regexp): ")) | |
1493 regexp) | |
1494 (if rmail-search-last-regexp | |
1495 (setq prompt (concat prompt | |
1496 "(default " | |
1497 rmail-search-last-regexp | |
1498 ") "))) | |
1499 (setq regexp (read-string prompt)) | |
1500 (cond ((not (equal regexp "")) | |
1501 (setq rmail-search-last-regexp regexp)) | |
1502 ((not rmail-search-last-regexp) | |
1503 (error "No previous Rmail search string"))) | |
874
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1504 (list rmail-search-last-regexp |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1505 (prefix-numeric-value current-prefix-arg)))) |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1506 (or n (setq n 1)) |
270 | 1507 (message "%sRmail search for %s..." |
937
0f082d63bfd6
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
874
diff
changeset
|
1508 (if (< n 0) "Reverse " "") |
270 | 1509 regexp) |
1510 (rmail-maybe-set-message-counters) | |
1511 (let ((omin (point-min)) | |
1512 (omax (point-max)) | |
1513 (opoint (point)) | |
1514 win | |
874
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1515 (reversep (< n 0)) |
270 | 1516 (msg rmail-current-message)) |
1517 (unwind-protect | |
1518 (progn | |
1519 (widen) | |
874
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1520 (while (/= n 0) |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1521 ;; 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
|
1522 ;; but searching forward through each message. |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1523 (if reversep |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1524 (while (and (null win) (> msg 1)) |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1525 (goto-char (rmail-msgbeg (setq msg (1- msg)))) |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1526 (setq win (re-search-forward |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1527 regexp (rmail-msgend msg) t))) |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1528 (while (and (null win) (< msg rmail-total-messages)) |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1529 (goto-char (rmail-msgbeg (setq msg (1+ msg)))) |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1530 (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
|
1531 (setq n (+ n (if reversep 1 -1))))) |
270 | 1532 (if win |
1533 (progn | |
1534 ;; If this is a reverse search and we found a message, | |
1535 ;; search backward thru this message to position point. | |
1536 (if reversep | |
1537 (progn | |
1538 (goto-char (rmail-msgend msg)) | |
1539 (re-search-backward | |
1540 regexp (rmail-msgbeg msg) t))) | |
1541 (setq win (point)) | |
1542 (rmail-show-message msg) | |
1543 (message "%sRmail search for %s...done" | |
1544 (if reversep "Reverse " "") | |
1545 regexp) | |
1546 (goto-char win)) | |
1547 (goto-char opoint) | |
1548 (narrow-to-region omin omax) | |
1549 (ding) | |
1550 (message "Search failed: %s" regexp))))) | |
1551 | |
874
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1552 (defun rmail-search-backwards (regexp &optional n) |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1553 "Show message containing previous match for REGEXP. |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1554 Prefix argument gives repeat count; negative argument means search |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1555 forward (through later messages). |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1556 Interactively, empty argument means use same regexp used last time." |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1557 (interactive |
937
0f082d63bfd6
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
874
diff
changeset
|
1558 (let* ((reversep (>= (prefix-numeric-value current-prefix-arg) 0)) |
874
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1559 (prompt |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1560 (concat (if reversep "Reverse " "") "Rmail search (regexp): ")) |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1561 regexp) |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1562 (if rmail-search-last-regexp |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1563 (setq prompt (concat prompt |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1564 "(default " |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1565 rmail-search-last-regexp |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1566 ") "))) |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1567 (setq regexp (read-string prompt)) |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1568 (cond ((not (equal regexp "")) |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1569 (setq rmail-search-last-regexp regexp)) |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1570 ((not rmail-search-last-regexp) |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1571 (error "No previous Rmail search string"))) |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1572 (list rmail-search-last-regexp |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1573 (prefix-numeric-value current-prefix-arg)))) |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1574 (rmail-search regexp (- (or n -1)))) |
b945f592b94d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
1575 |
270 | 1576 ;; Show the first message which has the `unseen' attribute. |
1577 (defun rmail-first-unseen-message () | |
1360
9cb1a4b90b5c
Cleaned up rmail-first-unseen-message.
Joseph Arceneaux <jla@gnu.org>
parents:
1342
diff
changeset
|
1578 (rmail-maybe-set-message-counters) |
270 | 1579 (let ((current 1) |
1580 found) | |
1581 (save-restriction | |
1582 (widen) | |
1583 (while (and (not found) (< current rmail-total-messages)) | |
1584 (if (rmail-message-labels-p current ", ?\\(unseen\\),") | |
346 | 1585 (setq found current)) |
1586 (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
|
1587 ;; 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
|
1588 ;; (if found |
776d4c59f256
* rmail.el (rmail-first-unseen-message): Don't show the message,
Joseph Arceneaux <jla@gnu.org>
parents:
1267
diff
changeset
|
1589 ;; (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
|
1590 found)) |
270 | 1591 |
1592 ;;;; *** Rmail Message Deletion Commands *** | |
1593 | |
1594 (defun rmail-message-deleted-p (n) | |
1595 (= (aref rmail-deleted-vector n) ?D)) | |
1596 | |
1597 (defun rmail-set-message-deleted-p (n state) | |
1598 (aset rmail-deleted-vector n (if state ?D ?\ ))) | |
1599 | |
1600 (defun rmail-delete-message () | |
1601 "Delete this message and stay on it." | |
1602 (interactive) | |
1603 (rmail-set-attribute "deleted" t)) | |
1604 | |
1605 (defun rmail-undelete-previous-message () | |
1606 "Back up to deleted message, select it, and undelete it." | |
1607 (interactive) | |
1608 (let ((msg rmail-current-message)) | |
1609 (while (and (> msg 0) | |
1610 (not (rmail-message-deleted-p msg))) | |
1611 (setq msg (1- msg))) | |
1612 (if (= msg 0) | |
1613 (error "No previous deleted message") | |
1614 (if (/= msg rmail-current-message) | |
1615 (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
|
1616 (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
|
1617 (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
|
1618 (save-excursion |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1619 (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
|
1620 (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
|
1621 (rmail-maybe-display-summary)))) |
270 | 1622 |
1623 (defun rmail-delete-forward (&optional backward) | |
1624 "Delete this message and move to next nondeleted one. | |
1625 Deleted messages stay in the file until the \\[rmail-expunge] command is given. | |
4838
754b38c0e941
(rmail): Really don't get new mail if file name was given.
Richard M. Stallman <rms@gnu.org>
parents:
4819
diff
changeset
|
1626 With prefix argument, delete and move backward. |
754b38c0e941
(rmail): Really don't get new mail if file name was given.
Richard M. Stallman <rms@gnu.org>
parents:
4819
diff
changeset
|
1627 |
754b38c0e941
(rmail): Really don't get new mail if file name was given.
Richard M. Stallman <rms@gnu.org>
parents:
4819
diff
changeset
|
1628 Returns t if a new message is displayed after the delete, or nil otherwise." |
270 | 1629 (interactive "P") |
1630 (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
|
1631 (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
|
1632 (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
|
1633 (save-excursion |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1634 (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
|
1635 (rmail-summary-mark-deleted del-msg))) |
4838
754b38c0e941
(rmail): Really don't get new mail if file name was given.
Richard M. Stallman <rms@gnu.org>
parents:
4819
diff
changeset
|
1636 (prog1 (rmail-next-undeleted-message (if backward -1 1)) |
754b38c0e941
(rmail): Really don't get new mail if file name was given.
Richard M. Stallman <rms@gnu.org>
parents:
4819
diff
changeset
|
1637 (rmail-maybe-display-summary)))) |
270 | 1638 |
1639 (defun rmail-delete-backward () | |
1640 "Delete this message and move to previous nondeleted one. | |
1641 Deleted messages stay in the file until the \\[rmail-expunge] command is given." | |
1642 (interactive) | |
1643 (rmail-delete-forward t)) | |
1644 | |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1645 (defun rmail-only-expunge () |
270 | 1646 "Actually erase all deleted messages in the file." |
1647 (interactive) | |
1648 (message "Expunging deleted messages...") | |
1649 ;; Discard all undo records for this buffer. | |
1650 (or (eq buffer-undo-list t) | |
1651 (setq buffer-undo-list nil)) | |
1652 (rmail-maybe-set-message-counters) | |
1653 (let* ((omax (- (buffer-size) (point-max))) | |
1654 (omin (- (buffer-size) (point-min))) | |
1655 (opoint (if (and (> rmail-current-message 0) | |
1656 (= ?D (aref rmail-deleted-vector rmail-current-message))) | |
1657 0 (- (point) (point-min)))) | |
1658 (messages-head (cons (aref rmail-message-vector 0) nil)) | |
1659 (messages-tail messages-head) | |
1660 ;; Don't make any undo records for the expunging. | |
1661 (buffer-undo-list t) | |
1662 (win)) | |
1663 (unwind-protect | |
1664 (save-excursion | |
1665 (widen) | |
1666 (goto-char (point-min)) | |
1667 (let ((counter 0) | |
1668 (number 1) | |
1669 (total rmail-total-messages) | |
1670 (new-message-number rmail-current-message) | |
1671 (new-summary nil) | |
1672 (buffer-read-only nil) | |
1673 (messages rmail-message-vector) | |
1674 (deleted rmail-deleted-vector) | |
1675 (summary rmail-summary-vector)) | |
1676 (setq rmail-total-messages nil | |
1677 rmail-current-message nil | |
1678 rmail-message-vector nil | |
1679 rmail-deleted-vector nil | |
1680 rmail-summary-vector nil) | |
1681 (while (<= number total) | |
1682 (if (= (aref deleted number) ?D) | |
1683 (progn | |
1684 (delete-region | |
1685 (marker-position (aref messages number)) | |
1686 (marker-position (aref messages (1+ number)))) | |
1687 (move-marker (aref messages number) nil) | |
1688 (if (> new-message-number counter) | |
1689 (setq new-message-number (1- new-message-number)))) | |
1690 (setq counter (1+ counter)) | |
1691 (setq messages-tail | |
1692 (setcdr messages-tail | |
1693 (cons (aref messages number) nil))) | |
1694 (setq new-summary | |
1695 (cons (if (= counter number) (aref summary (1- number))) | |
1696 new-summary))) | |
1697 (if (zerop (% (setq number (1+ number)) 20)) | |
1698 (message "Expunging deleted messages...%d" number))) | |
1699 (setq messages-tail | |
1700 (setcdr messages-tail | |
1701 (cons (aref messages number) nil))) | |
1702 (setq rmail-current-message new-message-number | |
1703 rmail-total-messages counter | |
1704 rmail-message-vector (apply 'vector messages-head) | |
1705 rmail-deleted-vector (make-string (1+ counter) ?\ ) | |
1706 rmail-summary-vector (vconcat (nreverse new-summary)) | |
1707 win t))) | |
1708 (message "Expunging deleted messages...done") | |
1709 (if (not win) | |
1710 (narrow-to-region (- (buffer-size) omin) (- (buffer-size) omax))) | |
1711 (rmail-show-message | |
1712 (if (zerop rmail-current-message) 1 nil)) | |
1713 (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
|
1714 |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1715 (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
|
1716 "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
|
1717 (interactive) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1718 (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
|
1719 (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
|
1720 (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
|
1721 (rmail-update-summary)))) |
270 | 1722 |
1723 ;;;; *** Rmail Mailing Commands *** | |
1724 | |
4108
e4fbcd480455
(rmail-mail-new-frame): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4071
diff
changeset
|
1725 (defun rmail-start-mail (&rest args) |
4969
af6f961194ce
(rmail-start-mail): Don't do other frame unless we have
Richard M. Stallman <rms@gnu.org>
parents:
4844
diff
changeset
|
1726 (if (and window-system rmail-mail-new-frame) |
4263
7c7fa71cfd6e
(rmail-last-rmail-file): Initialize to a file name.
Richard M. Stallman <rms@gnu.org>
parents:
4108
diff
changeset
|
1727 (prog1 |
4108
e4fbcd480455
(rmail-mail-new-frame): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4071
diff
changeset
|
1728 (apply 'mail-other-frame args) |
e4fbcd480455
(rmail-mail-new-frame): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4071
diff
changeset
|
1729 (modify-frame-parameters (selected-frame) |
e4fbcd480455
(rmail-mail-new-frame): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4071
diff
changeset
|
1730 '((dedicated . t)))) |
e4fbcd480455
(rmail-mail-new-frame): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4071
diff
changeset
|
1731 (apply 'mail-other-window args))) |
e4fbcd480455
(rmail-mail-new-frame): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4071
diff
changeset
|
1732 |
270 | 1733 (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
|
1734 "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
|
1735 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
|
1736 original message into it." |
270 | 1737 (interactive) |
4108
e4fbcd480455
(rmail-mail-new-frame): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4071
diff
changeset
|
1738 (rmail-start-mail nil nil nil nil nil (current-buffer))) |
270 | 1739 |
1740 (defun rmail-continue () | |
1741 "Continue composing outgoing message previously being composed." | |
1742 (interactive) | |
4108
e4fbcd480455
(rmail-mail-new-frame): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4071
diff
changeset
|
1743 (rmail-start-mail t)) |
270 | 1744 |
1745 (defun rmail-reply (just-sender) | |
1746 "Reply to the current message. | |
1747 Normally include CC: to all other recipients of original message; | |
1748 prefix argument means ignore them. While composing the reply, | |
1749 use \\[mail-yank-original] to yank the original message into it." | |
1750 (interactive "P") | |
1751 (let (from reply-to cc subject date to message-id resent-reply-to) | |
1752 (save-excursion | |
1753 (save-restriction | |
1754 (widen) | |
1755 (goto-char (rmail-msgbeg rmail-current-message)) | |
1756 (forward-line 1) | |
1757 (if (= (following-char) ?0) | |
1758 (narrow-to-region | |
1759 (progn (forward-line 2) | |
1760 (point)) | |
1761 (progn (search-forward "\n\n" (rmail-msgend rmail-current-message) | |
1762 'move) | |
1763 (point))) | |
1764 (narrow-to-region (point) | |
1765 (progn (search-forward "\n*** EOOH ***\n") | |
1766 (beginning-of-line) (point)))) | |
1767 (setq resent-reply-to (mail-fetch-field "resent-reply-to" t) | |
1768 from (mail-fetch-field "from") | |
1769 reply-to (or resent-reply-to | |
1770 (mail-fetch-field "reply-to" nil t) | |
1771 from) | |
1772 cc (cond (just-sender nil) | |
1773 (resent-reply-to (mail-fetch-field "resent-cc" t)) | |
1774 (t (mail-fetch-field "cc" nil t))) | |
1775 subject (or (and resent-reply-to | |
1776 (mail-fetch-field "resent-subject" t)) | |
1777 (mail-fetch-field "subject")) | |
5782
f3b8ec718c67
(rmail-reply): If no resent-date, use ordinary date.
Richard M. Stallman <rms@gnu.org>
parents:
5692
diff
changeset
|
1778 date (or (and resent-reply-to |
f3b8ec718c67
(rmail-reply): If no resent-date, use ordinary date.
Richard M. Stallman <rms@gnu.org>
parents:
5692
diff
changeset
|
1779 (mail-fetch-field "resent-date" t)) |
f3b8ec718c67
(rmail-reply): If no resent-date, use ordinary date.
Richard M. Stallman <rms@gnu.org>
parents:
5692
diff
changeset
|
1780 (mail-fetch-field "date")) |
270 | 1781 to (cond (resent-reply-to |
5782
f3b8ec718c67
(rmail-reply): If no resent-date, use ordinary date.
Richard M. Stallman <rms@gnu.org>
parents:
5692
diff
changeset
|
1782 (or (mail-fetch-field "resent-to" t)) "") |
270 | 1783 ((mail-fetch-field "to" nil t)) |
1784 ;((mail-fetch-field "apparently-to")) ack gag barf | |
1785 (t "")) | |
1786 message-id (cond (resent-reply-to | |
1787 (mail-fetch-field "resent-message-id" t)) | |
1788 ((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
|
1789 (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
|
1790 (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
|
1791 subject) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
1792 (setq subject (concat rmail-reply-prefix subject)))) |
4108
e4fbcd480455
(rmail-mail-new-frame): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4071
diff
changeset
|
1793 (rmail-start-mail nil |
270 | 1794 (mail-strip-quoted-names reply-to) |
1795 subject | |
1796 (rmail-make-in-reply-to-field from date message-id) | |
1797 (if just-sender | |
1798 nil | |
1799 (let* ((cc-list (rmail-dont-reply-to | |
1800 (mail-strip-quoted-names | |
1801 (if (null cc) to (concat to ", " cc)))))) | |
1802 (if (string= cc-list "") nil cc-list))) | |
1803 (current-buffer) | |
1804 (list (list '(lambda (buf msgnum) | |
1805 (save-excursion | |
1806 (set-buffer buf) | |
1807 (rmail-set-attribute "answered" t msgnum))) | |
1808 (current-buffer) rmail-current-message))))) | |
1809 | |
1810 (defun rmail-make-in-reply-to-field (from date message-id) | |
1811 (cond ((not from) | |
1812 (if message-id | |
1813 message-id | |
1814 nil)) | |
1815 (mail-use-rfc822 | |
1816 (require 'rfc822) | |
1817 (let ((tem (car (rfc822-addresses from)))) | |
1818 (if message-id | |
1819 (if (string-match | |
1820 (regexp-quote (if (string-match "@[^@]*\\'" tem) | |
1821 (substring tem 0 (match-beginning 0)) | |
1822 tem)) | |
1823 message-id) | |
1824 ;; Message-ID is sufficiently informative | |
1825 message-id | |
1826 (concat message-id " (" tem ")")) | |
5692
bb9b20ea092d
(rmail-make-in-reply-to-field): Discard text properties from
Richard M. Stallman <rms@gnu.org>
parents:
5611
diff
changeset
|
1827 ;; Copy TEM, discarding text properties. |
bb9b20ea092d
(rmail-make-in-reply-to-field): Discard text properties from
Richard M. Stallman <rms@gnu.org>
parents:
5611
diff
changeset
|
1828 (setq tem (copy-sequence tem)) |
bb9b20ea092d
(rmail-make-in-reply-to-field): Discard text properties from
Richard M. Stallman <rms@gnu.org>
parents:
5611
diff
changeset
|
1829 (set-text-properties 0 (length tem) nil tem) |
bb9b20ea092d
(rmail-make-in-reply-to-field): Discard text properties from
Richard M. Stallman <rms@gnu.org>
parents:
5611
diff
changeset
|
1830 (setq tem (copy-sequence tem)) |
bb9b20ea092d
(rmail-make-in-reply-to-field): Discard text properties from
Richard M. Stallman <rms@gnu.org>
parents:
5611
diff
changeset
|
1831 ;; Use prin1 to fake RFC822 quoting |
bb9b20ea092d
(rmail-make-in-reply-to-field): Discard text properties from
Richard M. Stallman <rms@gnu.org>
parents:
5611
diff
changeset
|
1832 (let ((field (prin1-to-string tem))) |
bb9b20ea092d
(rmail-make-in-reply-to-field): Discard text properties from
Richard M. Stallman <rms@gnu.org>
parents:
5611
diff
changeset
|
1833 (if date |
bb9b20ea092d
(rmail-make-in-reply-to-field): Discard text properties from
Richard M. Stallman <rms@gnu.org>
parents:
5611
diff
changeset
|
1834 (concat field "'s message of " date) |
bb9b20ea092d
(rmail-make-in-reply-to-field): Discard text properties from
Richard M. Stallman <rms@gnu.org>
parents:
5611
diff
changeset
|
1835 field))))) |
270 | 1836 ((let* ((foo "[^][\000-\037\177-\377()<>@,;:\\\" ]+") |
1837 (bar "[^][\000-\037\177-\377()<>@,;:\\\"]+")) | |
1838 ;; Can't use format because format loses on \000 (unix *^&%*^&%$!!) | |
1839 (or (string-match (concat "\\`[ \t]*\\(" bar | |
1840 "\\)\\(<" foo "@" foo ">\\)?[ \t]*\\'") | |
1841 ;; "Unix Loser <Foo@bar.edu>" => "Unix Loser" | |
1842 from) | |
1843 (string-match (concat "\\`[ \t]*<" foo "@" foo ">[ \t]*(\\(" | |
1844 bar "\\))[ \t]*\\'") | |
1845 ;; "<Bugs@bar.edu>" (Losing Unix) => "Losing Unix" | |
1846 from))) | |
1847 (let ((start (match-beginning 1)) | |
1848 (end (match-end 1))) | |
1849 ;; Trim whitespace which above regexp match allows | |
1850 (while (and (< start end) | |
1851 (memq (aref from start) '(?\t ?\ ))) | |
1852 (setq start (1+ start))) | |
1853 (while (and (< start end) | |
1854 (memq (aref from (1- end)) '(?\t ?\ ))) | |
1855 (setq end (1- end))) | |
1856 (let ((field (substring from start end))) | |
1857 (if date (setq field (concat "message from " field " on " date))) | |
1858 (if message-id | |
1859 ;; "<AA259@bar.edu> (message from Unix Loser on 1-Apr-89)" | |
1860 (concat message-id " (" field ")") | |
1861 field)))) | |
1862 (t | |
1863 ;; If we can't kludge it simply, do it correctly | |
1864 (let ((mail-use-rfc822 t)) | |
1865 (rmail-make-in-reply-to-field from date message-id))))) | |
1866 | |
2687
37cca1d50b6a
(rmail-resend): Add `resent' attribute.
Richard M. Stallman <rms@gnu.org>
parents:
2571
diff
changeset
|
1867 (defun rmail-forward (resend) |
37cca1d50b6a
(rmail-resend): Add `resent' attribute.
Richard M. Stallman <rms@gnu.org>
parents:
2571
diff
changeset
|
1868 "Forward the current message to another user. |
37cca1d50b6a
(rmail-resend): Add `resent' attribute.
Richard M. Stallman <rms@gnu.org>
parents:
2571
diff
changeset
|
1869 With prefix argument, \"resend\" the message instead of forwarding it; |
37cca1d50b6a
(rmail-resend): Add `resent' attribute.
Richard M. Stallman <rms@gnu.org>
parents:
2571
diff
changeset
|
1870 see the documentation of `rmail-resend'." |
37cca1d50b6a
(rmail-resend): Add `resent' attribute.
Richard M. Stallman <rms@gnu.org>
parents:
2571
diff
changeset
|
1871 (interactive "P") |
37cca1d50b6a
(rmail-resend): Add `resent' attribute.
Richard M. Stallman <rms@gnu.org>
parents:
2571
diff
changeset
|
1872 (if resend |
37cca1d50b6a
(rmail-resend): Add `resent' attribute.
Richard M. Stallman <rms@gnu.org>
parents:
2571
diff
changeset
|
1873 (call-interactively 'rmail-resend) |
37cca1d50b6a
(rmail-resend): Add `resent' attribute.
Richard M. Stallman <rms@gnu.org>
parents:
2571
diff
changeset
|
1874 (let ((forward-buffer (current-buffer)) |
37cca1d50b6a
(rmail-resend): Add `resent' attribute.
Richard M. Stallman <rms@gnu.org>
parents:
2571
diff
changeset
|
1875 (subject (concat "[" |
37cca1d50b6a
(rmail-resend): Add `resent' attribute.
Richard M. Stallman <rms@gnu.org>
parents:
2571
diff
changeset
|
1876 (let ((from (or (mail-fetch-field "From") |
37cca1d50b6a
(rmail-resend): Add `resent' attribute.
Richard M. Stallman <rms@gnu.org>
parents:
2571
diff
changeset
|
1877 (mail-fetch-field ">From")))) |
37cca1d50b6a
(rmail-resend): Add `resent' attribute.
Richard M. Stallman <rms@gnu.org>
parents:
2571
diff
changeset
|
1878 (if from |
37cca1d50b6a
(rmail-resend): Add `resent' attribute.
Richard M. Stallman <rms@gnu.org>
parents:
2571
diff
changeset
|
1879 (concat (mail-strip-quoted-names from) ": ") |
37cca1d50b6a
(rmail-resend): Add `resent' attribute.
Richard M. Stallman <rms@gnu.org>
parents:
2571
diff
changeset
|
1880 "")) |
37cca1d50b6a
(rmail-resend): Add `resent' attribute.
Richard M. Stallman <rms@gnu.org>
parents:
2571
diff
changeset
|
1881 (or (mail-fetch-field "Subject") "") |
37cca1d50b6a
(rmail-resend): Add `resent' attribute.
Richard M. Stallman <rms@gnu.org>
parents:
2571
diff
changeset
|
1882 "]"))) |
4579
131a3edbd49f
(rmail-forward): Don't bind mail-signature, mail-setup-hook.
Richard M. Stallman <rms@gnu.org>
parents:
4457
diff
changeset
|
1883 ;; If only one window, use it for the mail buffer. |
131a3edbd49f
(rmail-forward): Don't bind mail-signature, mail-setup-hook.
Richard M. Stallman <rms@gnu.org>
parents:
4457
diff
changeset
|
1884 ;; Otherwise, use another window for the mail buffer |
131a3edbd49f
(rmail-forward): Don't bind mail-signature, mail-setup-hook.
Richard M. Stallman <rms@gnu.org>
parents:
4457
diff
changeset
|
1885 ;; so that the Rmail buffer remains visible |
131a3edbd49f
(rmail-forward): Don't bind mail-signature, mail-setup-hook.
Richard M. Stallman <rms@gnu.org>
parents:
4457
diff
changeset
|
1886 ;; and sending the mail will get back to it. |
131a3edbd49f
(rmail-forward): Don't bind mail-signature, mail-setup-hook.
Richard M. Stallman <rms@gnu.org>
parents:
4457
diff
changeset
|
1887 (if (funcall (if (and (not rmail-mail-new-frame) (one-window-p t)) |
131a3edbd49f
(rmail-forward): Don't bind mail-signature, mail-setup-hook.
Richard M. Stallman <rms@gnu.org>
parents:
4457
diff
changeset
|
1888 (function mail) |
131a3edbd49f
(rmail-forward): Don't bind mail-signature, mail-setup-hook.
Richard M. Stallman <rms@gnu.org>
parents:
4457
diff
changeset
|
1889 (function rmail-start-mail)) |
131a3edbd49f
(rmail-forward): Don't bind mail-signature, mail-setup-hook.
Richard M. Stallman <rms@gnu.org>
parents:
4457
diff
changeset
|
1890 nil nil subject nil nil nil |
131a3edbd49f
(rmail-forward): Don't bind mail-signature, mail-setup-hook.
Richard M. Stallman <rms@gnu.org>
parents:
4457
diff
changeset
|
1891 (list (list (function (lambda (buf msgnum) |
131a3edbd49f
(rmail-forward): Don't bind mail-signature, mail-setup-hook.
Richard M. Stallman <rms@gnu.org>
parents:
4457
diff
changeset
|
1892 (save-excursion |
131a3edbd49f
(rmail-forward): Don't bind mail-signature, mail-setup-hook.
Richard M. Stallman <rms@gnu.org>
parents:
4457
diff
changeset
|
1893 (set-buffer buf) |
131a3edbd49f
(rmail-forward): Don't bind mail-signature, mail-setup-hook.
Richard M. Stallman <rms@gnu.org>
parents:
4457
diff
changeset
|
1894 (rmail-set-attribute |
131a3edbd49f
(rmail-forward): Don't bind mail-signature, mail-setup-hook.
Richard M. Stallman <rms@gnu.org>
parents:
4457
diff
changeset
|
1895 "forwarded" t msgnum)))) |
131a3edbd49f
(rmail-forward): Don't bind mail-signature, mail-setup-hook.
Richard M. Stallman <rms@gnu.org>
parents:
4457
diff
changeset
|
1896 (current-buffer) |
131a3edbd49f
(rmail-forward): Don't bind mail-signature, mail-setup-hook.
Richard M. Stallman <rms@gnu.org>
parents:
4457
diff
changeset
|
1897 rmail-current-message))) |
4263
7c7fa71cfd6e
(rmail-last-rmail-file): Initialize to a file name.
Richard M. Stallman <rms@gnu.org>
parents:
4108
diff
changeset
|
1898 (save-excursion |
4724
04714985ce20
(rmail-forward): Insert the text right after the header separator.
Richard M. Stallman <rms@gnu.org>
parents:
4698
diff
changeset
|
1899 ;; Insert after header separator--before signature if any. |
4764
0e239209a6db
(rmail-convert-file): If the file is empty, don't convert it after
Brian Fox <bfox@gnu.org>
parents:
4724
diff
changeset
|
1900 (goto-char (point-min)) |
0e239209a6db
(rmail-convert-file): If the file is empty, don't convert it after
Brian Fox <bfox@gnu.org>
parents:
4724
diff
changeset
|
1901 (search-forward-regexp |
0e239209a6db
(rmail-convert-file): If the file is empty, don't convert it after
Brian Fox <bfox@gnu.org>
parents:
4724
diff
changeset
|
1902 (concat "^" (regexp-quote mail-header-separator))) |
4263
7c7fa71cfd6e
(rmail-last-rmail-file): Initialize to a file name.
Richard M. Stallman <rms@gnu.org>
parents:
4108
diff
changeset
|
1903 (forward-line 1) |
4579
131a3edbd49f
(rmail-forward): Don't bind mail-signature, mail-setup-hook.
Richard M. Stallman <rms@gnu.org>
parents:
4457
diff
changeset
|
1904 (insert-buffer forward-buffer)))))) |
270 | 1905 |
1906 (defun rmail-resend (address &optional from comment mail-alias-file) | |
1907 "Resend current message to ADDRESSES. | |
5274
89b71a85be3e
(rmail-quit): Expunge without updating summary.
Richard M. Stallman <rms@gnu.org>
parents:
5192
diff
changeset
|
1908 ADDRESSES should be a single address, a string consisting of several |
270 | 1909 addresses separated by commas, or a list of addresses. |
1910 | |
1911 Optional FROM is the address to resend the message from, and | |
1912 defaults to the username of the person redistributing the message. | |
1913 Optional COMMENT is a string that will be inserted as a comment in the | |
1914 resent message. | |
1915 Optional ALIAS-FILE is alternate aliases file to be used by sendmail, | |
1916 typically for purposes of moderating a list." | |
1917 (interactive "sResend to: ") | |
3484
bd26679f0db5
(rmail-resend): Require sendmail and mailalias.
Richard M. Stallman <rms@gnu.org>
parents:
3462
diff
changeset
|
1918 (require 'sendmail) |
bd26679f0db5
(rmail-resend): Require sendmail and mailalias.
Richard M. Stallman <rms@gnu.org>
parents:
3462
diff
changeset
|
1919 (require 'mailalias) |
270 | 1920 (if (not from) (setq from (user-login-name))) |
1921 (let ((tembuf (generate-new-buffer " sendmail temp")) | |
1922 (mail-header-separator "") | |
1923 (case-fold-search nil) | |
1924 (mailbuf (current-buffer))) | |
1925 (unwind-protect | |
1926 (save-excursion | |
1927 ;;>> Copy message into temp buffer | |
1928 (set-buffer tembuf) | |
1929 (insert-buffer-substring mailbuf) | |
1930 (goto-char (point-min)) | |
4457
acb5dda629d7
(rmail-resend): Delete any Sender field.
Richard M. Stallman <rms@gnu.org>
parents:
4340
diff
changeset
|
1931 ;; Delete any Sender field, since that's not specifyable. |
5274
89b71a85be3e
(rmail-quit): Expunge without updating summary.
Richard M. Stallman <rms@gnu.org>
parents:
5192
diff
changeset
|
1932 ; Only delete Sender fields in the actual header. |
89b71a85be3e
(rmail-quit): Expunge without updating summary.
Richard M. Stallman <rms@gnu.org>
parents:
5192
diff
changeset
|
1933 (re-search-forward "^$" nil 'move) |
89b71a85be3e
(rmail-quit): Expunge without updating summary.
Richard M. Stallman <rms@gnu.org>
parents:
5192
diff
changeset
|
1934 ; Using "while" here rather than "if" because some buggy mail |
89b71a85be3e
(rmail-quit): Expunge without updating summary.
Richard M. Stallman <rms@gnu.org>
parents:
5192
diff
changeset
|
1935 ; software may have inserted multiple Sender fields. |
89b71a85be3e
(rmail-quit): Expunge without updating summary.
Richard M. Stallman <rms@gnu.org>
parents:
5192
diff
changeset
|
1936 (while (re-search-backward "^Sender:" nil t) |
89b71a85be3e
(rmail-quit): Expunge without updating summary.
Richard M. Stallman <rms@gnu.org>
parents:
5192
diff
changeset
|
1937 (let (beg) |
89b71a85be3e
(rmail-quit): Expunge without updating summary.
Richard M. Stallman <rms@gnu.org>
parents:
5192
diff
changeset
|
1938 (setq beg (point)) |
89b71a85be3e
(rmail-quit): Expunge without updating summary.
Richard M. Stallman <rms@gnu.org>
parents:
5192
diff
changeset
|
1939 (forward-line 1) |
89b71a85be3e
(rmail-quit): Expunge without updating summary.
Richard M. Stallman <rms@gnu.org>
parents:
5192
diff
changeset
|
1940 (while (looking-at "[ \t]") |
89b71a85be3e
(rmail-quit): Expunge without updating summary.
Richard M. Stallman <rms@gnu.org>
parents:
5192
diff
changeset
|
1941 (forward-line 1)) |
89b71a85be3e
(rmail-quit): Expunge without updating summary.
Richard M. Stallman <rms@gnu.org>
parents:
5192
diff
changeset
|
1942 (delete-region beg (point)))) |
89b71a85be3e
(rmail-quit): Expunge without updating summary.
Richard M. Stallman <rms@gnu.org>
parents:
5192
diff
changeset
|
1943 ; Go back to the beginning of the buffer so the Resent- fields |
89b71a85be3e
(rmail-quit): Expunge without updating summary.
Richard M. Stallman <rms@gnu.org>
parents:
5192
diff
changeset
|
1944 ; are inserted there. |
89b71a85be3e
(rmail-quit): Expunge without updating summary.
Richard M. Stallman <rms@gnu.org>
parents:
5192
diff
changeset
|
1945 (goto-char (point-min)) |
270 | 1946 ;;>> Insert resent-from: |
1947 (insert "Resent-From: " from "\n") | |
4020
a35cd533fda4
(rmail-resend): Use RFC 822 style date in Resent-Date: line.
Richard M. Stallman <rms@gnu.org>
parents:
4010
diff
changeset
|
1948 (insert "Resent-Date: " (mail-rfc822-date) "\n") |
270 | 1949 ;;>> Insert resent-to: and bcc if need be. |
1950 (let ((before (point))) | |
4838
754b38c0e941
(rmail): Really don't get new mail if file name was given.
Richard M. Stallman <rms@gnu.org>
parents:
4819
diff
changeset
|
1951 (if mail-self-blind |
754b38c0e941
(rmail): Really don't get new mail if file name was given.
Richard M. Stallman <rms@gnu.org>
parents:
4819
diff
changeset
|
1952 (insert "Resent-Bcc: " (user-login-name) "\n")) |
270 | 1953 (insert "Resent-To: " (if (stringp address) |
1954 address | |
1955 (mapconcat 'identity address ",\n\t")) | |
1956 "\n") | |
1957 (expand-mail-aliases before (point))) | |
1958 ;;>> Set up comment, if any. | |
1959 (if (and (sequencep comment) (not (zerop (length comment)))) | |
1960 (let ((before (point)) | |
1961 after) | |
1962 (insert comment) | |
1963 (or (eolp) (insert "\n")) | |
1964 (setq after (point)) | |
1965 (goto-char before) | |
1966 (while (< (point) after) | |
1967 (insert "Resent-Comment: ") | |
1968 (forward-line 1)))) | |
1969 ;; Don't expand aliases in the destination fields | |
1970 ;; of the original message. | |
1971 (let (mail-aliases) | |
5470
b8e8802d2216
(rmail-resend): Use send-mail-function.
Richard M. Stallman <rms@gnu.org>
parents:
5466
diff
changeset
|
1972 (funcall send-mail-function))) |
2687
37cca1d50b6a
(rmail-resend): Add `resent' attribute.
Richard M. Stallman <rms@gnu.org>
parents:
2571
diff
changeset
|
1973 (kill-buffer tembuf)) |
37cca1d50b6a
(rmail-resend): Add `resent' attribute.
Richard M. Stallman <rms@gnu.org>
parents:
2571
diff
changeset
|
1974 (rmail-set-attribute "resent" t rmail-current-message))) |
270 | 1975 |
1267
1e1a54ebb29b
(mail-unsent-separator): Add another alternative.
Richard M. Stallman <rms@gnu.org>
parents:
1165
diff
changeset
|
1976 (defvar mail-unsent-separator |
1370
c017b62c8073
(mail-unsent-separator): Allow "original message" as alternative.
Richard M. Stallman <rms@gnu.org>
parents:
1360
diff
changeset
|
1977 (concat "^ *---+ +Unsent message follows +---+ *$\\|" |
c017b62c8073
(mail-unsent-separator): Allow "original message" as alternative.
Richard M. Stallman <rms@gnu.org>
parents:
1360
diff
changeset
|
1978 "^ *---+ +Returned message +---+ *$\\|" |
1372
e839dc00fc2e
(mail-unsent-separator): Handle "Message text follows".
Richard M. Stallman <rms@gnu.org>
parents:
1370
diff
changeset
|
1979 "^ *---+ +Original message +---+ *$\\|" |
1757
7e85913523ef
(mail-unsent-separator): Add `-- begin message --'.
Richard M. Stallman <rms@gnu.org>
parents:
1704
diff
changeset
|
1980 "^ *--+ +begin message +--+ *$\\|" |
4838
754b38c0e941
(rmail): Really don't get new mail if file name was given.
Richard M. Stallman <rms@gnu.org>
parents:
4819
diff
changeset
|
1981 "^ *---+ +Original message follows +---+ *$\\|" |
1372
e839dc00fc2e
(mail-unsent-separator): Handle "Message text follows".
Richard M. Stallman <rms@gnu.org>
parents:
1370
diff
changeset
|
1982 "^|? *---+ +Message text follows: +---+ *|?$")) |
270 | 1983 |
1984 (defun rmail-retry-failure () | |
1985 "Edit a mail message which is based on the contents of the current message. | |
1986 For a message rejected by the mail system, extract the interesting headers and | |
5274
89b71a85be3e
(rmail-quit): Expunge without updating summary.
Richard M. Stallman <rms@gnu.org>
parents:
5192
diff
changeset
|
1987 the body of the original message." |
270 | 1988 (interactive) |
1989 (require 'mail-utils) | |
1990 (let (to subj irp2 cc orig-message) | |
1991 (save-excursion | |
1992 ;; Narrow down to just the quoted original message | |
1993 (rmail-beginning-of-message) | |
1370
c017b62c8073
(mail-unsent-separator): Allow "original message" as alternative.
Richard M. Stallman <rms@gnu.org>
parents:
1360
diff
changeset
|
1994 (let ((case-fold-search t)) |
c017b62c8073
(mail-unsent-separator): Allow "original message" as alternative.
Richard M. Stallman <rms@gnu.org>
parents:
1360
diff
changeset
|
1995 (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
|
1996 (error "Cannot parse this as a failure message"))) |
270 | 1997 (save-restriction |
1998 (narrow-to-region (point) (point-max)) | |
1999 ;; Now mail-fetch-field will get from headers of the original message, | |
2000 ;; not from the headers of the rejection. | |
2001 (setq to (mail-fetch-field "To") | |
2002 subj (mail-fetch-field "Subject") | |
2003 irp2 (mail-fetch-field "In-reply-to") | |
2004 cc (mail-fetch-field "Cc")) | |
2005 ;; Get the entire text (not headers) of the original message. | |
2006 (setq orig-message | |
2007 (buffer-substring | |
2008 (progn (search-forward "\n\n") (point)) | |
2009 (point-max))))) | |
2010 ;; 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
|
2011 ;; Turn off the usual actions for initializing the message body |
e33f6475229a
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1112
diff
changeset
|
2012 ;; because we want to get only the text from the failure message. |
4844
25d94807689e
(rmail-retry-setup-hook): New hook variable.
Richard M. Stallman <rms@gnu.org>
parents:
4838
diff
changeset
|
2013 (let (mail-signature |
25d94807689e
(rmail-retry-setup-hook): New hook variable.
Richard M. Stallman <rms@gnu.org>
parents:
4838
diff
changeset
|
2014 (mail-setup-hook rmail-retry-setup-hook)) |
4108
e4fbcd480455
(rmail-mail-new-frame): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4071
diff
changeset
|
2015 (if (rmail-start-mail nil to subj irp2 cc (current-buffer)) |
1135
e33f6475229a
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1112
diff
changeset
|
2016 ;; Insert original text as initial text of new draft message. |
e33f6475229a
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1112
diff
changeset
|
2017 (progn |
e33f6475229a
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1112
diff
changeset
|
2018 (goto-char (point-max)) |
e33f6475229a
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1112
diff
changeset
|
2019 (insert orig-message) |
e33f6475229a
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1112
diff
changeset
|
2020 (goto-char (point-min)) |
e33f6475229a
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
1112
diff
changeset
|
2021 (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
|
2022 |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
2023 (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
|
2024 "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
|
2025 (interactive) |
5586
fdf1d3924296
(rmail-bury): Rename local rmail-buffer to buffer-to-bury.
Richard M. Stallman <rms@gnu.org>
parents:
5470
diff
changeset
|
2026 ;; This let var was called rmail-buffer, but that interfered |
fdf1d3924296
(rmail-bury): Rename local rmail-buffer to buffer-to-bury.
Richard M. Stallman <rms@gnu.org>
parents:
5470
diff
changeset
|
2027 ;; with the buffer-local var used in summary buffers. |
fdf1d3924296
(rmail-bury): Rename local rmail-buffer to buffer-to-bury.
Richard M. Stallman <rms@gnu.org>
parents:
5470
diff
changeset
|
2028 (let ((buffer-to-bury (current-buffer))) |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
2029 (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
|
2030 (let (window) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
2031 (while (setq window (get-buffer-window rmail-summary-buffer)) |
3083
59b8b6ac30e0
(rmail-bury): Fix call to set-window-buffer.
Richard M. Stallman <rms@gnu.org>
parents:
2700
diff
changeset
|
2032 (set-window-buffer window (other-buffer rmail-summary-buffer))) |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
2033 (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
|
2034 (switch-to-buffer (other-buffer (current-buffer))) |
5586
fdf1d3924296
(rmail-bury): Rename local rmail-buffer to buffer-to-bury.
Richard M. Stallman <rms@gnu.org>
parents:
5470
diff
changeset
|
2035 (bury-buffer buffer-to-bury))) |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
2036 |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
2037 (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
|
2038 "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
|
2039 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
|
2040 (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
|
2041 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
|
2042 |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
2043 (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
|
2044 "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
|
2045 (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
|
2046 |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
2047 (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
|
2048 "*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
|
2049 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
|
2050 |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
2051 ;; 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
|
2052 (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
|
2053 (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
|
2054 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
|
2055 (display-buffer rmail-summary-buffer))) |
270 | 2056 |
2057 ;;;; *** Rmail Specify Inbox Files *** | |
2058 | |
2059 (autoload 'set-rmail-inbox-list "rmailmsc" | |
2060 "Set the inbox list of the current RMAIL file to FILE-NAME. | |
2061 This may be a list of file names separated by commas. | |
2062 If FILE-NAME is empty, remove any inbox list." | |
2063 t) | |
2064 | |
2065 ;;;; *** Rmail Commands for Labels *** | |
2066 | |
2067 (autoload 'rmail-add-label "rmailkwd" | |
2068 "Add LABEL to labels associated with current RMAIL message. | |
2069 Completion is performed over known labels when reading." | |
2070 t) | |
2071 | |
2072 (autoload 'rmail-kill-label "rmailkwd" | |
2073 "Remove LABEL from labels associated with current RMAIL message. | |
2074 Completion is performed over known labels when reading." | |
2075 t) | |
2076 | |
2077 (autoload 'rmail-next-labeled-message "rmailkwd" | |
2078 "Show next message with LABEL. Defaults to last label used. | |
2079 With prefix argument N moves forward N messages with this label." | |
2080 t) | |
2081 | |
2082 (autoload 'rmail-previous-labeled-message "rmailkwd" | |
2083 "Show previous message with LABEL. Defaults to last label used. | |
2084 With prefix argument N moves backward N messages with this label." | |
2085 t) | |
2086 | |
2076
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
2087 (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
|
2088 "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
|
2089 t) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
2090 |
270 | 2091 ;;;; *** Rmail Edit Mode *** |
2092 | |
2093 (autoload 'rmail-edit-current-message "rmailedit" | |
2094 "Edit the contents of the current message" | |
2095 t) | |
3877
da9b565f9878
Add autoloads for rmailsort commands.
Richard M. Stallman <rms@gnu.org>
parents:
3864
diff
changeset
|
2096 |
da9b565f9878
Add autoloads for rmailsort commands.
Richard M. Stallman <rms@gnu.org>
parents:
3864
diff
changeset
|
2097 ;;;; *** Rmail Sorting *** |
da9b565f9878
Add autoloads for rmailsort commands.
Richard M. Stallman <rms@gnu.org>
parents:
3864
diff
changeset
|
2098 |
da9b565f9878
Add autoloads for rmailsort commands.
Richard M. Stallman <rms@gnu.org>
parents:
3864
diff
changeset
|
2099 (autoload 'rmail-sort-by-date "rmailsort" |
da9b565f9878
Add autoloads for rmailsort commands.
Richard M. Stallman <rms@gnu.org>
parents:
3864
diff
changeset
|
2100 "Sort messages of current Rmail file by date. |
da9b565f9878
Add autoloads for rmailsort commands.
Richard M. Stallman <rms@gnu.org>
parents:
3864
diff
changeset
|
2101 If prefix argument REVERSE is non-nil, sort them in reverse order." t) |
da9b565f9878
Add autoloads for rmailsort commands.
Richard M. Stallman <rms@gnu.org>
parents:
3864
diff
changeset
|
2102 |
da9b565f9878
Add autoloads for rmailsort commands.
Richard M. Stallman <rms@gnu.org>
parents:
3864
diff
changeset
|
2103 (autoload 'rmail-sort-by-subject "rmailsort" |
da9b565f9878
Add autoloads for rmailsort commands.
Richard M. Stallman <rms@gnu.org>
parents:
3864
diff
changeset
|
2104 "Sort messages of current Rmail file by subject. |
da9b565f9878
Add autoloads for rmailsort commands.
Richard M. Stallman <rms@gnu.org>
parents:
3864
diff
changeset
|
2105 If prefix argument REVERSE is non-nil, sort them in reverse order." t) |
da9b565f9878
Add autoloads for rmailsort commands.
Richard M. Stallman <rms@gnu.org>
parents:
3864
diff
changeset
|
2106 |
da9b565f9878
Add autoloads for rmailsort commands.
Richard M. Stallman <rms@gnu.org>
parents:
3864
diff
changeset
|
2107 (autoload 'rmail-sort-by-author "rmailsort" |
da9b565f9878
Add autoloads for rmailsort commands.
Richard M. Stallman <rms@gnu.org>
parents:
3864
diff
changeset
|
2108 "Sort messages of current Rmail file by author. |
da9b565f9878
Add autoloads for rmailsort commands.
Richard M. Stallman <rms@gnu.org>
parents:
3864
diff
changeset
|
2109 If prefix argument REVERSE is non-nil, sort them in reverse order." t) |
da9b565f9878
Add autoloads for rmailsort commands.
Richard M. Stallman <rms@gnu.org>
parents:
3864
diff
changeset
|
2110 |
da9b565f9878
Add autoloads for rmailsort commands.
Richard M. Stallman <rms@gnu.org>
parents:
3864
diff
changeset
|
2111 (autoload 'rmail-sort-by-recipient "rmailsort" |
da9b565f9878
Add autoloads for rmailsort commands.
Richard M. Stallman <rms@gnu.org>
parents:
3864
diff
changeset
|
2112 "Sort messages of current Rmail file by recipient. |
da9b565f9878
Add autoloads for rmailsort commands.
Richard M. Stallman <rms@gnu.org>
parents:
3864
diff
changeset
|
2113 If prefix argument REVERSE is non-nil, sort them in reverse order." t) |
da9b565f9878
Add autoloads for rmailsort commands.
Richard M. Stallman <rms@gnu.org>
parents:
3864
diff
changeset
|
2114 |
da9b565f9878
Add autoloads for rmailsort commands.
Richard M. Stallman <rms@gnu.org>
parents:
3864
diff
changeset
|
2115 (autoload 'rmail-sort-by-correspondent "rmailsort" |
da9b565f9878
Add autoloads for rmailsort commands.
Richard M. Stallman <rms@gnu.org>
parents:
3864
diff
changeset
|
2116 "Sort messages of current Rmail file by other correspondent. |
da9b565f9878
Add autoloads for rmailsort commands.
Richard M. Stallman <rms@gnu.org>
parents:
3864
diff
changeset
|
2117 If prefix argument REVERSE is non-nil, sort them in reverse order." t) |
da9b565f9878
Add autoloads for rmailsort commands.
Richard M. Stallman <rms@gnu.org>
parents:
3864
diff
changeset
|
2118 |
da9b565f9878
Add autoloads for rmailsort commands.
Richard M. Stallman <rms@gnu.org>
parents:
3864
diff
changeset
|
2119 (autoload 'rmail-sort-by-lines "rmailsort" |
da9b565f9878
Add autoloads for rmailsort commands.
Richard M. Stallman <rms@gnu.org>
parents:
3864
diff
changeset
|
2120 "Sort messages of current Rmail file by number of lines. |
da9b565f9878
Add autoloads for rmailsort commands.
Richard M. Stallman <rms@gnu.org>
parents:
3864
diff
changeset
|
2121 If prefix argument REVERSE is non-nil, sort them in reverse order." t) |
270 | 2122 |
2123 ;;;; *** Rmail Summary Mode *** | |
2124 | |
2125 (autoload 'rmail-summary "rmailsum" | |
2126 "Display a summary of all messages, one line per message." | |
2127 t) | |
2128 | |
2129 (autoload 'rmail-summary-by-labels "rmailsum" | |
2130 "Display a summary of all messages with one or more LABELS. | |
2131 LABELS should be a string containing the desired labels, separated by commas." | |
2132 t) | |
2133 | |
2134 (autoload 'rmail-summary-by-recipients "rmailsum" | |
2135 "Display a summary of all messages with the given RECIPIENTS. | |
2136 Normally checks the To, From and Cc fields of headers; but if PRIMARY-ONLY | |
2137 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
|
2138 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
|
2139 t) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
2140 |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
2141 (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
|
2142 "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
|
2143 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
|
2144 \(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
|
2145 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
|
2146 t) |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
2147 |
5140299129c3
(rmail-delete-forward): Go to summary buf to change D mark.
Richard M. Stallman <rms@gnu.org>
parents:
2006
diff
changeset
|
2148 (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
|
2149 "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
|
2150 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
|
2151 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
|
2152 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
|
2153 SUBJECT is a string of regexps separated by commas." |
270 | 2154 t) |
2155 | |
2156 ;;;; *** Rmail output messages to files *** | |
2157 | |
2158 (autoload 'rmail-output-to-rmail-file "rmailout" | |
2159 "Append the current message to an Rmail file named FILE-NAME. | |
2160 If the file does not exist, ask if it should be created. | |
2161 If file is being visited, the message is appended to the Emacs | |
2162 buffer visiting that file." | |
2163 t) | |
2164 | |
2165 (autoload 'rmail-output "rmailout" | |
2166 "Append this message to Unix mail file named FILE-NAME." | |
2167 t) | |
2168 | |
2169 ;;;; *** Rmail undigestification *** | |
2170 | |
2171 (autoload 'undigestify-rmail-message "undigest" | |
2172 "Break up a digest message into its constituent messages. | |
2173 Leaves original message, deleted, before the undigestified messages." | |
2174 t) | |
584 | 2175 |
2176 (provide 'rmail) | |
2177 | |
658
7cbd4fcd8b0f
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
621
diff
changeset
|
2178 ;;; rmail.el ends here |