0
|
1 ;;; mh-e.el --- GNU Emacs interface to the MH mail system
|
|
2
|
|
3 ;;; Copyright (C) 1985,86,87,88,90,92,93,94,95 Free Software Foundation, Inc.
|
|
4
|
|
5 (defconst mh-e-time-stamp "Time-stamp: <95/10/30 19:14:06 gildea>")
|
|
6 (defconst mh-e-version "5.0.2"
|
|
7 "Version numbers of this version of mh-e.")
|
|
8
|
|
9 ;; Maintainer: Stephen Gildea <gildea@lcs.mit.edu>
|
|
10 ;; Version: 5.0.2
|
|
11 ;; Keywords: mail
|
|
12 ;; Bug-reports: include `M-x mh-version' output in any correspondence
|
|
13
|
|
14 ;; This file is part of mh-e, part of GNU Emacs.
|
|
15
|
|
16 ;; GNU Emacs is free software; you can redistribute it and/or modify
|
|
17 ;; it under the terms of the GNU General Public License as published by
|
|
18 ;; the Free Software Foundation; either version 2, or (at your option)
|
|
19 ;; any later version.
|
|
20
|
|
21 ;; GNU Emacs is distributed in the hope that it will be useful,
|
|
22 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
23 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
24 ;; GNU General Public License for more details.
|
|
25
|
|
26 ;; You should have received a copy of the GNU General Public License
|
|
27 ;; along with GNU Emacs; see the file COPYING. If not, write to
|
|
28 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
29
|
|
30 ;;; Commentary:
|
|
31
|
|
32 ;;; HOW TO USE:
|
|
33 ;;; M-x mh-rmail to read mail. Type C-h m there for a list of commands.
|
|
34 ;;; C-u M-x mh-rmail to visit any folder.
|
|
35 ;;; M-x mh-smail to send mail. From within the mail reader, "m" works, too.
|
|
36
|
|
37 ;;; MH (Message Handler) is a powerful mail reader. The MH newsgroup
|
|
38 ;;; is comp.mail.mh; the mailing list is mh-users@ics.uci.edu (send to
|
|
39 ;;; mh-users-request to be added). See the monthly Frequently Asked
|
|
40 ;;; Questions posting there for information on getting MH and mh-e.
|
|
41
|
|
42 ;;; mh-e is an Emacs interface to the MH mail system.
|
|
43 ;;; The mailing list mh-e@x.org is for discussion of mh-e and
|
|
44 ;;; announcements of new versions. Send a "subscribe" message to
|
|
45 ;;; mh-e-request@x.org to be added. Do not report bugs here; mail
|
|
46 ;;; them directly to the author (see top of mh-e.el source).
|
|
47 ;;; Include the output of M-x mh-version in any bug report.
|
|
48
|
|
49 ;;; mh-e works with GNU Emacs 18 or 19, and MH 6.
|
|
50
|
|
51 ;;; NB. MH must have been compiled with the MHE compiler flag or several
|
|
52 ;;; features necessary for mh-e will be missing from MH commands, specifically
|
|
53 ;;; the -build switch to repl and forw.
|
|
54
|
|
55 ;;; Your .emacs might benefit from these bindings:
|
|
56 ;;; (global-set-key "\C-cr" 'mh-rmail)
|
|
57 ;;; (global-set-key "\C-xm" 'mh-smail)
|
|
58 ;;; (global-set-key "\C-x4m" 'mh-smail-other-window)
|
|
59
|
|
60 ;;; Change Log:
|
|
61
|
|
62 ;;; Original version for Gosling emacs by Brian Reid, Stanford, 1982.
|
|
63 ;;; Modified by James Larus, BBN, July 1984 and UCB, 1984 & 1985.
|
|
64 ;;; Rewritten for GNU Emacs, James Larus 1985. larus@ginger.berkeley.edu
|
|
65 ;;; Modified by Stephen Gildea 1988. gildea@lcs.mit.edu
|
134
|
66 (defconst mh-e-RCS-id "$Id: mh-e.el,v 1.2 1997/04/19 23:21:00 steve Exp $")
|
0
|
67
|
|
68 ;;; Code:
|
|
69
|
|
70 (provide 'mh-e)
|
|
71 (require 'mh-utils)
|
|
72
|
|
73
|
|
74 ;;; Hooks:
|
|
75
|
134
|
76 (defgroup mh nil
|
|
77 "Emacs interface to the MH mail system"
|
|
78 :group 'mail)
|
0
|
79
|
134
|
80 (defgroup mh-hook nil
|
|
81 "Hooks to mh-e mode"
|
|
82 :prefix "mh-"
|
|
83 :group 'mh)
|
|
84
|
0
|
85
|
134
|
86 (defcustom mh-folder-mode-hook nil
|
|
87 "Invoked in MH-Folder mode on a new folder."
|
|
88 :type 'hook
|
|
89 :group 'mh-hook)
|
0
|
90
|
134
|
91 (defcustom mh-inc-folder-hook nil
|
|
92 "Invoked by \\<mh-folder-mode-map>`\\[mh-inc-folder]' after incorporating mail into a folder."
|
|
93 :type 'hook
|
|
94 :group 'mh-hook)
|
|
95
|
|
96 (defcustom mh-show-hook nil
|
|
97 "Invoked after \\<mh-folder-mode-map>`\\[mh-show]' shows a message."
|
|
98 :type 'hook
|
|
99 :group 'mh-hook)
|
0
|
100
|
134
|
101 (defcustom mh-show-mode-hook nil
|
|
102 "Invoked in MH-Show mode on each message."
|
|
103 :type 'hook
|
|
104 :group 'mh-hook)
|
0
|
105
|
134
|
106 (defcustom mh-delete-msg-hook nil
|
|
107 "Invoked after marking each message for deletion."
|
|
108 :type 'hook
|
|
109 :group 'mh-hook)
|
0
|
110
|
134
|
111 (defcustom mh-refile-msg-hook nil
|
|
112 "Invoked after marking each message for refiling."
|
|
113 :type 'hook
|
|
114 :group 'mh-hook)
|
0
|
115
|
134
|
116 (defcustom mh-before-quit-hook nil
|
|
117 "Invoked by \\<mh-folder-mode-map>`\\[mh-quit]' before quitting mh-e. See also mh-quit-hook."
|
|
118 :type 'hook
|
|
119 :group 'mh-hook)
|
|
120
|
|
121 (defcustom mh-quit-hook nil
|
|
122 "Invoked after \\<mh-folder-mode-map>`\\[mh-quit]' quits mh-e. See also mh-before-quit-hook."
|
|
123 :type 'hook
|
|
124 :group 'mh-hook)
|
0
|
125
|
|
126
|
|
127
|
|
128 ;;; Personal preferences:
|
|
129
|
134
|
130 (defcustom mh-lpr-command-format "lpr -J '%s'"
|
0
|
131 "*Format for Unix command that prints a message.
|
|
132 The string should be a Unix command line, with the string '%s' where
|
|
133 the job's name (folder and message number) should appear. The formatted
|
134
|
134 message text is piped to this command when you type \\<mh-folder-mode-map>`\\[mh-print-msg]'."
|
|
135 :type 'string
|
|
136 :group 'mh)
|
0
|
137
|
134
|
138 (defcustom mh-scan-prog "scan"
|
0
|
139 "*Program to run to generate one-line-per-message listing of a folder.
|
|
140 Normally \"scan\" or a file name linked to scan. This file is searched
|
|
141 for relative to the mh-progs directory unless it is an absolute pathname.
|
134
|
142 Automatically becomes buffer-local when set in any fashion."
|
|
143 :type 'string
|
|
144 :group 'mh)
|
0
|
145 (make-variable-buffer-local 'mh-scan-prog)
|
|
146
|
134
|
147 (defcustom mh-inc-prog "inc"
|
0
|
148 "*Program to run to incorporate new mail into a folder.
|
|
149 Normally \"inc\". This file is searched for relative to
|
134
|
150 the mh-progs directory unless it is an absolute pathname."
|
|
151 :type 'string
|
|
152 :group 'mh)
|
0
|
153
|
134
|
154 (defcustom mh-print-background nil
|
0
|
155 "*Print messages in the background if non-nil.
|
|
156 WARNING: do not delete the messages until printing is finished;
|
134
|
157 otherwise, your output may be truncated."
|
|
158 :type 'boolean
|
|
159 :group 'mh)
|
0
|
160
|
134
|
161 (defcustom mh-recenter-summary-p nil
|
|
162 "*Recenter summary window when the show window is toggled off if non-nil."
|
|
163 :type 'boolean
|
|
164 :group 'mh)
|
0
|
165
|
134
|
166 (defcustom mh-do-not-confirm nil
|
0
|
167 "*Non-nil means do not prompt for confirmation before some mh-e commands.
|
134
|
168 Affects non-recoverable commands such as mh-kill-folder and mh-undo-folder."
|
|
169 :type 'boolean
|
|
170 :group 'mh)
|
0
|
171
|
134
|
172 (defcustom mh-store-default-directory nil
|
0
|
173 "*Last directory used by \\[mh-store-msg]; default for next store.
|
134
|
174 A directory name string, or nil to use current directory."
|
|
175 :type '(choice (const :tag "Current" nil)
|
|
176 directory)
|
|
177 :group 'mh)
|
0
|
178
|
|
179 ;;; Parameterize mh-e to work with different scan formats. The defaults work
|
|
180 ;;; with the standard MH scan listings, in which the first 4 characters on
|
|
181 ;;; the line are the message number, followed by two places for notations.
|
|
182
|
|
183 (defvar mh-good-msg-regexp "^....[^D^]"
|
|
184 "Regexp specifiying the scan lines that are 'good' messages.")
|
|
185
|
|
186 (defvar mh-deleted-msg-regexp "^....D"
|
|
187 "Regexp matching scan lines of deleted messages.")
|
|
188
|
|
189 (defvar mh-refiled-msg-regexp "^....\\^"
|
|
190 "Regexp matching scan lines of refiled messages.")
|
|
191
|
|
192 (defvar mh-valid-scan-line "^ *[0-9]"
|
|
193 "Regexp matching scan lines for messages (not error messages).")
|
|
194
|
|
195 (defvar mh-cur-scan-msg-regexp "^....\\+"
|
|
196 "Regexp matching scan line for the cur message.")
|
|
197
|
|
198 (defvar mh-note-deleted "D"
|
|
199 "String whose first character is used to notate deleted messages.")
|
|
200
|
|
201 (defvar mh-note-refiled "^"
|
|
202 "String whose first character is used to notate refiled messages.")
|
|
203
|
|
204 (defvar mh-note-cur "+"
|
|
205 "String whose first character is used to notate the current message.")
|
|
206
|
|
207 (defvar mh-partial-folder-mode-line-annotation "select"
|
|
208 "Annotation when displaying part of a folder.
|
|
209 The string is displayed after the folder's name. NIL for no annotation.")
|
|
210
|
|
211
|
|
212 ;;; Internal variables:
|
|
213
|
|
214 (defvar mh-last-destination nil) ;Destination of last refile or write command.
|
|
215
|
|
216 (defvar mh-folder-mode-map (make-keymap)
|
|
217 "Keymap for MH folders.")
|
|
218
|
|
219 (defvar mh-delete-list nil) ;List of msg numbers to delete.
|
|
220
|
|
221 (defvar mh-refile-list nil) ;List of folder names in mh-seq-list.
|
|
222
|
|
223 (defvar mh-next-direction 'forward) ;Direction to move to next message.
|
|
224
|
|
225 (defvar mh-narrowed-to-seq nil) ;Sequence display is narrowed to or nil if not narrowed.
|
|
226
|
|
227 (defvar mh-first-msg-num nil) ;Number of first msg in buffer.
|
|
228
|
|
229 (defvar mh-last-msg-num nil) ;Number of last msg in buffer.
|
|
230
|
|
231 (defvar mh-mode-line-annotation nil) ;Indiction this is not the full folder.
|
|
232
|
|
233 ;;; Macros and generic functions:
|
|
234
|
|
235 (defun mh-mapc (func list)
|
|
236 (while list
|
|
237 (funcall func (car list))
|
|
238 (setq list (cdr list))))
|
|
239
|
|
240
|
|
241
|
|
242 ;;; Entry points:
|
|
243
|
|
244 ;;;###autoload
|
|
245 (defun mh-rmail (&optional arg)
|
|
246 "Inc(orporate) new mail with MH, or, with arg, scan an MH mail folder.
|
|
247 This function is an entry point to mh-e, the Emacs front end
|
|
248 to the MH mail system."
|
|
249 (interactive "P")
|
|
250 (mh-find-path)
|
|
251 (if arg
|
|
252 (call-interactively 'mh-visit-folder)
|
|
253 (mh-inc-folder)))
|
|
254
|
|
255
|
|
256 ;;; mh-smail and mh-smail-other-window have been moved to the new file
|
|
257 ;;; mh-comp.el, but Emacs 18 still looks for them here, so provide a
|
|
258 ;;; definition here, too, for a while.
|
|
259
|
|
260 (defun mh-smail ()
|
|
261 "Compose and send mail with the MH mail system.
|
|
262 This function is an entry point to mh-e, the Emacs front end
|
|
263 to the MH mail system."
|
|
264 (interactive)
|
|
265 (mh-find-path)
|
|
266 (require 'mh-comp)
|
|
267 (call-interactively 'mh-send))
|
|
268
|
|
269
|
|
270 (defun mh-smail-other-window ()
|
|
271 "Compose and send mail in other window with the MH mail system.
|
|
272 This function is an entry point to mh-e, the Emacs front end
|
|
273 to the MH mail system."
|
|
274 (interactive)
|
|
275 (mh-find-path)
|
|
276 (require 'mh-comp)
|
|
277 (call-interactively 'mh-send-other-window))
|
|
278
|
|
279
|
|
280
|
|
281 ;;; User executable mh-e commands:
|
|
282
|
|
283
|
|
284 (defun mh-delete-msg (msg-or-seq)
|
|
285 "Mark the specified MESSAGE(s) for subsequent deletion and move to the next.
|
|
286 Default is the displayed message. If optional prefix argument is
|
|
287 given then prompt for the message sequence."
|
|
288 (interactive (list (if current-prefix-arg
|
|
289 (mh-read-seq-default "Delete" t)
|
|
290 (mh-get-msg-num t))))
|
|
291 (mh-delete-msg-no-motion msg-or-seq)
|
|
292 (mh-next-msg))
|
|
293
|
|
294
|
|
295 (defun mh-delete-msg-no-motion (msg-or-seq)
|
|
296 "Mark the specified MESSAGE(s) for subsequent deletion.
|
|
297 Default is the displayed message. If optional prefix argument is
|
|
298 provided, then prompt for the message sequence."
|
|
299 (interactive (list (if current-prefix-arg
|
|
300 (mh-read-seq-default "Delete" t)
|
|
301 (mh-get-msg-num t))))
|
|
302 (if (numberp msg-or-seq)
|
|
303 (mh-delete-a-msg msg-or-seq)
|
|
304 (mh-map-to-seq-msgs 'mh-delete-a-msg msg-or-seq)))
|
|
305
|
|
306
|
|
307 (defun mh-execute-commands ()
|
|
308 "Process outstanding delete and refile requests."
|
|
309 (interactive)
|
|
310 (if mh-narrowed-to-seq (mh-widen))
|
|
311 (mh-process-commands mh-current-folder)
|
|
312 (mh-set-scan-mode)
|
|
313 (mh-goto-cur-msg) ; after mh-set-scan-mode for efficiency
|
|
314 (mh-make-folder-mode-line)
|
|
315 t) ; return t for [local-]write-file-hooks
|
|
316
|
|
317
|
|
318 (defun mh-first-msg ()
|
|
319 "Move to the first message."
|
|
320 (interactive)
|
|
321 (goto-char (point-min))
|
|
322 (while (and (not (eobp)) (not (looking-at mh-valid-scan-line)))
|
|
323 (forward-line 1)))
|
|
324
|
|
325
|
|
326 (defun mh-header-display ()
|
|
327 "Show the current message with all its headers.
|
|
328 Displays headers that might have been suppressed by setting the
|
|
329 variables `mh-clean-message-header' or `mhl-formfile', or by the fallback
|
|
330 behavior of scrolling uninteresting headers off the top of the window.
|
|
331 Type \"\\[mh-show]\" to show the message normally again."
|
|
332 (interactive)
|
|
333 (and (not mh-showing-with-headers)
|
|
334 (or mhl-formfile mh-clean-message-header)
|
|
335 (mh-invalidate-show-buffer))
|
|
336 (let ((mhl-formfile nil)
|
|
337 (mh-clean-message-header nil))
|
|
338 (mh-show-msg nil)
|
|
339 (mh-in-show-buffer (mh-show-buffer)
|
|
340 (goto-char (point-min))
|
|
341 (mh-recenter 0))
|
|
342 (setq mh-showing-with-headers t)))
|
|
343
|
|
344
|
|
345 (defun mh-inc-folder (&optional maildrop-name)
|
|
346 "Inc(orporate)s new mail into the Inbox folder.
|
|
347 Optional prefix argument specifies an alternate maildrop from the default.
|
|
348 If the prefix argument is given, incorporates mail into the current
|
|
349 folder, otherwise uses the folder named by `mh-inbox'.
|
|
350 Runs `mh-inc-folder-hook' after incorporating new mail.
|
|
351 Do not call this function from outside mh-e; use \\[mh-rmail] instead."
|
|
352 (interactive (list (if current-prefix-arg
|
|
353 (expand-file-name
|
|
354 (read-file-name "inc mail from file: "
|
|
355 mh-user-path)))))
|
|
356 (let ((config (current-window-configuration)))
|
|
357 (if (not maildrop-name)
|
|
358 (cond ((not (get-buffer mh-inbox))
|
|
359 (mh-make-folder mh-inbox)
|
|
360 (setq mh-previous-window-config config))
|
|
361 ((not (eq (current-buffer) (get-buffer mh-inbox)))
|
|
362 (switch-to-buffer mh-inbox)
|
|
363 (setq mh-previous-window-config config)))))
|
|
364 (mh-get-new-mail maildrop-name)
|
|
365 (run-hooks 'mh-inc-folder-hook))
|
|
366
|
|
367
|
|
368 (defun mh-last-msg ()
|
|
369 "Move to the last message."
|
|
370 (interactive)
|
|
371 (goto-char (point-max))
|
|
372 (while (and (not (bobp)) (looking-at "^$"))
|
|
373 (forward-line -1)))
|
|
374
|
|
375
|
|
376 (defun mh-next-undeleted-msg (&optional arg)
|
|
377 "Move to the NTH next undeleted message in window."
|
|
378 (interactive "p")
|
|
379 (setq mh-next-direction 'forward)
|
|
380 (forward-line 1)
|
|
381 (cond ((re-search-forward mh-good-msg-regexp nil 0 arg)
|
|
382 (beginning-of-line)
|
|
383 (mh-maybe-show))
|
|
384 (t
|
|
385 (forward-line -1)
|
|
386 (if (get-buffer mh-show-buffer)
|
|
387 (delete-windows-on mh-show-buffer)))))
|
|
388
|
|
389
|
|
390 (defun mh-refile-msg (msg-or-seq folder)
|
|
391 "Refile MESSAGE(s) (default: displayed message) into FOLDER.
|
|
392 If optional prefix argument provided, then prompt for message sequence."
|
|
393 (interactive
|
|
394 (list (if current-prefix-arg
|
|
395 (mh-read-seq-default "Refile" t)
|
|
396 (mh-get-msg-num t))
|
|
397 (intern
|
|
398 (mh-prompt-for-folder
|
|
399 "Destination"
|
|
400 (or (and mh-default-folder-for-message-function
|
|
401 (let ((refile-file (mh-msg-filename (mh-get-msg-num t))))
|
|
402 (save-excursion
|
|
403 (set-buffer (get-buffer-create mh-temp-buffer))
|
|
404 (erase-buffer)
|
|
405 (insert-file-contents refile-file)
|
|
406 (let ((buffer-file-name refile-file))
|
|
407 (funcall mh-default-folder-for-message-function)))))
|
|
408 (and (eq 'refile (car mh-last-destination))
|
|
409 (symbol-name (cdr mh-last-destination)))
|
|
410 "")
|
|
411 t))))
|
|
412 (setq mh-last-destination (cons 'refile folder))
|
|
413 (if (numberp msg-or-seq)
|
|
414 (mh-refile-a-msg msg-or-seq folder)
|
|
415 (mh-map-to-seq-msgs 'mh-refile-a-msg msg-or-seq folder))
|
|
416 (mh-next-msg))
|
|
417
|
|
418
|
|
419 (defun mh-refile-or-write-again (message)
|
|
420 "Re-execute the last refile or write command on the given MESSAGE.
|
|
421 Default is the displayed message. Use the same folder or file as the
|
|
422 previous refile or write command."
|
|
423 (interactive (list (mh-get-msg-num t)))
|
|
424 (if (null mh-last-destination)
|
|
425 (error "No previous refile or write"))
|
|
426 (cond ((eq (car mh-last-destination) 'refile)
|
|
427 (mh-refile-a-msg message (cdr mh-last-destination))
|
|
428 (message "Destination folder: %s" (cdr mh-last-destination)))
|
|
429 (t
|
|
430 (apply 'mh-write-msg-to-file message (cdr mh-last-destination))
|
|
431 (message "Destination: %s" (cdr mh-last-destination))))
|
|
432 (mh-next-msg))
|
|
433
|
|
434
|
|
435 (defun mh-quit ()
|
|
436 "Quit the current mh-e folder.
|
|
437 Start by running mh-before-quit-hook. Restore the previous window
|
|
438 configuration, if one exists. Finish by running mh-quit-hook."
|
|
439 (interactive)
|
|
440 (run-hooks 'mh-before-quit-hook)
|
|
441 (mh-update-sequences)
|
|
442 (mh-invalidate-show-buffer)
|
|
443 (bury-buffer (current-buffer))
|
|
444 (if (get-buffer mh-show-buffer)
|
|
445 (bury-buffer mh-show-buffer))
|
|
446 (if mh-previous-window-config
|
|
447 (set-window-configuration mh-previous-window-config))
|
|
448 (run-hooks 'mh-quit-hook))
|
|
449
|
|
450 (defun mh-page-msg (&optional arg)
|
|
451 "Page the displayed message forwards.
|
|
452 Scrolls ARG lines or a full screen if no argument is supplied."
|
|
453 (interactive "P")
|
|
454 (scroll-other-window arg))
|
|
455
|
|
456
|
|
457 (defun mh-previous-page (&optional arg)
|
|
458 "Page the displayed message backwards.
|
|
459 Scrolls ARG lines or a full screen if no argument is supplied."
|
|
460 (interactive "P")
|
|
461 (mh-in-show-buffer (mh-show-buffer)
|
|
462 (scroll-down arg)))
|
|
463
|
|
464
|
|
465 (defun mh-previous-undeleted-msg (&optional arg)
|
|
466 "Move to the NTH previous undeleted message in window."
|
|
467 (interactive "p")
|
|
468 (setq mh-next-direction 'backward)
|
|
469 (beginning-of-line)
|
|
470 (cond ((re-search-backward mh-good-msg-regexp nil 0 arg)
|
|
471 (mh-maybe-show))
|
|
472 (t
|
|
473 (if (get-buffer mh-show-buffer)
|
|
474 (delete-windows-on mh-show-buffer)))))
|
|
475
|
|
476
|
|
477 (defun mh-rescan-folder (&optional range)
|
|
478 "Rescan a folder after optionally processing the outstanding commands.
|
|
479 If optional prefix argument is provided, prompt for the range of
|
|
480 messages to display. Otherwise show the entire folder."
|
|
481 (interactive (list (if current-prefix-arg
|
|
482 (mh-read-msg-range "Range to scan [all]? ")
|
|
483 nil)))
|
|
484 (setq mh-next-direction 'forward)
|
|
485 (mh-scan-folder mh-current-folder (or range "all")))
|
|
486
|
|
487
|
|
488 (defun mh-write-msg-to-file (msg file no-headers)
|
|
489 "Append MESSAGE to the end of a FILE.
|
|
490 If NO-HEADERS (prefix argument) is provided, write only the message body.
|
|
491 Otherwise send the entire message including the headers."
|
|
492 (interactive
|
|
493 (list (mh-get-msg-num t)
|
|
494 (let ((default-dir (if (eq 'write (car mh-last-destination))
|
|
495 (file-name-directory (car (cdr mh-last-destination)))
|
|
496 default-directory)))
|
|
497 (read-file-name (format "Save message%s in file: "
|
|
498 (if current-prefix-arg " body" ""))
|
|
499 default-dir
|
|
500 (if (eq 'write (car mh-last-destination))
|
|
501 (car (cdr mh-last-destination))
|
|
502 (expand-file-name "mail.out" default-dir))))
|
|
503 current-prefix-arg))
|
|
504 (let ((msg-file-to-output (mh-msg-filename msg))
|
|
505 (output-file (mh-expand-file-name file)))
|
|
506 (setq mh-last-destination (list 'write file (if no-headers 'no-headers)))
|
|
507 (save-excursion
|
|
508 (set-buffer (get-buffer-create mh-temp-buffer))
|
|
509 (erase-buffer)
|
|
510 (insert-file-contents msg-file-to-output)
|
|
511 (goto-char (point-min))
|
|
512 (if no-headers (search-forward "\n\n"))
|
|
513 (append-to-file (point) (point-max) output-file))))
|
|
514
|
|
515
|
|
516 (defun mh-toggle-showing ()
|
|
517 "Toggle the scanning mode/showing mode of displaying messages."
|
|
518 (interactive)
|
|
519 (if mh-showing
|
|
520 (mh-set-scan-mode)
|
|
521 (mh-show)))
|
|
522
|
|
523
|
|
524 (defun mh-undo (msg-or-seq)
|
|
525 "Undo the pending deletion or refile of the specified MESSAGE(s).
|
|
526 Default is the displayed message. If optional prefix argument is
|
|
527 provided, then prompt for the message sequence."
|
|
528 (interactive (list (if current-prefix-arg
|
|
529 (mh-read-seq-default "Undo" t)
|
|
530 (mh-get-msg-num t))))
|
|
531 (cond ((numberp msg-or-seq)
|
|
532 (let ((original-position (point)))
|
|
533 (beginning-of-line)
|
|
534 (while (not (or (looking-at mh-deleted-msg-regexp)
|
|
535 (looking-at mh-refiled-msg-regexp)
|
|
536 (and (eq mh-next-direction 'forward) (bobp))
|
|
537 (and (eq mh-next-direction 'backward)
|
|
538 (save-excursion (forward-line) (eobp)))))
|
|
539 (forward-line (if (eq mh-next-direction 'forward) -1 1)))
|
|
540 (if (or (looking-at mh-deleted-msg-regexp)
|
|
541 (looking-at mh-refiled-msg-regexp))
|
|
542 (progn
|
|
543 (mh-undo-msg (mh-get-msg-num t))
|
|
544 (mh-maybe-show))
|
|
545 (goto-char original-position)
|
|
546 (error "Nothing to undo"))))
|
|
547 (t
|
|
548 (mh-map-to-seq-msgs 'mh-undo-msg msg-or-seq)))
|
|
549 ;; update the mh-refile-list so mh-outstanding-commands-p will work
|
|
550 (mh-mapc (function
|
|
551 (lambda (elt)
|
|
552 (if (not (mh-seq-to-msgs elt))
|
|
553 (setq mh-refile-list (delq elt mh-refile-list)))))
|
|
554 mh-refile-list)
|
|
555 (if (not (mh-outstanding-commands-p))
|
|
556 (mh-set-folder-modified-p nil)))
|
|
557
|
|
558
|
|
559 ;;;###autoload
|
|
560 (defun mh-version ()
|
|
561 "Display version information about mh-e and the MH mail handling system."
|
|
562 (interactive)
|
|
563 (mh-find-progs)
|
|
564 (set-buffer (get-buffer-create mh-temp-buffer))
|
|
565 (erase-buffer)
|
|
566 (insert " mh-e info:\n\nversion: " mh-e-version "\n" mh-e-time-stamp
|
|
567 "\nEmacs: " emacs-version " on " (symbol-name system-type) " ")
|
|
568 (condition-case ()
|
|
569 (call-process "uname" nil t nil "-a")
|
|
570 (file-error))
|
|
571 (insert "\n\n MH info:\n\n" (expand-file-name "inc" mh-progs) ":\n")
|
|
572 (let ((help-start (point)))
|
|
573 (condition-case err-data
|
|
574 (mh-exec-cmd-output "inc" nil "-help")
|
|
575 (file-error (insert (mapconcat 'concat (cdr err-data) ": "))))
|
|
576 (goto-char help-start)
|
|
577 (search-forward "version: " nil t)
|
|
578 (beginning-of-line)
|
|
579 (delete-region help-start (point))
|
|
580 (goto-char (point-min)))
|
|
581 (display-buffer mh-temp-buffer))
|
|
582
|
|
583
|
|
584 (defun mh-visit-folder (folder &optional range)
|
|
585 "Visit FOLDER and display RANGE of messages.
|
|
586 Do not call this function from outside mh-e; see \\[mh-rmail] instead."
|
|
587 (interactive (list (mh-prompt-for-folder "Visit" mh-inbox t)
|
|
588 (mh-read-msg-range "Range [all]? ")))
|
|
589 (let ((config (current-window-configuration)))
|
|
590 (mh-scan-folder folder (or range "all"))
|
|
591 (setq mh-previous-window-config config))
|
|
592 nil)
|
|
593
|
|
594
|
|
595 (defun mh-compat-quit ()
|
|
596 "The \"b\" key is obsolescent; will assume you want \"\\[mh-quit]\" ..."
|
|
597 ;; Was going to make it run mh-burst-digest, but got complaint that
|
|
598 ;; 'b' should mean 'back', as it does in info, less, and rn.
|
|
599 ;; This is a temporary compatibility function.
|
|
600 (interactive)
|
|
601 (message "%s" (documentation this-command))
|
|
602 (sit-for 1)
|
|
603 (call-interactively 'mh-quit))
|
|
604
|
|
605
|
|
606 (defun mh-update-sequences ()
|
|
607 "Update MH's Unseen sequence and current folder and message.
|
|
608 Flush mh-e's state out to MH. The message at the cursor becomes current."
|
|
609 (interactive)
|
|
610 ;; mh-update-sequences is the opposite of mh-read-folder-sequences,
|
|
611 ;; which updates mh-e's state from MH.
|
|
612 (let ((folder-set (mh-update-unseen))
|
|
613 (new-cur (mh-get-msg-num nil)))
|
|
614 (if new-cur
|
|
615 (let ((seq-entry (mh-find-seq 'cur)))
|
|
616 (mh-remove-cur-notation)
|
|
617 (setcdr seq-entry (list new-cur)) ;delete-seq-locally, add-msgs-to-seq
|
|
618 (mh-define-sequence 'cur (list new-cur))
|
|
619 (beginning-of-line)
|
|
620 (if (looking-at mh-good-msg-regexp)
|
|
621 (mh-notate nil mh-note-cur mh-cmd-note)))
|
|
622 (or folder-set
|
|
623 (save-excursion
|
|
624 (mh-exec-cmd-quiet t "folder" mh-current-folder "-fast"))))))
|
|
625
|
|
626
|
|
627
|
|
628
|
|
629 ;;; Support routines.
|
|
630
|
|
631 (defun mh-delete-a-msg (msg)
|
|
632 ;; Delete the MESSAGE.
|
|
633 (save-excursion
|
|
634 (mh-goto-msg msg nil t)
|
|
635 (if (looking-at mh-refiled-msg-regexp)
|
|
636 (error "Message %d is refiled. Undo refile before deleting." msg))
|
|
637 (if (looking-at mh-deleted-msg-regexp)
|
|
638 nil
|
|
639 (mh-set-folder-modified-p t)
|
|
640 (setq mh-delete-list (cons msg mh-delete-list))
|
|
641 (mh-add-msgs-to-seq msg 'deleted t)
|
|
642 (mh-notate msg mh-note-deleted mh-cmd-note)
|
|
643 (run-hooks 'mh-delete-msg-hook))))
|
|
644
|
|
645 (defun mh-refile-a-msg (msg destination)
|
|
646 ;; Refile MESSAGE in FOLDER. FOLDER is a symbol, not a string.
|
|
647 (save-excursion
|
|
648 (mh-goto-msg msg nil t)
|
|
649 (cond ((looking-at mh-deleted-msg-regexp)
|
|
650 (error "Message %d is deleted. Undo delete before moving." msg))
|
|
651 ((looking-at mh-refiled-msg-regexp)
|
|
652 (if (y-or-n-p
|
|
653 (format "Message %d already refiled. Copy to %s as well? "
|
|
654 msg destination))
|
|
655 (mh-exec-cmd "refile" (mh-get-msg-num t) "-link"
|
|
656 "-src" mh-current-folder
|
|
657 (symbol-name destination))
|
|
658 (message "Message not copied.")))
|
|
659 (t
|
|
660 (mh-set-folder-modified-p t)
|
|
661 (if (not (memq destination mh-refile-list))
|
|
662 (setq mh-refile-list (cons destination mh-refile-list)))
|
|
663 (if (not (memq msg (mh-seq-to-msgs destination)))
|
|
664 (mh-add-msgs-to-seq msg destination t))
|
|
665 (mh-notate msg mh-note-refiled mh-cmd-note)
|
|
666 (run-hooks 'mh-refile-msg-hook)))))
|
|
667
|
|
668
|
|
669 (defun mh-next-msg ()
|
|
670 ;; Move backward or forward to the next undeleted message in the buffer.
|
|
671 (if (eq mh-next-direction 'forward)
|
|
672 (mh-next-undeleted-msg 1)
|
|
673 (mh-previous-undeleted-msg 1)))
|
|
674
|
|
675
|
|
676 (defun mh-set-scan-mode ()
|
|
677 ;; Display the scan listing buffer, but do not show a message.
|
|
678 (if (get-buffer mh-show-buffer)
|
|
679 (delete-windows-on mh-show-buffer))
|
|
680 (setq mh-showing nil)
|
|
681 (set-buffer-modified-p (buffer-modified-p)) ;force mode line update
|
|
682 (if mh-recenter-summary-p
|
|
683 (mh-recenter nil)))
|
|
684
|
|
685
|
|
686 (defun mh-undo-msg (msg)
|
|
687 ;; Undo the deletion or refile of one MESSAGE.
|
|
688 (cond ((memq msg mh-delete-list)
|
|
689 (setq mh-delete-list (delq msg mh-delete-list))
|
|
690 (mh-delete-msg-from-seq msg 'deleted t))
|
|
691 (t
|
|
692 (mh-mapc (function (lambda (dest)
|
|
693 (mh-delete-msg-from-seq msg dest t)))
|
|
694 mh-refile-list)))
|
|
695 (mh-notate msg ? mh-cmd-note))
|
|
696
|
|
697
|
|
698
|
|
699
|
|
700 ;;; The folder data abstraction.
|
|
701
|
|
702 (defun mh-make-folder (name)
|
|
703 ;; Create and initialize a new mail folder called NAME and make it the
|
|
704 ;; current folder.
|
|
705 (switch-to-buffer name)
|
|
706 (setq buffer-read-only nil)
|
|
707 (erase-buffer)
|
|
708 (setq buffer-read-only t)
|
|
709 (mh-folder-mode)
|
|
710 (mh-set-folder-modified-p nil)
|
|
711 (setq buffer-file-name mh-folder-filename)
|
|
712 (mh-make-folder-mode-line))
|
|
713
|
|
714
|
|
715 ;;; Ensure new buffers won't get this mode if default-major-mode is nil.
|
|
716 (put 'mh-folder-mode 'mode-class 'special)
|
|
717
|
|
718 (defun mh-folder-mode ()
|
|
719 "Major mh-e mode for \"editing\" an MH folder scan listing.\\<mh-folder-mode-map>
|
|
720 You can show the message the cursor is pointing to, and step through the
|
|
721 messages. Messages can be marked for deletion or refiling into another
|
|
722 folder; these commands are executed all at once with a separate command.
|
|
723
|
|
724 A prefix argument (\\[universal-argument]) to delete, refile, list, or undo
|
|
725 applies the action to a message sequence.
|
|
726
|
|
727 Here is a list of the standard keys for mh-e commands, grouped by function.
|
|
728 This list is purposefully not customized; mh-e has a long history, and many
|
|
729 alternate key bindings as a result. This list is to encourage users to use
|
|
730 standard keys so the other keys can perhaps someday be put to new uses.
|
|
731
|
|
732 t toggle show or scan-only mode
|
|
733 RET show message, or back to top if already showing
|
|
734
|
|
735 SPC page message forward
|
|
736 DEL page message back
|
|
737
|
|
738 n next message
|
|
739 p previous message
|
|
740 g go to message by number
|
|
741
|
|
742 d mark for deletion
|
|
743 o, ^ mark for output (refile) to another folder
|
|
744 ? show folder of pending refile
|
|
745 u undo delete or refile marking
|
|
746
|
|
747 x execute marked deletes and refiles
|
|
748 i incorporate new mail
|
|
749
|
|
750 m mail a new message
|
|
751 r reply to a message
|
|
752 f forward a message
|
|
753
|
|
754 q quit mh-e
|
|
755
|
|
756 M-f visit new folder
|
|
757 M-r rescan this folder
|
|
758
|
|
759 Here are all the commands with their current binding, listed in key order:
|
|
760 \\{mh-folder-mode-map}
|
|
761
|
|
762 Variables controlling mh-e operation are (defaults in parentheses):
|
|
763
|
|
764 mh-recursive-folders (nil)
|
|
765 Non-nil means commands which operate on folders do so recursively.
|
|
766
|
|
767 mh-bury-show-buffer (t)
|
|
768 Non-nil means that the buffer used to display message is buried.
|
|
769 It will never be offered as the default other buffer.
|
|
770
|
|
771 mh-clean-message-header (nil)
|
|
772 Non-nil means remove header lines matching the regular expression
|
|
773 specified in mh-invisible-headers from messages.
|
|
774
|
|
775 mh-visible-headers (nil)
|
|
776 If non-nil, it contains a regexp specifying the headers that are shown in
|
|
777 a message if mh-clean-message-header is non-nil. Setting this variable
|
|
778 overrides mh-invisible-headers.
|
|
779
|
|
780 mh-do-not-confirm (nil)
|
|
781 Non-nil means do not prompt for confirmation before executing some
|
|
782 non-recoverable commands such as mh-kill-folder and mh-undo-folder.
|
|
783
|
|
784 mhl-formfile (nil)
|
|
785 Name of format file to be used by mhl to show messages.
|
|
786 A value of T means use the default format file.
|
|
787 Nil means don't use mhl to format messages.
|
|
788
|
|
789 mh-lpr-command-format (\"lpr -p -J '%s'\")
|
|
790 Format for command used to print a message on a system printer.
|
|
791
|
|
792 mh-scan-prog (\"scan\")
|
|
793 Program to run to generate one-line-per-message listing of a folder.
|
|
794 Normally \"scan\" or a file name linked to scan. This file is searched
|
|
795 for relative to the mh-progs directory unless it is an absolute pathname.
|
|
796 Automatically becomes buffer-local when set in any fashion.
|
|
797
|
|
798 mh-print-background (nil)
|
|
799 Print messages in the background if non-nil.
|
|
800 WARNING: do not delete the messages until printing is finished;
|
|
801 otherwise, your output may be truncated.
|
|
802
|
|
803 mh-recenter-summary-p (nil)
|
|
804 If non-nil, then the scan listing is recentered when the window displaying
|
|
805 a messages is toggled off.
|
|
806
|
|
807 mh-summary-height (4)
|
|
808 Number of lines in the summary window including the mode line.
|
|
809
|
|
810 The value of mh-folder-mode-hook is called when a new folder is set up."
|
|
811
|
|
812 (kill-all-local-variables)
|
|
813 (use-local-map mh-folder-mode-map)
|
|
814 (setq major-mode 'mh-folder-mode)
|
|
815 (mh-set-mode-name "MH-Folder")
|
|
816 (mh-make-local-vars
|
|
817 'mh-current-folder (buffer-name) ; Name of folder, a string
|
|
818 'mh-show-buffer (format "show-%s" (buffer-name)) ; Buffer that displays msgs
|
|
819 'mh-folder-filename ; e.g. "/usr/foobar/Mail/inbox/"
|
|
820 (file-name-as-directory (mh-expand-file-name (buffer-name)))
|
|
821 'mh-showing nil ; Show message also?
|
|
822 'mh-delete-list nil ; List of msgs nums to delete
|
|
823 'mh-refile-list nil ; List of folder names in mh-seq-list
|
|
824 'mh-seq-list nil ; Alist of (seq . msgs) nums
|
|
825 'mh-seen-list nil ; List of displayed messages
|
|
826 'mh-next-direction 'forward ; Direction to move to next message
|
|
827 'mh-narrowed-to-seq nil ; Sequence display is narrowed to
|
|
828 'mh-first-msg-num nil ; Number of first msg in buffer
|
|
829 'mh-last-msg-num nil ; Number of last msg in buffer
|
|
830 'mh-msg-count nil ; Number of msgs in buffer
|
|
831 'mh-mode-line-annotation nil ; Indiction this is not the full folder
|
|
832 'mh-previous-window-config nil) ; Previous window configuration
|
|
833 (setq truncate-lines t)
|
|
834 (auto-save-mode -1)
|
|
835 (setq buffer-offer-save t)
|
|
836 ;; XEmacs change
|
|
837 (if (featurep 'scrollbar)
|
|
838 (set-specifier scrollbar-height (cons (current-buffer) 0)))
|
|
839 (if (boundp 'local-write-file-hooks)
|
|
840 (setq local-write-file-hooks '(mh-execute-commands)) ;Emacs 19
|
|
841 (make-local-variable 'write-file-hooks)
|
|
842 (setq write-file-hooks '(mh-execute-commands))) ;Emacs 18
|
|
843 (make-local-variable 'revert-buffer-function)
|
|
844 (setq revert-buffer-function 'mh-undo-folder)
|
|
845 (or (assq 'mh-showing minor-mode-alist)
|
|
846 (setq minor-mode-alist
|
|
847 (cons '(mh-showing " Show") minor-mode-alist)))
|
|
848 (run-hooks 'mh-folder-mode-hook))
|
|
849
|
|
850
|
|
851 (defun mh-make-local-vars (&rest pairs)
|
|
852 ;; Take VARIABLE-VALUE pairs and make local variables initialized to the
|
|
853 ;; value.
|
|
854 (while pairs
|
|
855 (make-variable-buffer-local (car pairs))
|
|
856 (set (car pairs) (car (cdr pairs)))
|
|
857 (setq pairs (cdr (cdr pairs)))))
|
|
858
|
|
859
|
|
860 (defun mh-scan-folder (folder range)
|
|
861 ;; Scan the FOLDER over the RANGE. Return in the folder's buffer.
|
|
862 (cond ((null (get-buffer folder))
|
|
863 (mh-make-folder folder))
|
|
864 (t
|
|
865 (mh-process-or-undo-commands folder)
|
|
866 (switch-to-buffer folder)))
|
|
867 (mh-regenerate-headers range)
|
|
868 (cond ((zerop (buffer-size))
|
|
869 (if (equal range "all")
|
|
870 (message "Folder %s is empty" folder)
|
|
871 (message "No messages in %s, range %s" folder range))
|
|
872 (sit-for 5)))
|
|
873 (mh-goto-cur-msg))
|
|
874
|
|
875
|
|
876 (defun mh-regenerate-headers (range &optional update)
|
|
877 ;; scan folder over range RANGE.
|
|
878 ;; If UPDATE, append the scan lines, otherwise replace.
|
|
879 (let ((folder mh-current-folder)
|
|
880 scan-start)
|
|
881 (message "Scanning %s..." folder)
|
|
882 (with-mh-folder-updating (nil)
|
|
883 (if update
|
|
884 (goto-char (point-max))
|
|
885 (erase-buffer))
|
|
886 (setq scan-start (point))
|
|
887 (mh-exec-cmd-output mh-scan-prog nil
|
|
888 "-noclear" "-noheader"
|
|
889 "-width" (window-width)
|
|
890 folder range)
|
|
891 (goto-char scan-start)
|
|
892 (cond ((looking-at "scan: no messages in")
|
|
893 (keep-lines mh-valid-scan-line)) ; Flush random scan lines
|
|
894 ((looking-at "scan: ")) ; Keep error messages
|
|
895 (t
|
|
896 (keep-lines mh-valid-scan-line))) ; Flush random scan lines
|
|
897 (setq mh-seq-list (mh-read-folder-sequences folder nil))
|
|
898 (mh-notate-user-sequences)
|
|
899 (or update
|
|
900 (setq mh-mode-line-annotation
|
|
901 (if (equal range "all")
|
|
902 nil
|
|
903 mh-partial-folder-mode-line-annotation)))
|
|
904 (mh-make-folder-mode-line))
|
|
905 (message "Scanning %s...done" folder)))
|
|
906
|
|
907
|
|
908 (defun mh-get-new-mail (maildrop-name)
|
|
909 ;; Read new mail from a maildrop into the current buffer.
|
|
910 ;; Return in the current buffer.
|
|
911 (let ((point-before-inc (point))
|
|
912 (folder mh-current-folder)
|
|
913 (new-mail-p nil))
|
|
914 (with-mh-folder-updating (t)
|
|
915 (message (if maildrop-name
|
|
916 (format "inc %s -file %s..." folder maildrop-name)
|
|
917 (format "inc %s..." folder)))
|
|
918 (setq mh-next-direction 'forward)
|
|
919 (goto-char (point-max))
|
|
920 (let ((start-of-inc (point)))
|
|
921 (if maildrop-name
|
|
922 ;; I think MH 5 used "-ms-file" instead of "-file",
|
|
923 ;; which would make inc'ing from maildrops fail.
|
|
924 (mh-exec-cmd-output mh-inc-prog nil folder
|
|
925 "-file" (expand-file-name maildrop-name)
|
|
926 "-width" (window-width)
|
|
927 "-truncate")
|
|
928 (mh-exec-cmd-output mh-inc-prog nil
|
|
929 "-width" (window-width)))
|
|
930 (message
|
|
931 (if maildrop-name
|
|
932 (format "inc %s -file %s...done" folder maildrop-name)
|
|
933 (format "inc %s...done" folder)))
|
|
934 (goto-char start-of-inc)
|
|
935 (cond ((save-excursion
|
|
936 (re-search-forward "^inc: no mail" nil t))
|
|
937 (message "No new mail%s%s" (if maildrop-name " in " "")
|
|
938 (if maildrop-name maildrop-name "")))
|
|
939 ((re-search-forward "^inc:" nil t) ; Error messages
|
|
940 (error "inc error"))
|
|
941 (t
|
|
942 (mh-remove-cur-notation)
|
|
943 (setq new-mail-p t)))
|
|
944 (keep-lines mh-valid-scan-line) ; Flush random scan lines
|
|
945 (setq mh-seq-list (mh-read-folder-sequences folder t))
|
|
946 (mh-notate-user-sequences)
|
|
947 (if new-mail-p
|
|
948 (progn
|
|
949 (mh-make-folder-mode-line)
|
|
950 (mh-goto-cur-msg))
|
|
951 (goto-char point-before-inc))))))
|
|
952
|
|
953
|
|
954 (defun mh-make-folder-mode-line (&optional ignored)
|
|
955 ;; Set the fields of the mode line for a folder buffer.
|
|
956 ;; The optional argument is now obsolete. It used to be used to pass
|
|
957 ;; in what is now stored in the buffer-local variable
|
|
958 ;; mh-mode-line-annotation.
|
|
959 (save-excursion
|
|
960 (mh-first-msg)
|
|
961 (setq mh-first-msg-num (mh-get-msg-num nil))
|
|
962 (mh-last-msg)
|
|
963 (setq mh-last-msg-num (mh-get-msg-num nil))
|
|
964 (setq mh-msg-count (count-lines (point-min) (point-max)))
|
|
965 (setq mode-line-buffer-identification
|
|
966 (list (format "{%%b%s} %d msg%s"
|
|
967 (if mh-mode-line-annotation
|
|
968 (format "/%s" mh-mode-line-annotation)
|
|
969 "")
|
|
970 mh-msg-count
|
|
971 (if (zerop mh-msg-count)
|
|
972 "s"
|
|
973 (if (> mh-msg-count 1)
|
|
974 (format "s (%d-%d)" mh-first-msg-num
|
|
975 mh-last-msg-num)
|
|
976 (format " (%d)" mh-first-msg-num))))))))
|
|
977
|
|
978
|
|
979 (defun mh-unmark-all-headers (remove-all-flags)
|
|
980 ;; Remove all '+' flags from the headers, and if called with a non-nil
|
|
981 ;; argument, remove all 'D', '^' and '%' flags too.
|
|
982 ;; Optimized for speed (i.e., no regular expressions).
|
|
983 (save-excursion
|
|
984 (let ((case-fold-search nil)
|
|
985 (last-line (1- (point-max)))
|
|
986 char)
|
|
987 (mh-first-msg)
|
|
988 (while (<= (point) last-line)
|
|
989 (forward-char mh-cmd-note)
|
|
990 (setq char (following-char))
|
|
991 (if (or (and remove-all-flags
|
|
992 (or (eql char (aref mh-note-deleted 0))
|
|
993 (eql char (aref mh-note-refiled 0))))
|
|
994 (eql char (aref mh-note-cur 0)))
|
|
995 (progn
|
|
996 (delete-char 1)
|
|
997 (insert " ")))
|
|
998 (if remove-all-flags
|
|
999 (progn
|
|
1000 (forward-char 1)
|
|
1001 (if (eql (following-char) (aref mh-note-seq 0))
|
|
1002 (progn
|
|
1003 (delete-char 1)
|
|
1004 (insert " ")))))
|
|
1005 (forward-line)))))
|
|
1006
|
|
1007
|
|
1008 (defun mh-remove-cur-notation ()
|
|
1009 ;; Remove old cur notation (cf mh-goto-cur-msg code).
|
|
1010 (let ((cur-msg (car (mh-seq-to-msgs 'cur))))
|
|
1011 (save-excursion
|
|
1012 (and cur-msg
|
|
1013 (mh-goto-msg cur-msg t t)
|
|
1014 (looking-at mh-cur-scan-msg-regexp)
|
|
1015 (mh-notate nil ? mh-cmd-note)))))
|
|
1016
|
|
1017 (defun mh-goto-cur-msg ()
|
|
1018 ;; Position the cursor at the current message.
|
|
1019 (let ((cur-msg (car (mh-seq-to-msgs 'cur))))
|
|
1020 (cond ((and cur-msg
|
|
1021 (mh-goto-msg cur-msg t t))
|
|
1022 (mh-notate nil mh-note-cur mh-cmd-note)
|
|
1023 (mh-recenter 0)
|
|
1024 (mh-maybe-show cur-msg))
|
|
1025 (t
|
|
1026 (mh-last-msg)
|
|
1027 (message "No current message")))))
|
|
1028
|
|
1029
|
|
1030 (defun mh-process-or-undo-commands (folder)
|
|
1031 ;; If FOLDER has outstanding commands, then either process or discard them.
|
|
1032 ;; Called by functions like mh-sort-folder, so also invalidate show buffer.
|
|
1033 (set-buffer folder)
|
|
1034 (if (mh-outstanding-commands-p)
|
|
1035 (if (or mh-do-not-confirm
|
|
1036 (y-or-n-p
|
|
1037 "Process outstanding deletes and refiles (or lose them)? "))
|
|
1038 (mh-process-commands folder)
|
|
1039 (mh-undo-folder)))
|
|
1040 (mh-update-unseen)
|
|
1041 (mh-invalidate-show-buffer))
|
|
1042
|
|
1043
|
|
1044 (defun mh-process-commands (folder)
|
|
1045 ;; Process outstanding commands for the folder FOLDER.
|
|
1046 (message "Processing deletes and refiles for %s..." folder)
|
|
1047 (set-buffer folder)
|
|
1048 (with-mh-folder-updating (nil)
|
|
1049 ;; Update the unseen sequence if it exists
|
|
1050 (mh-update-unseen)
|
|
1051
|
|
1052 ;; Then refile messages
|
|
1053 (mh-mapc
|
|
1054 (function
|
|
1055 (lambda (dest)
|
|
1056 (let ((msgs (mh-seq-to-msgs dest)))
|
|
1057 (cond (msgs
|
|
1058 (apply 'mh-exec-cmd "refile"
|
|
1059 "-src" folder (symbol-name dest)
|
|
1060 (mh-coalesce-msg-list msgs))
|
|
1061 (mh-delete-scan-msgs msgs))))))
|
|
1062 mh-refile-list)
|
|
1063 (setq mh-refile-list nil)
|
|
1064
|
|
1065 ;; Now delete messages
|
|
1066 (cond (mh-delete-list
|
|
1067 (apply 'mh-exec-cmd "rmm" folder
|
|
1068 (mh-coalesce-msg-list mh-delete-list))
|
|
1069 (mh-delete-scan-msgs mh-delete-list)
|
|
1070 (setq mh-delete-list nil)))
|
|
1071
|
|
1072 ;; Don't need to remove sequences since delete and refile do so.
|
|
1073
|
|
1074 ;; Mark cur message
|
|
1075 (if (> (buffer-size) 0)
|
|
1076 (mh-define-sequence 'cur (list (or (mh-get-msg-num nil) "last"))))
|
|
1077
|
|
1078 (and (buffer-file-name (get-buffer mh-show-buffer))
|
|
1079 (not (file-exists-p (buffer-file-name (get-buffer mh-show-buffer))))
|
|
1080 ;; If "inc" were to put a new msg in this file,
|
|
1081 ;; we would not notice, so mark it invalid now.
|
|
1082 (mh-invalidate-show-buffer))
|
|
1083
|
|
1084 (setq mh-seq-list (mh-read-folder-sequences mh-current-folder nil))
|
|
1085 (mh-unmark-all-headers t)
|
|
1086 (mh-notate-user-sequences)
|
|
1087 (message "Processing deletes and refiles for %s...done" folder)))
|
|
1088
|
|
1089
|
|
1090 (defun mh-update-unseen ()
|
|
1091 ;; Flush updates to the Unseen sequence out to MH.
|
|
1092 ;; Return non-NIL iff set the MH folder.
|
|
1093 (if mh-seen-list
|
|
1094 (let* ((unseen-seq (mh-find-seq mh-unseen-seq))
|
|
1095 (unseen-msgs (mh-seq-msgs unseen-seq)))
|
|
1096 (if unseen-msgs
|
|
1097 (progn
|
|
1098 (mh-undefine-sequence mh-unseen-seq mh-seen-list)
|
|
1099 (while mh-seen-list
|
|
1100 (setq unseen-msgs (delq (car mh-seen-list) unseen-msgs))
|
|
1101 (setq mh-seen-list (cdr mh-seen-list)))
|
|
1102 (setcdr unseen-seq unseen-msgs)
|
|
1103 t) ;since we set the folder
|
|
1104 (setq mh-seen-list nil)))))
|
|
1105
|
|
1106
|
|
1107 (defun mh-delete-scan-msgs (msgs)
|
|
1108 ;; Delete the scan listing lines for each of the msgs in the LIST.
|
|
1109 (save-excursion
|
|
1110 (while msgs
|
|
1111 (if (mh-goto-msg (car msgs) t t)
|
|
1112 (mh-delete-line 1))
|
|
1113 (setq msgs (cdr msgs)))))
|
|
1114
|
|
1115
|
|
1116 (defun mh-outstanding-commands-p ()
|
|
1117 ;; Returns non-nil if there are outstanding deletes or refiles.
|
|
1118 (or mh-delete-list mh-refile-list))
|
|
1119
|
|
1120
|
|
1121 (defun mh-coalesce-msg-list (messages)
|
|
1122 ;; Give a list of MESSAGES, return a list of message number ranges.
|
|
1123 ;; Sort of the opposite of mh-read-msg-list, which expands ranges.
|
|
1124 ;; Message lists passed to MH programs go through this so
|
|
1125 ;; command line arguments won't exceed system limits.
|
|
1126 (let ((msgs (sort (copy-sequence messages) 'mh-greaterp))
|
|
1127 (range-high nil)
|
|
1128 (prev -1)
|
|
1129 (ranges nil))
|
|
1130 (while prev
|
|
1131 (if range-high
|
|
1132 (if (or (not (numberp prev))
|
|
1133 (not (eql (car msgs) (1- prev))))
|
|
1134 (progn ;non-sequential, flush old range
|
|
1135 (if (eql prev range-high)
|
|
1136 (setq ranges (cons range-high ranges))
|
|
1137 (setq ranges (cons (format "%s-%s" prev range-high) ranges)))
|
|
1138 (setq range-high nil))))
|
|
1139 (or range-high
|
|
1140 (setq range-high (car msgs))) ;start new or first range
|
|
1141 (setq prev (car msgs))
|
|
1142 (setq msgs (cdr msgs)))
|
|
1143 ranges))
|
|
1144
|
|
1145 (defun mh-greaterp (msg1 msg2)
|
|
1146 ;; Sort two message indicators. Strings are "smaller" than numbers.
|
|
1147 ;; Legal values are things like "cur", "last", 1, and 1820.
|
|
1148 (if (numberp msg1)
|
|
1149 (if (numberp msg2)
|
|
1150 (> msg1 msg2)
|
|
1151 t)
|
|
1152 (if (numberp msg2)
|
|
1153 nil
|
|
1154 (string-lessp msg2 msg1))))
|
|
1155
|
|
1156
|
|
1157
|
|
1158 ;;; Basic sequence handling
|
|
1159
|
|
1160 (defun mh-delete-seq-locally (seq)
|
|
1161 ;; Remove mh-e's record of SEQUENCE.
|
|
1162 (let ((entry (mh-find-seq seq)))
|
|
1163 (setq mh-seq-list (delq entry mh-seq-list))))
|
|
1164
|
|
1165 (defun mh-read-folder-sequences (folder save-refiles)
|
|
1166 ;; Read and return the predefined sequences for a FOLDER.
|
|
1167 ;; If SAVE-REFILES is non-nil, then keep the sequences
|
|
1168 ;; that note messages to be refiled.
|
|
1169 (let ((seqs ()))
|
|
1170 (cond (save-refiles
|
|
1171 (mh-mapc (function (lambda (seq) ; Save the refiling sequences
|
|
1172 (if (mh-folder-name-p (mh-seq-name seq))
|
|
1173 (setq seqs (cons seq seqs)))))
|
|
1174 mh-seq-list)))
|
|
1175 (save-excursion
|
|
1176 (if (eq 0 (mh-exec-cmd-quiet nil "mark" folder "-list"))
|
|
1177 (progn
|
|
1178 ;; look for name in line of form "cur: 4" or "myseq (private): 23"
|
|
1179 (while (re-search-forward "^[^: ]+" nil t)
|
|
1180 (setq seqs (cons (mh-make-seq (intern (buffer-substring
|
|
1181 (match-beginning 0)
|
|
1182 (match-end 0)))
|
|
1183 (mh-read-msg-list))
|
|
1184 seqs)))
|
|
1185 (delete-region (point-min) (point))))) ; avoid race with mh-process-daemon
|
|
1186 seqs))
|
|
1187
|
|
1188 (defun mh-read-msg-list ()
|
|
1189 ;; Return a list of message numbers from the current point to the end of
|
|
1190 ;; the line. Expands ranges into set of individual numbers.
|
|
1191 (let ((msgs ())
|
|
1192 (end-of-line (save-excursion (end-of-line) (point)))
|
|
1193 num)
|
|
1194 (while (re-search-forward "[0-9]+" end-of-line t)
|
|
1195 (setq num (string-to-int (buffer-substring (match-beginning 0)
|
|
1196 (match-end 0))))
|
|
1197 (cond ((looking-at "-") ; Message range
|
|
1198 (forward-char 1)
|
|
1199 (re-search-forward "[0-9]+" end-of-line t)
|
|
1200 (let ((num2 (string-to-int (buffer-substring (match-beginning 0)
|
|
1201 (match-end 0)))))
|
|
1202 (if (< num2 num)
|
|
1203 (error "Bad message range: %d-%d" num num2))
|
|
1204 (while (<= num num2)
|
|
1205 (setq msgs (cons num msgs))
|
|
1206 (setq num (1+ num)))))
|
|
1207 ((not (zerop num)) ;"pick" outputs "0" to mean no match
|
|
1208 (setq msgs (cons num msgs)))))
|
|
1209 msgs))
|
|
1210
|
|
1211 (defun mh-notate-user-sequences ()
|
|
1212 ;; Mark the scan listing of all messages in user-defined sequences.
|
|
1213 (let ((seqs mh-seq-list)
|
|
1214 name)
|
|
1215 (while seqs
|
|
1216 (setq name (mh-seq-name (car seqs)))
|
|
1217 (if (not (mh-internal-seq name))
|
|
1218 (mh-notate-seq name mh-note-seq (1+ mh-cmd-note)))
|
|
1219 (setq seqs (cdr seqs)))))
|
|
1220
|
|
1221
|
|
1222 (defun mh-internal-seq (name)
|
|
1223 ;; Return non-NIL if NAME is the name of an internal mh-e sequence.
|
|
1224 (or (memq name '(answered cur deleted forwarded printed))
|
|
1225 (eq name mh-unseen-seq)
|
|
1226 (eq name mh-previous-seq)
|
|
1227 (mh-folder-name-p name)))
|
|
1228
|
|
1229
|
|
1230 (defun mh-delete-msg-from-seq (message sequence &optional internal-flag)
|
|
1231 "Delete MESSAGE from SEQUENCE. MESSAGE defaults to displayed message.
|
|
1232 From Lisp, optional third arg INTERNAL-FLAG non-nil means do not
|
|
1233 inform MH of the change."
|
|
1234 (interactive (list (mh-get-msg-num t)
|
|
1235 (mh-read-seq-default "Delete from" t)
|
|
1236 nil))
|
|
1237 (let ((entry (mh-find-seq sequence)))
|
|
1238 (cond (entry
|
|
1239 (mh-notate-if-in-one-seq message ? (1+ mh-cmd-note) sequence)
|
|
1240 (if (not internal-flag)
|
|
1241 (mh-undefine-sequence sequence (list message)))
|
|
1242 (setcdr entry (delq message (mh-seq-msgs entry)))))))
|
|
1243
|
|
1244
|
|
1245 (defun mh-undefine-sequence (seq msgs)
|
|
1246 ;; Remove from the SEQUENCE the list of MSGS.
|
|
1247 (mh-exec-cmd "mark" mh-current-folder "-delete"
|
|
1248 "-sequence" (symbol-name seq)
|
|
1249 (mh-coalesce-msg-list msgs)))
|
|
1250
|
|
1251
|
|
1252 (defun mh-define-sequence (seq msgs)
|
|
1253 ;; Define the SEQUENCE to contain the list of MSGS.
|
|
1254 ;; Do not mark pseudo-sequences or empty sequences.
|
|
1255 ;; Signals an error if SEQUENCE is an illegal name.
|
|
1256 (if (and msgs
|
|
1257 (not (mh-folder-name-p seq)))
|
|
1258 (save-excursion
|
|
1259 (mh-exec-cmd-error nil "mark" mh-current-folder "-add" "-zero"
|
|
1260 "-sequence" (symbol-name seq)
|
|
1261 (mh-coalesce-msg-list msgs)))))
|
|
1262
|
|
1263
|
|
1264 (defun mh-map-over-seqs (func seq-list)
|
|
1265 ;; Apply the FUNCTION to each element in the list of SEQUENCES,
|
|
1266 ;; passing the sequence name and the list of messages as arguments.
|
|
1267 (while seq-list
|
|
1268 (funcall func (mh-seq-name (car seq-list)) (mh-seq-msgs (car seq-list)))
|
|
1269 (setq seq-list (cdr seq-list))))
|
|
1270
|
|
1271
|
|
1272 (defun mh-notate-if-in-one-seq (msg notation offset seq)
|
|
1273 ;; If the MESSAGE is in only the SEQUENCE, then mark the scan listing of the
|
|
1274 ;; message with the CHARACTER at the given OFFSET from the beginning of the
|
|
1275 ;; listing line.
|
|
1276 (let ((in-seqs (mh-seq-containing-msg msg nil)))
|
|
1277 (if (and (eq seq (car in-seqs)) (null (cdr in-seqs)))
|
|
1278 (mh-notate msg notation offset))))
|
|
1279
|
|
1280
|
|
1281 (defun mh-seq-containing-msg (msg &optional include-internal-p)
|
|
1282 ;; Return a list of the sequences containing MESSAGE.
|
|
1283 ;; If INCLUDE-INTERNAL-P non-nil, include mh-e internal sequences in list.
|
|
1284 (let ((l mh-seq-list)
|
|
1285 (seqs ()))
|
|
1286 (while l
|
|
1287 (and (memq msg (mh-seq-msgs (car l)))
|
|
1288 (or include-internal-p
|
|
1289 (not (mh-internal-seq (mh-seq-name (car l)))))
|
|
1290 (setq seqs (cons (mh-seq-name (car l)) seqs)))
|
|
1291 (setq l (cdr l)))
|
|
1292 seqs))
|
|
1293
|
|
1294
|
|
1295
|
|
1296
|
|
1297 ;;; User prompting commands.
|
|
1298
|
|
1299
|
|
1300 (defun mh-read-msg-range (prompt)
|
|
1301 ;; Read a list of blank-separated items.
|
|
1302 (let* ((buf (read-string prompt))
|
|
1303 (buf-size (length buf))
|
|
1304 (start 0)
|
|
1305 (input ()))
|
|
1306 (while (< start buf-size)
|
|
1307 (let ((next (read-from-string buf start buf-size)))
|
|
1308 (setq input (cons (car next) input))
|
|
1309 (setq start (cdr next))))
|
|
1310 (nreverse input)))
|
|
1311
|
|
1312
|
|
1313
|
|
1314 ;;; Build the folder-mode keymap:
|
|
1315
|
|
1316 (suppress-keymap mh-folder-mode-map)
|
|
1317 (define-key mh-folder-mode-map "q" 'mh-quit)
|
|
1318 (define-key mh-folder-mode-map "b" 'mh-compat-quit)
|
|
1319 (define-key mh-folder-mode-map "?" 'mh-msg-is-in-seq)
|
|
1320 (define-key mh-folder-mode-map "%" 'mh-put-msg-in-seq)
|
|
1321 (define-key mh-folder-mode-map "|" 'mh-pipe-msg)
|
|
1322 (define-key mh-folder-mode-map "\ea" 'mh-edit-again)
|
|
1323 (define-key mh-folder-mode-map "\e%" 'mh-delete-msg-from-seq)
|
|
1324 (define-key mh-folder-mode-map "\e#" 'mh-delete-seq)
|
|
1325 (define-key mh-folder-mode-map "\C-xn" 'mh-narrow-to-seq)
|
|
1326 (define-key mh-folder-mode-map "\C-xw" 'mh-widen)
|
|
1327 (define-key mh-folder-mode-map "\eb" 'mh-burst-digest)
|
|
1328 (define-key mh-folder-mode-map "\eu" 'mh-undo-folder)
|
|
1329 (define-key mh-folder-mode-map "\e " 'mh-page-digest)
|
|
1330 (define-key mh-folder-mode-map "\e\177" 'mh-page-digest-backwards)
|
|
1331 (define-key mh-folder-mode-map "\ed" 'mh-redistribute)
|
|
1332 (define-key mh-folder-mode-map "\ee" 'mh-extract-rejected-mail)
|
|
1333 (define-key mh-folder-mode-map "\ef" 'mh-visit-folder)
|
|
1334 (define-key mh-folder-mode-map "\ek" 'mh-kill-folder)
|
|
1335 (define-key mh-folder-mode-map "\el" 'mh-list-folders)
|
|
1336 (define-key mh-folder-mode-map "\en" 'mh-store-msg)
|
|
1337 (define-key mh-folder-mode-map "\ep" 'mh-pack-folder)
|
|
1338 (define-key mh-folder-mode-map "\eq" 'mh-list-sequences)
|
|
1339 (define-key mh-folder-mode-map "\es" 'mh-search-folder)
|
|
1340 (define-key mh-folder-mode-map "\er" 'mh-rescan-folder)
|
|
1341 (define-key mh-folder-mode-map "l" 'mh-print-msg)
|
|
1342 (define-key mh-folder-mode-map "t" 'mh-toggle-showing)
|
|
1343 (define-key mh-folder-mode-map "c" 'mh-copy-msg)
|
|
1344 (define-key mh-folder-mode-map "i" 'mh-inc-folder)
|
|
1345 (define-key mh-folder-mode-map "x" 'mh-execute-commands)
|
|
1346 (define-key mh-folder-mode-map "e" 'mh-execute-commands)
|
|
1347 (define-key mh-folder-mode-map "f" 'mh-forward)
|
|
1348 (define-key mh-folder-mode-map "m" 'mh-send)
|
|
1349 (define-key mh-folder-mode-map "s" 'mh-send)
|
|
1350 (define-key mh-folder-mode-map "r" 'mh-reply)
|
|
1351 (define-key mh-folder-mode-map "a" 'mh-reply)
|
|
1352 (define-key mh-folder-mode-map "j" 'mh-goto-msg)
|
|
1353 (define-key mh-folder-mode-map "g" 'mh-goto-msg)
|
|
1354 (define-key mh-folder-mode-map "\e<" 'mh-first-msg)
|
|
1355 (define-key mh-folder-mode-map "\e>" 'mh-last-msg)
|
|
1356 (define-key mh-folder-mode-map "\177" 'mh-previous-page)
|
|
1357 (define-key mh-folder-mode-map " " 'mh-page-msg)
|
|
1358 (define-key mh-folder-mode-map "\r" 'mh-show)
|
|
1359 (define-key mh-folder-mode-map "." 'mh-show)
|
|
1360 (define-key mh-folder-mode-map "," 'mh-header-display)
|
|
1361 (define-key mh-folder-mode-map "u" 'mh-undo)
|
|
1362 (define-key mh-folder-mode-map "d" 'mh-delete-msg)
|
|
1363 (define-key mh-folder-mode-map "\C-d" 'mh-delete-msg-no-motion)
|
|
1364 (define-key mh-folder-mode-map "p" 'mh-previous-undeleted-msg)
|
|
1365 (define-key mh-folder-mode-map "n" 'mh-next-undeleted-msg)
|
|
1366 (define-key mh-folder-mode-map "o" 'mh-refile-msg)
|
|
1367 (define-key mh-folder-mode-map "^" 'mh-refile-msg)
|
|
1368 (define-key mh-folder-mode-map "\C-o" 'mh-write-msg-to-file)
|
|
1369 (define-key mh-folder-mode-map ">" 'mh-write-msg-to-file)
|
|
1370 (define-key mh-folder-mode-map "!" 'mh-refile-or-write-again)
|
|
1371
|
|
1372 ;; "C-c /" prefix is used in mh-folder-mode by pgp.el and mailcrypt
|
|
1373
|
|
1374
|
|
1375
|
|
1376 ;;;autoload the other mh-e parts
|
|
1377
|
|
1378 ;;; mh-comp
|
|
1379
|
|
1380 (autoload 'mh-smail "mh-comp"
|
|
1381 "Compose and send mail with the MH mail system.
|
|
1382 This function is an entry point to mh-e, the Emacs front end
|
|
1383 to the MH mail system.
|
|
1384 See documentation of `\\[mh-send]' for more details on composing mail." t)
|
|
1385
|
|
1386 (autoload 'mh-smail-other-window "mh-comp"
|
|
1387 "Compose and send mail in other window with the MH mail system.
|
|
1388 This function is an entry point to mh-e, the Emacs front end
|
|
1389 to the MH mail system.
|
|
1390 See documentation of `\\[mh-send]' for more details on composing mail." t)
|
|
1391
|
|
1392 (autoload 'mh-edit-again "mh-comp"
|
|
1393 "Clean-up a draft or a message previously sent and make it resendable.
|
|
1394 Default is the current message.
|
|
1395 The variable mh-new-draft-cleaned-headers specifies the headers to remove.
|
|
1396 See also documentation for `\\[mh-send]' function." t)
|
|
1397
|
|
1398 (autoload 'mh-extract-rejected-mail "mh-comp"
|
|
1399 "Extract a letter returned by the mail system and make it resendable.
|
|
1400 Default is the current message. The variable mh-new-draft-cleaned-headers
|
|
1401 gives the headers to clean out of the original message.
|
|
1402 See also documentation for `\\[mh-send]' function." t)
|
|
1403
|
|
1404 (autoload 'mh-forward "mh-comp"
|
|
1405 "Forward a message or message sequence. Defaults to displayed message.
|
|
1406 If optional prefix argument provided, then prompt for the message sequence.
|
|
1407 See also documentation for `\\[mh-send]' function." t)
|
|
1408
|
|
1409 (autoload 'mh-redistribute "mh-comp"
|
|
1410 "Redistribute a letter.
|
|
1411 Depending on how your copy of MH was compiled, you may need to change the
|
|
1412 setting of the variable mh-redist-full-contents. See its documentation." t)
|
|
1413
|
|
1414 (autoload 'mh-reply "mh-comp"
|
|
1415 "Reply to a MESSAGE (default: displayed message).
|
|
1416 If optional prefix argument INCLUDEP provided, then include the message
|
|
1417 in the reply using filter mhl.reply in your MH directory.
|
|
1418 Prompts for type of addresses to reply to:
|
|
1419 from sender only,
|
|
1420 to sender and primary recipients,
|
|
1421 cc/all sender and all recipients.
|
|
1422 If the file named by `mh-repl-formfile' exists, it is used as a skeleton
|
|
1423 for the reply. See also documentation for `\\[mh-send]' function." t)
|
|
1424
|
|
1425 (autoload 'mh-send "mh-comp"
|
|
1426 "Compose and send a letter.
|
|
1427 The file named by `mh-comp-formfile' will be used as the form.
|
|
1428 Do not call this function from outside mh-e; use \\[mh-smail] instead.
|
|
1429 The letter is composed in mh-letter-mode; see its documentation for more
|
|
1430 details. If `mh-compose-letter-function' is defined, it is called on the
|
|
1431 draft and passed three arguments: to, subject, and cc." t)
|
|
1432
|
|
1433 (autoload 'mh-send-other-window "mh-comp"
|
|
1434 "Compose and send a letter in another window.
|
|
1435 Do not call this function from outside mh-e;
|
|
1436 use \\[mh-smail-other-window] instead.
|
|
1437 See also documentation for `\\[mh-send]' function." t)
|
|
1438
|
|
1439 (autoload 'mh-letter-mode "mh-comp"
|
|
1440 "Mode for composing letters in mh-e.
|
|
1441 For more details, type \\[describe-mode] while in MH-Letter mode." t)
|
|
1442
|
|
1443
|
|
1444 ;;; mh-funcs
|
|
1445
|
|
1446 (autoload 'mh-burst-digest "mh-funcs"
|
|
1447 "Burst apart the current message, which should be a digest.
|
|
1448 The message is replaced by its table of contents and the messages from the
|
|
1449 digest are inserted into the folder after that message." t)
|
|
1450
|
|
1451 (autoload 'mh-copy-msg "mh-funcs"
|
|
1452 "Copy to another FOLDER the specified MESSAGE(s) without deleting them.
|
|
1453 Default is the displayed message. If optional prefix argument is
|
|
1454 provided, then prompt for the message sequence." t)
|
|
1455
|
|
1456 (autoload 'mh-kill-folder "mh-funcs"
|
|
1457 "Remove the current folder." t)
|
|
1458
|
|
1459 (autoload 'mh-list-folders "mh-funcs"
|
|
1460 "List mail folders." t)
|
|
1461
|
|
1462 (autoload 'mh-pack-folder "mh-funcs"
|
|
1463 "Renumber the messages of a folder to be 1..n.
|
|
1464 First, offer to execute any outstanding commands for the current folder.
|
|
1465 If optional prefix argument provided, prompt for the range of messages
|
|
1466 to display after packing. Otherwise, show the entire folder." t)
|
|
1467
|
|
1468 (autoload 'mh-pipe-msg "mh-funcs"
|
|
1469 "Pipe the current message through the given shell COMMAND.
|
|
1470 If INCLUDE-HEADERS (prefix argument) is provided, send the entire message.
|
|
1471 Otherwise just send the message's body without the headers." t)
|
|
1472
|
|
1473 (autoload 'mh-page-digest "mh-funcs"
|
|
1474 "Advance displayed message to next digested message." t)
|
|
1475
|
|
1476 (autoload 'mh-page-digest-backwards "mh-funcs"
|
|
1477 "Back up displayed message to previous digested message." t)
|
|
1478
|
|
1479 (autoload 'mh-print-msg "mh-funcs"
|
|
1480 "Print MESSAGE(s) (default: displayed message) on printer.
|
|
1481 If optional prefix argument provided, then prompt for the message sequence.
|
|
1482 The variable mh-lpr-command-format is used to generate the print command.
|
|
1483 The messages are formatted by mhl. See the variable mhl-formfile." t)
|
|
1484
|
|
1485 (autoload 'mh-sort-folder "mh-funcs"
|
|
1486 "Sort the messages in the current folder by date.
|
|
1487 Calls the MH program sortm to do the work.
|
|
1488 The arguments in the list mh-sortm-args are passed to sortm
|
|
1489 if this function is passed an argument." t)
|
|
1490
|
|
1491 (autoload 'mh-undo-folder "mh-funcs"
|
|
1492 "Undo all commands in current folder." t)
|
|
1493
|
|
1494 (autoload 'mh-store-msg "mh-funcs"
|
|
1495 "Store the file(s) contained in the current message into DIRECTORY.
|
|
1496 The message can contain a shar file or uuencoded file.
|
|
1497 Default directory is the last directory used, or initially the value of
|
|
1498 mh-store-default-directory or the current directory." t)
|
|
1499
|
|
1500 (autoload 'mh-store-buffer "mh-funcs"
|
|
1501 "Store the file(s) contained in the current buffer into DIRECTORY.
|
|
1502 The buffer can contain a shar file or uuencoded file.
|
|
1503 Default directory is the last directory used, or initially the value of
|
|
1504 `mh-store-default-directory' or the current directory." t)
|
|
1505
|
|
1506
|
|
1507 ;;; mh-pick
|
|
1508
|
|
1509 (autoload 'mh-search-folder "mh-pick"
|
|
1510 "Search FOLDER for messages matching a pattern.
|
|
1511 Add the messages found to the sequence named `search'." t)
|
|
1512
|
|
1513 ;;; mh-seq
|
|
1514
|
|
1515 (autoload 'mh-delete-seq "mh-seq"
|
|
1516 "Delete the SEQUENCE." t)
|
|
1517 (autoload 'mh-list-sequences "mh-seq"
|
|
1518 "List the sequences defined in FOLDER." t)
|
|
1519 (autoload 'mh-msg-is-in-seq "mh-seq"
|
|
1520 "Display the sequences that contain MESSAGE (default: displayed message)." t)
|
|
1521 (autoload 'mh-narrow-to-seq "mh-seq"
|
|
1522 "Restrict display of this folder to just messages in SEQUENCE
|
|
1523 Use \\[mh-widen] to undo this command." t)
|
|
1524 (autoload 'mh-put-msg-in-seq "mh-seq"
|
|
1525 "Add MESSAGE(s) (default: displayed message) to SEQUENCE.
|
|
1526 If optional prefix argument provided, then prompt for the message sequence." t)
|
|
1527 (autoload 'mh-widen "mh-seq"
|
|
1528 "Remove restrictions from current folder, thereby showing all messages." t)
|
|
1529 (autoload 'mh-rename-seq "mh-seq"
|
|
1530 "Rename SEQUENCE to have NEW-NAME." t)
|
|
1531
|
|
1532 ;;; mh-e.el ends here
|