comparison lisp/mail/mh-e.el @ 11332:c9c652970786

New version from author.
author Karl Heuer <kwzh@gnu.org>
date Sun, 09 Apr 1995 22:31:08 +0000
parents 417a04871329
children 53174cfc29fa
comparison
equal deleted inserted replaced
11331:730a7c669a73 11332:c9c652970786
1 ;;; mh-e.el --- GNU Emacs interface to the MH mail system 1 ;;; mh-e.el --- GNU Emacs interface to the MH mail system
2 2
3 ;;; Copyright 1985,86,87,88,90,92,93,94 Free Software Foundation, Inc. 3 ;;; Copyright (C) 1985,86,87,88,90,92,93,94,95 Free Software Foundation, Inc.
4 4
5 (defconst mh-e-time-stamp "Time-stamp: <94/04/13 11:30:48 gildea>") 5 (defconst mh-e-time-stamp "Time-stamp: <95/03/05 23:39:29 gildea>")
6 (defconst mh-e-version "4.1" 6 (defconst mh-e-version "5.0"
7 "Version numbers of this version of mh-e.") 7 "Version numbers of this version of mh-e.")
8 8
9 ;; Maintainer: Stephen Gildea <gildea@lcs.mit.edu> 9 ;; Maintainer: Stephen Gildea <gildea@lcs.mit.edu>
10 ;; Version: 4.1 10 ;; Version: 5.0
11 ;; Keywords: mail 11 ;; Keywords: mail
12 ;; Bug-reports: include `M-x mh-version' output in any correspondence
12 13
13 ;; mh-e is free software; you can redistribute it and/or modify 14 ;; mh-e is free software; you can redistribute it and/or modify
14 ;; it under the terms of the GNU General Public License as published by 15 ;; it under the terms of the GNU General Public License as published by
15 ;; the Free Software Foundation; either version 2, or (at your option) 16 ;; the Free Software Foundation; either version 2, or (at your option)
16 ;; any later version. 17 ;; any later version.
28 29
29 ;;; HOW TO USE: 30 ;;; HOW TO USE:
30 ;;; M-x mh-rmail to read mail. Type C-h m there for a list of commands. 31 ;;; M-x mh-rmail to read mail. Type C-h m there for a list of commands.
31 ;;; C-u M-x mh-rmail to visit any folder. 32 ;;; C-u M-x mh-rmail to visit any folder.
32 ;;; M-x mh-smail to send mail. From within the mail reader, "m" works, too. 33 ;;; M-x mh-smail to send mail. From within the mail reader, "m" works, too.
34
35 ;;; MH (Message Handler) is a powerful mail reader. The MH newsgroup
36 ;;; is comp.mail.mh; the mailing list is mh-users@ics.uci.edu (send to
37 ;;; mh-users-request to be added). See the monthly Frequently Asked
38 ;;; Questions posting there for information on getting MH and mh-e.
39
40 ;;; mh-e is an Emacs interface to the MH mail system.
41 ;;; The mailing list mh-e@x.org is for discussion of mh-e and
42 ;;; announcements of new versions. Send a "subscribe" message to
43 ;;; mh-e-request@x.org to be added. Do not report bugs here; mail
44 ;;; them directly to the author (see top of mh-e.el source).
45 ;;; Include the output of M-x mh-version in any bug report.
46
47 ;;; mh-e works with GNU Emacs 18 or 19, and MH 6.
48
49 ;;; NB. MH must have been compiled with the MHE compiler flag or several
50 ;;; features necessary for mh-e will be missing from MH commands, specifically
51 ;;; the -build switch to repl and forw.
52
33 ;;; Your .emacs might benefit from these bindings: 53 ;;; Your .emacs might benefit from these bindings:
34 ;;; (global-set-key "\C-cr" 'mh-rmail) 54 ;;; (global-set-key "\C-cr" 'mh-rmail)
35 ;;; (global-set-key "\C-xm" 'mh-smail) 55 ;;; (global-set-key "\C-xm" 'mh-smail)
36 ;;; (global-set-key "\C-x4m" 'mh-smail-other-window) 56 ;;; (global-set-key "\C-x4m" 'mh-smail-other-window)
37 57
38 ;;; MH (Message Handler) is a powerful mail reader. The MH newsgroup
39 ;;; is comp.mail.mh; the mailing list is mh-users@ics.uci.edu (send to
40 ;;; mh-users-request to be added). See the monthly Frequently Asked
41 ;;; Questions posting there for information on getting MH.
42
43 ;;; mh-e works with Emacs 18 or 19, and MH 5 or 6.
44
45 ;;; NB. MH must have been compiled with the MHE compiler flag or several
46 ;;; features necessary mh-e will be missing from MH commands, specifically
47 ;;; the -build switch to repl and forw.
48
49 ;;; Change Log: 58 ;;; Change Log:
50 59
51 ;;; Original version for Gosling emacs by Brian Reid, Stanford, 1982. 60 ;;; Original version for Gosling emacs by Brian Reid, Stanford, 1982.
52 ;;; Modified by James Larus, BBN, July 1984 and UCB, 1984 & 1985. 61 ;;; Modified by James Larus, BBN, July 1984 and UCB, 1984 & 1985.
53 ;;; Rewritten for GNU Emacs, James Larus 1985. larus@ginger.berkeley.edu 62 ;;; Rewritten for GNU Emacs, James Larus 1985. larus@ginger.berkeley.edu
54 ;;; Modified by Stephen Gildea 1988. gildea@lcs.mit.edu 63 ;;; Modified by Stephen Gildea 1988. gildea@lcs.mit.edu
55 (defconst mh-e-RCS-id "$Header: /home/fsf/rms/e19/lisp/RCS/mh-e.el,v 1.3 1994/07/18 18:04:45 rms Exp rms $") 64 (defconst mh-e-RCS-id "$Id: mh-e.el,v 3.21 95/03/06 19:11:17 gildea Exp $")
56 65
57 ;;; Code: 66 ;;; Code:
58 67
59 (provide 'mh-e) 68 (provide 'mh-e)
60 (require 'mh-utils) 69 (require 'mh-utils)
61 70
62 71
63 ;;; Site customization (see also mh-utils.el):
64
65 (defvar mh-redist-full-contents nil
66 "Non-nil if the `dist' command needs whole letter for redistribution.
67 This is the case only when `send' is compiled with the BERK option.
68 If MH will not allow you to redist a previously redist'd msg, set to nil.")
69
70 ;;; Hooks: 72 ;;; Hooks:
71 73
72 (defvar mh-folder-mode-hook nil 74 (defvar mh-folder-mode-hook nil
73 "Invoked in MH-Folder mode on a new folder.") 75 "Invoked in MH-Folder mode on a new folder.")
74 76
95 97
96 98
97 99
98 ;;; Personal preferences: 100 ;;; Personal preferences:
99 101
100 (defvar mh-lpr-command-format "lpr -p -J '%s'" 102 (defvar mh-lpr-command-format "lpr -J '%s'"
101 "*Format for Unix command that prints a message. 103 "*Format for Unix command that prints a message.
102 The string should be a Unix command line, with the string '%s' where 104 The string should be a Unix command line, with the string '%s' where
103 the job's name (folder and message number) should appear. The formatted 105 the job's name (folder and message number) should appear. The formatted
104 message text is piped to this command when you type \\<mh-folder-mode-map>`\\[mh-print-msg]'.") 106 message text is piped to this command when you type \\<mh-folder-mode-map>`\\[mh-print-msg]'.")
105 107
121 otherwise, your output may be truncated.") 123 otherwise, your output may be truncated.")
122 124
123 (defvar mh-recenter-summary-p nil 125 (defvar mh-recenter-summary-p nil
124 "*Recenter summary window when the show window is toggled off if non-nil.") 126 "*Recenter summary window when the show window is toggled off if non-nil.")
125 127
126 (defvar mh-ins-buf-prefix "> "
127 "*String to put before each non-blank line of a yanked or inserted message.
128 \\<mh-letter-mode-map>Used when the message is inserted into an outgoing letter
129 by \\[mh-insert-letter] or \\[mh-yank-cur-msg].")
130
131 (defvar mh-do-not-confirm nil 128 (defvar mh-do-not-confirm nil
132 "*Non-nil means do not prompt for confirmation before some mh-e commands. 129 "*Non-nil means do not prompt for confirmation before some mh-e commands.
133 Affects non-recoverable commands such as mh-kill-folder and mh-undo-folder.") 130 Affects non-recoverable commands such as mh-kill-folder and mh-undo-folder.")
134 131
135 (defvar mh-store-default-directory nil 132 (defvar mh-store-default-directory nil
150 "Regexp matching scan lines of refiled messages.") 147 "Regexp matching scan lines of refiled messages.")
151 148
152 (defvar mh-valid-scan-line "^ *[0-9]" 149 (defvar mh-valid-scan-line "^ *[0-9]"
153 "Regexp matching scan lines for messages (not error messages).") 150 "Regexp matching scan lines for messages (not error messages).")
154 151
155 (defvar mh-flagged-scan-msg-regexp "^....\\D\\|^....\\^\\|^....\\+\\|^.....%"
156 "Regexp matching flagged scan lines.
157 Matches lines marked as deleted, refiled, in a sequence, or the cur message.")
158
159 (defvar mh-cur-scan-msg-regexp "^....\\+" 152 (defvar mh-cur-scan-msg-regexp "^....\\+"
160 "Regexp matching scan line for the cur message.") 153 "Regexp matching scan line for the cur message.")
161 154
162 (defvar mh-show-buffer-mode-line-buffer-id "{show-%s} %d" 155 (defvar mh-note-deleted "D"
163 "Format string to produce `mode-line-buffer-identification' for show buffers. 156 "String whose first character is used to notate deleted messages.")
164 First argument is folder name. Second is message number.") 157
158 (defvar mh-note-refiled "^"
159 "String whose first character is used to notate refiled messages.")
160
161 (defvar mh-note-cur "+"
162 "String whose first character is used to notate the current message.")
165 163
166 (defvar mh-partial-folder-mode-line-annotation "select" 164 (defvar mh-partial-folder-mode-line-annotation "select"
167 "Annotation when displaying part of a folder. 165 "Annotation when displaying part of a folder.
168 The string is displayed after the folder's name. NIL for no annotation.") 166 The string is displayed after the folder's name. NIL for no annotation.")
169 167
170 168
171 ;;; Internal variables: 169 ;;; Internal variables:
172 170
173 (defvar mh-last-destination nil 171 (defvar mh-last-destination nil) ;Destination of last refile or write command.
174 "Destination of last refile or write command.")
175 172
176 (defvar mh-folder-mode-map (make-keymap) 173 (defvar mh-folder-mode-map (make-keymap)
177 "Keymap for MH folders.") 174 "Keymap for MH folders.")
178 175
179 (defvar mh-next-seq-num nil 176 (defvar mh-delete-list nil) ;List of msg numbers to delete.
180 "Index of free sequence id.") 177
181 178 (defvar mh-refile-list nil) ;List of folder names in mh-seq-list.
182 (defvar mh-delete-list nil 179
183 "List of msg numbers to delete.") 180 (defvar mh-next-direction 'forward) ;Direction to move to next message.
184 181
185 (defvar mh-refile-list nil 182 (defvar mh-narrowed-to-seq nil) ;Sequence display is narrowed to or nil if not narrowed.
186 "List of folder names in mh-seq-list.") 183
187 184 (defvar mh-first-msg-num nil) ;Number of first msg in buffer.
188 (defvar mh-next-direction 'forward 185
189 "Direction to move to next message.") 186 (defvar mh-last-msg-num nil) ;Number of last msg in buffer.
190 187
191 (defvar mh-narrowed-to-seq nil 188 (defvar mh-mode-line-annotation nil) ;Indiction this is not the full folder.
192 "Sequence display is narrowed to.")
193
194 (defvar mh-first-msg-num nil
195 "Number of first msg in buffer.")
196
197 (defvar mh-last-msg-num nil
198 "Number of last msg in buffer.")
199
200 189
201 ;;; Macros and generic functions: 190 ;;; Macros and generic functions:
202 191
203 (defun mh-mapc (func list) 192 (defun mh-mapc (func list)
204 (while list 193 (while list
278 (if mh-narrowed-to-seq (mh-widen)) 267 (if mh-narrowed-to-seq (mh-widen))
279 (mh-process-commands mh-current-folder) 268 (mh-process-commands mh-current-folder)
280 (mh-set-scan-mode) 269 (mh-set-scan-mode)
281 (mh-goto-cur-msg) ; after mh-set-scan-mode for efficiency 270 (mh-goto-cur-msg) ; after mh-set-scan-mode for efficiency
282 (mh-make-folder-mode-line) 271 (mh-make-folder-mode-line)
283 t) ; return t for local-write-file-hooks 272 t) ; return t for [local-]write-file-hooks
284 273
285 274
286 (defun mh-first-msg () 275 (defun mh-first-msg ()
287 "Move to the first message." 276 "Move to the first message."
288 (interactive) 277 (interactive)
289 (goto-char (point-min))) 278 (goto-char (point-min))
279 (while (and (not (eobp)) (not (looking-at mh-valid-scan-line)))
280 (forward-line 1)))
290 281
291 282
292 (defun mh-header-display () 283 (defun mh-header-display ()
293 "Show the current message with all its headers. 284 "Show the current message with all its headers.
294 Displays headers that might have been suppressed by setting the 285 Displays headers that might have been suppressed by setting the
307 (mh-recenter 0)) 298 (mh-recenter 0))
308 (setq mh-showing-with-headers t))) 299 (setq mh-showing-with-headers t)))
309 300
310 301
311 (defun mh-inc-folder (&optional maildrop-name) 302 (defun mh-inc-folder (&optional maildrop-name)
312 "Inc(orporate)s new mail into +inbox. 303 "Inc(orporate)s new mail into the Inbox folder.
313 Optional prefix argument specifies an alternate maildrop from the default. 304 Optional prefix argument specifies an alternate maildrop from the default.
314 If this is given, incorporates mail into the current folder, rather 305 If the prefix argument is given, incorporates mail into the current
315 than +inbox. Runs `mh-inc-folder-hook' after incorporating new mail. 306 folder, otherwise uses the folder named by `mh-inbox'.
307 Runs `mh-inc-folder-hook' after incorporating new mail.
316 Do not call this function from outside mh-e; use \\[mh-rmail] instead." 308 Do not call this function from outside mh-e; use \\[mh-rmail] instead."
317 (interactive (list (if current-prefix-arg 309 (interactive (list (if current-prefix-arg
318 (expand-file-name 310 (expand-file-name
319 (read-file-name "inc mail from file: " 311 (read-file-name "inc mail from file: "
320 mh-user-path))))) 312 mh-user-path)))))
321 (let ((config (current-window-configuration))) 313 (let ((config (current-window-configuration)))
322 (if (not maildrop-name) 314 (if (not maildrop-name)
323 (cond ((not (get-buffer "+inbox")) 315 (cond ((not (get-buffer mh-inbox))
324 (mh-make-folder "+inbox") 316 (mh-make-folder mh-inbox)
325 (setq mh-previous-window-config config)) 317 (setq mh-previous-window-config config))
326 ((not (eq (current-buffer) (get-buffer "+inbox"))) 318 ((not (eq (current-buffer) (get-buffer mh-inbox)))
327 (switch-to-buffer "+inbox") 319 (switch-to-buffer mh-inbox)
328 (setq mh-previous-window-config config))))) 320 (setq mh-previous-window-config config)))))
329 (mh-get-new-mail maildrop-name) 321 (mh-get-new-mail maildrop-name)
330 (run-hooks 'mh-inc-folder-hook)) 322 (run-hooks 'mh-inc-folder-hook))
331 323
332 324
337 (while (and (not (bobp)) (looking-at "^$")) 329 (while (and (not (bobp)) (looking-at "^$"))
338 (forward-line -1))) 330 (forward-line -1)))
339 331
340 332
341 (defun mh-next-undeleted-msg (&optional arg) 333 (defun mh-next-undeleted-msg (&optional arg)
342 "Move to next undeleted message in window." 334 "Move to the NTH next undeleted message in window."
343 (interactive "P") 335 (interactive "p")
344 (forward-line (prefix-numeric-value arg))
345 (setq mh-next-direction 'forward) 336 (setq mh-next-direction 'forward)
337 (forward-line 1)
346 (cond ((re-search-forward mh-good-msg-regexp nil 0 arg) 338 (cond ((re-search-forward mh-good-msg-regexp nil 0 arg)
347 (beginning-of-line) 339 (beginning-of-line)
348 (mh-maybe-show)) 340 (mh-maybe-show))
349 (t 341 (t
350 (forward-line -1) 342 (forward-line -1)
351 (if (get-buffer mh-show-buffer) 343 (if (get-buffer mh-show-buffer)
352 (delete-windows-on mh-show-buffer))))) 344 (delete-windows-on mh-show-buffer)))))
353 345
354 346
355 (defun mh-refile-msg (msg-or-seq dest) 347 (defun mh-refile-msg (msg-or-seq folder)
356 "Refile MESSAGE(s) (default: displayed message) in FOLDER. 348 "Refile MESSAGE(s) (default: displayed message) into FOLDER.
357 If optional prefix argument provided, then prompt for message sequence." 349 If optional prefix argument provided, then prompt for message sequence."
358 (interactive 350 (interactive
359 (list (if current-prefix-arg 351 (list (if current-prefix-arg
360 (mh-read-seq-default "Refile" t) 352 (mh-read-seq-default "Refile" t)
361 (mh-get-msg-num t)) 353 (mh-get-msg-num t))
362 (intern 354 (intern
363 (mh-prompt-for-folder 355 (mh-prompt-for-folder
364 "Destination" 356 "Destination"
365 (or (and mh-msg-folder-hook 357 (or (and mh-default-folder-for-message-function
366 (let ((file-name (mh-msg-filename (mh-get-msg-num t)))) 358 (let ((refile-file (mh-msg-filename (mh-get-msg-num t))))
367 (save-excursion 359 (save-excursion
368 (set-buffer (get-buffer-create " *mh-temp*")) 360 (set-buffer (get-buffer-create mh-temp-buffer))
369 (erase-buffer) 361 (erase-buffer)
370 (insert-file-contents file-name) 362 (insert-file-contents refile-file)
371 (let ((buffer-file-name file-name)) 363 (let ((buffer-file-name refile-file))
372 (funcall mh-msg-folder-hook))))) 364 (funcall mh-default-folder-for-message-function)))))
373 (and (eq 'refile (car mh-last-destination)) 365 (and (eq 'refile (car mh-last-destination))
374 (symbol-name (cdr mh-last-destination))) 366 (symbol-name (cdr mh-last-destination)))
375 "") 367 "")
376 t)))) 368 t))))
377 (setq mh-last-destination (cons 'refile dest)) 369 (setq mh-last-destination (cons 'refile folder))
378 (if (numberp msg-or-seq) 370 (if (numberp msg-or-seq)
379 (mh-refile-a-msg msg-or-seq dest) 371 (mh-refile-a-msg msg-or-seq folder)
380 (mh-map-to-seq-msgs 'mh-refile-a-msg msg-or-seq dest)) 372 (mh-map-to-seq-msgs 'mh-refile-a-msg msg-or-seq folder))
381 (mh-next-msg)) 373 (mh-next-msg))
382 374
383 375
384 (defun mh-refile-or-write-again (msg) 376 (defun mh-refile-or-write-again (message)
385 "Re-execute the last refile or write command on the given MESSAGE. 377 "Re-execute the last refile or write command on the given MESSAGE.
386 Default is the displayed message. Use the same folder or file as the 378 Default is the displayed message. Use the same folder or file as the
387 previous refile or write command." 379 previous refile or write command."
388 (interactive (list (mh-get-msg-num t))) 380 (interactive (list (mh-get-msg-num t)))
389 (if (null mh-last-destination) 381 (if (null mh-last-destination)
390 (error "No previous refile or write")) 382 (error "No previous refile or write"))
391 (cond ((eq (car mh-last-destination) 'refile) 383 (cond ((eq (car mh-last-destination) 'refile)
392 (mh-refile-a-msg msg (cdr mh-last-destination)) 384 (mh-refile-a-msg message (cdr mh-last-destination))
393 (message "Destination folder: %s" (cdr mh-last-destination))) 385 (message "Destination folder: %s" (cdr mh-last-destination)))
394 (t 386 (t
395 (apply 'mh-write-msg-to-file msg (cdr mh-last-destination)) 387 (apply 'mh-write-msg-to-file message (cdr mh-last-destination))
396 (message "Destination: %s" (cdr mh-last-destination)))) 388 (message "Destination: %s" (cdr mh-last-destination))))
397 (mh-next-msg)) 389 (mh-next-msg))
398 390
399 391
400 (defun mh-quit () 392 (defun mh-quit ()
401 "Quit mh-e. 393 "Quit the current mh-e folder.
402 Start by running mh-before-quit-hook. Restore the previous window 394 Start by running mh-before-quit-hook. Restore the previous window
403 configuration, if one exists. Finish by running mh-quit-hook." 395 configuration, if one exists. Finish by running mh-quit-hook."
404 (interactive) 396 (interactive)
405 (run-hooks 'mh-before-quit-hook) 397 (run-hooks 'mh-before-quit-hook)
406 (mh-update-unseen) 398 (mh-update-sequences)
407 (mh-invalidate-show-buffer) 399 (mh-invalidate-show-buffer)
408 (bury-buffer (current-buffer)) 400 (bury-buffer (current-buffer))
409 (if (get-buffer mh-show-buffer) 401 (if (get-buffer mh-show-buffer)
410 (bury-buffer mh-show-buffer)) 402 (bury-buffer mh-show-buffer))
411 (if mh-previous-window-config 403 (if mh-previous-window-config
426 (mh-in-show-buffer (mh-show-buffer) 418 (mh-in-show-buffer (mh-show-buffer)
427 (scroll-down arg))) 419 (scroll-down arg)))
428 420
429 421
430 (defun mh-previous-undeleted-msg (&optional arg) 422 (defun mh-previous-undeleted-msg (&optional arg)
431 "Move to previous undeleted message in window." 423 "Move to the NTH previous undeleted message in window."
432 (interactive "p") 424 (interactive "p")
433 (setq mh-next-direction 'backward) 425 (setq mh-next-direction 'backward)
434 (beginning-of-line) 426 (beginning-of-line)
435 (cond ((re-search-backward mh-good-msg-regexp nil 0 arg) 427 (cond ((re-search-backward mh-good-msg-regexp nil 0 arg)
436 (mh-maybe-show)) 428 (mh-maybe-show))
457 (interactive 449 (interactive
458 (list (mh-get-msg-num t) 450 (list (mh-get-msg-num t)
459 (let ((default-dir (if (eq 'write (car mh-last-destination)) 451 (let ((default-dir (if (eq 'write (car mh-last-destination))
460 (file-name-directory (car (cdr mh-last-destination))) 452 (file-name-directory (car (cdr mh-last-destination)))
461 default-directory))) 453 default-directory)))
462 (read-file-name "Save message in file: " default-dir 454 (read-file-name (format "Save message%s in file: "
463 (expand-file-name "mail.out" default-dir))) 455 (if current-prefix-arg " body" ""))
456 default-dir
457 (if (eq 'write (car mh-last-destination))
458 (car (cdr mh-last-destination))
459 (expand-file-name "mail.out" default-dir))))
464 current-prefix-arg)) 460 current-prefix-arg))
465 (let ((file-name (mh-msg-filename msg)) 461 (let ((msg-file-to-output (mh-msg-filename msg))
466 (output-file (mh-expand-file-name file))) 462 (output-file (mh-expand-file-name file)))
467 (setq mh-last-destination (list 'write file no-headers)) 463 (setq mh-last-destination (list 'write file (if no-headers 'no-headers)))
468 (save-excursion 464 (save-excursion
469 (set-buffer (get-buffer-create " *mh-temp*")) 465 (set-buffer (get-buffer-create mh-temp-buffer))
470 (erase-buffer) 466 (erase-buffer)
471 (insert-file-contents file-name) 467 (insert-file-contents msg-file-to-output)
472 (goto-char (point-min)) 468 (goto-char (point-min))
473 (if no-headers (search-forward "\n\n")) 469 (if no-headers (search-forward "\n\n"))
474 (append-to-file (point) (point-max) output-file)))) 470 (append-to-file (point) (point-max) output-file))))
475 471
476 472
481 (mh-set-scan-mode) 477 (mh-set-scan-mode)
482 (mh-show))) 478 (mh-show)))
483 479
484 480
485 (defun mh-undo (msg-or-seq) 481 (defun mh-undo (msg-or-seq)
486 "Undo the deletion or refile of the specified MESSAGE(s). 482 "Undo the pending deletion or refile of the specified MESSAGE(s).
487 Default is the displayed message. If optional prefix argument is 483 Default is the displayed message. If optional prefix argument is
488 provided, then prompt for the message sequence." 484 provided, then prompt for the message sequence."
489 (interactive (list (if current-prefix-arg 485 (interactive (list (if current-prefix-arg
490 (mh-read-seq-default "Undo" t) 486 (mh-read-seq-default "Undo" t)
491 (mh-get-msg-num t)))) 487 (mh-get-msg-num t))))
504 (mh-undo-msg (mh-get-msg-num t)) 500 (mh-undo-msg (mh-get-msg-num t))
505 (mh-maybe-show)) 501 (mh-maybe-show))
506 (goto-char original-position) 502 (goto-char original-position)
507 (error "Nothing to undo")))) 503 (error "Nothing to undo"))))
508 (t 504 (t
509 (mh-mapc (function mh-undo-msg) (mh-seq-to-msgs msg-or-seq)))) 505 (mh-map-to-seq-msgs 'mh-undo-msg msg-or-seq)))
510 ;; update the mh-refile-list so mh-outstanding-commands-p will work 506 ;; update the mh-refile-list so mh-outstanding-commands-p will work
511 (mh-mapc (function 507 (mh-mapc (function
512 (lambda (elt) 508 (lambda (elt)
513 (if (not (mh-seq-to-msgs elt)) 509 (if (not (mh-seq-to-msgs elt))
514 (setq mh-refile-list (delq elt mh-refile-list))))) 510 (setq mh-refile-list (delq elt mh-refile-list)))))
515 mh-refile-list) 511 mh-refile-list)
516 (if (not (mh-outstanding-commands-p)) 512 (if (not (mh-outstanding-commands-p))
517 (mh-set-folder-modified-p nil))) 513 (mh-set-folder-modified-p nil)))
518 514
519 515
516 ;;;###autoload
520 (defun mh-version () 517 (defun mh-version ()
521 "Display version information about mh-e and MH." 518 "Display version information about mh-e and the MH mail handling system."
522 (interactive) 519 (interactive)
523 (mh-find-progs) 520 (mh-find-progs)
524 (set-buffer (get-buffer-create " *mh-temp*")) 521 (set-buffer (get-buffer-create mh-temp-buffer))
525 (erase-buffer) 522 (erase-buffer)
526 (insert " mh-e info:\n\nversion: " mh-e-version "\n" mh-e-time-stamp 523 (insert " mh-e info:\n\nversion: " mh-e-version "\n" mh-e-time-stamp
527 "\nEmacs: " emacs-version " on " (symbol-name system-type) " ") 524 "\nEmacs: " emacs-version " on " (symbol-name system-type) " ")
528 (condition-case () 525 (condition-case ()
529 (call-process "uname" nil t nil "-a") 526 (call-process "uname" nil t nil "-a")
536 (goto-char help-start) 533 (goto-char help-start)
537 (search-forward "version: " nil t) 534 (search-forward "version: " nil t)
538 (beginning-of-line) 535 (beginning-of-line)
539 (delete-region help-start (point)) 536 (delete-region help-start (point))
540 (goto-char (point-min))) 537 (goto-char (point-min)))
541 (display-buffer " *mh-temp*")) 538 (display-buffer mh-temp-buffer))
542 539
543 540
544 (defun mh-visit-folder (folder &optional range) 541 (defun mh-visit-folder (folder &optional range)
545 "Visits FOLDER and displays RANGE of messages. 542 "Visit FOLDER and display RANGE of messages.
546 Assumes mh-e has already been initialized.
547 Do not call this function from outside mh-e; see \\[mh-rmail] instead." 543 Do not call this function from outside mh-e; see \\[mh-rmail] instead."
548 (interactive (list (mh-prompt-for-folder "Visit" "+inbox" t) 544 (interactive (list (mh-prompt-for-folder "Visit" mh-inbox t)
549 (mh-read-msg-range "Range [all]? "))) 545 (mh-read-msg-range "Range [all]? ")))
550 (let ((config (current-window-configuration))) 546 (let ((config (current-window-configuration)))
551 (mh-scan-folder folder (or range "all")) 547 (mh-scan-folder folder (or range "all"))
552 (setq mh-previous-window-config config)) 548 (setq mh-previous-window-config config))
553 nil) 549 nil)
554 550
555 551
556 (defun mh-compat-quit () 552 (defun mh-compat-quit ()
557 "\"b\" reserved for future use as mh-burst-digest; will assume you want \"\\[mh-quit]\" ..." 553 "The \"b\" key is obsolescent; will assume you want \"\\[mh-quit]\" ..."
558 ;; This is a temporary compatibility function 554 ;; Was going to make it run mh-burst-digest, but got complaint that
555 ;; 'b' should mean 'back', as it does in info, less, and rn.
556 ;; This is a temporary compatibility function.
559 (interactive) 557 (interactive)
560 (message "%s" (documentation this-command)) 558 (message "%s" (documentation this-command))
561 (sit-for 1) 559 (sit-for 1)
562 (call-interactively 'mh-quit)) 560 (call-interactively 'mh-quit))
561
562
563 (defun mh-update-sequences ()
564 "Update MH's Unseen sequence and current folder and message.
565 Flush mh-e's state out to MH. The message at the cursor becomes current."
566 (interactive)
567 ;; mh-update-sequences is the opposite of mh-read-folder-sequences,
568 ;; which updates mh-e's state from MH.
569 (let ((folder-set (mh-update-unseen))
570 (new-cur (mh-get-msg-num nil)))
571 (if new-cur
572 (let ((seq-entry (mh-find-seq 'cur)))
573 (mh-remove-cur-notation)
574 (setcdr seq-entry (list new-cur)) ;delete-seq-locally, add-msgs-to-seq
575 (mh-define-sequence 'cur (list new-cur))
576 (beginning-of-line)
577 (if (looking-at mh-good-msg-regexp)
578 (mh-notate nil mh-note-cur mh-cmd-note)))
579 (or folder-set
580 (save-excursion
581 (mh-exec-cmd-quiet t "folder" mh-current-folder "-fast"))))))
582
563 583
564 584
565 585
566 ;;; Support routines. 586 ;;; Support routines.
567 587
574 (if (looking-at mh-deleted-msg-regexp) 594 (if (looking-at mh-deleted-msg-regexp)
575 nil 595 nil
576 (mh-set-folder-modified-p t) 596 (mh-set-folder-modified-p t)
577 (setq mh-delete-list (cons msg mh-delete-list)) 597 (setq mh-delete-list (cons msg mh-delete-list))
578 (mh-add-msgs-to-seq msg 'deleted t) 598 (mh-add-msgs-to-seq msg 'deleted t)
579 (mh-notate msg ?D mh-cmd-note) 599 (mh-notate msg mh-note-deleted mh-cmd-note)
580 (run-hooks 'mh-delete-msg-hook)))) 600 (run-hooks 'mh-delete-msg-hook))))
581 601
582 (defun mh-refile-a-msg (msg destination) 602 (defun mh-refile-a-msg (msg destination)
583 ;; Refile MESSAGE in FOLDER. FOLDER is a symbol, not a string. 603 ;; Refile MESSAGE in FOLDER. FOLDER is a symbol, not a string.
584 (save-excursion 604 (save-excursion
597 (mh-set-folder-modified-p t) 617 (mh-set-folder-modified-p t)
598 (if (not (memq destination mh-refile-list)) 618 (if (not (memq destination mh-refile-list))
599 (setq mh-refile-list (cons destination mh-refile-list))) 619 (setq mh-refile-list (cons destination mh-refile-list)))
600 (if (not (memq msg (mh-seq-to-msgs destination))) 620 (if (not (memq msg (mh-seq-to-msgs destination)))
601 (mh-add-msgs-to-seq msg destination t)) 621 (mh-add-msgs-to-seq msg destination t))
602 (mh-notate msg ?^ mh-cmd-note) 622 (mh-notate msg mh-note-refiled mh-cmd-note)
603 (run-hooks 'mh-refile-msg-hook))))) 623 (run-hooks 'mh-refile-msg-hook)))))
604 624
605 625
606 (defun mh-next-msg () 626 (defun mh-next-msg ()
607 ;; Move backward or forward to the next undeleted message in the buffer. 627 ;; Move backward or forward to the next undeleted message in the buffer.
643 (setq buffer-read-only nil) 663 (setq buffer-read-only nil)
644 (erase-buffer) 664 (erase-buffer)
645 (setq buffer-read-only t) 665 (setq buffer-read-only t)
646 (mh-folder-mode) 666 (mh-folder-mode)
647 (mh-set-folder-modified-p nil) 667 (mh-set-folder-modified-p nil)
648 (setq buffer-file-name mh-folder-filename)) 668 (setq buffer-file-name mh-folder-filename)
669 (mh-make-folder-mode-line))
649 670
650 671
651 ;;; Ensure new buffers won't get this mode if default-major-mode is nil. 672 ;;; Ensure new buffers won't get this mode if default-major-mode is nil.
652 (put 'mh-folder-mode 'mode-class 'special) 673 (put 'mh-folder-mode 'mode-class 'special)
653 674
664 This list is purposefully not customized; mh-e has a long history, and many 685 This list is purposefully not customized; mh-e has a long history, and many
665 alternate key bindings as a result. This list is to encourage users to use 686 alternate key bindings as a result. This list is to encourage users to use
666 standard keys so the other keys can perhaps someday be put to new uses. 687 standard keys so the other keys can perhaps someday be put to new uses.
667 688
668 t toggle show or scan-only mode 689 t toggle show or scan-only mode
669 . show message, or back to top if already showing 690 RET show message, or back to top if already showing
670 691
671 SPC page forward 692 SPC page message forward
672 DEL page back 693 DEL page message back
673 694
674 n next message 695 n next message
675 p previous message 696 p previous message
676 j jump to message by number 697 g go to message by number
677 698
678 d mark for deletion 699 d mark for deletion
679 o, ^ mark for output (refile) to another folder 700 o, ^ mark for output (refile) to another folder
680 ? show folder of pending refile 701 ? show folder of pending refile
681 u undo delete or refile marking 702 u undo delete or refile marking
741 a messages is toggled off. 762 a messages is toggled off.
742 763
743 mh-summary-height (4) 764 mh-summary-height (4)
744 Number of lines in the summary window including the mode line. 765 Number of lines in the summary window including the mode line.
745 766
746 mh-ins-buf-prefix (\"> \")
747 String to insert before each non-blank line of a message as it is
748 inserted in a draft letter.
749
750 The value of mh-folder-mode-hook is called when a new folder is set up." 767 The value of mh-folder-mode-hook is called when a new folder is set up."
751 768
752 (kill-all-local-variables) 769 (kill-all-local-variables)
753 (use-local-map mh-folder-mode-map) 770 (use-local-map mh-folder-mode-map)
754 (setq major-mode 'mh-folder-mode) 771 (setq major-mode 'mh-folder-mode)
755 (mh-set-mode-name "MH-Folder") 772 (mh-set-mode-name "MH-Folder")
756 (make-local-vars 773 (mh-make-local-vars
757 'mh-current-folder (buffer-name) ; Name of folder, a string 774 'mh-current-folder (buffer-name) ; Name of folder, a string
758 'mh-show-buffer (format "show-%s" (buffer-name)) ; Buffer that displays msgs 775 'mh-show-buffer (format "show-%s" (buffer-name)) ; Buffer that displays msgs
759 'mh-folder-filename ; e.g. "/usr/foobar/Mail/inbox/" 776 'mh-folder-filename ; e.g. "/usr/foobar/Mail/inbox/"
760 (file-name-as-directory (mh-expand-file-name (buffer-name))) 777 (file-name-as-directory (mh-expand-file-name (buffer-name)))
761 'mh-showing nil ; Show message also? 778 'mh-showing nil ; Show message also?
762 'mh-next-seq-num 0 ; Index of free sequence id
763 'mh-delete-list nil ; List of msgs nums to delete 779 'mh-delete-list nil ; List of msgs nums to delete
764 'mh-refile-list nil ; List of folder names in mh-seq-list 780 'mh-refile-list nil ; List of folder names in mh-seq-list
765 'mh-seq-list nil ; Alist of (seq . msgs) nums 781 'mh-seq-list nil ; Alist of (seq . msgs) nums
766 'mh-seen-list nil ; List of displayed messages 782 'mh-seen-list nil ; List of displayed messages
767 'mh-next-direction 'forward ; Direction to move to next message 783 'mh-next-direction 'forward ; Direction to move to next message
768 'mh-narrowed-to-seq nil ; Sequence display is narrowed to 784 'mh-narrowed-to-seq nil ; Sequence display is narrowed to
769 'mh-first-msg-num nil ; Number of first msg in buffer 785 'mh-first-msg-num nil ; Number of first msg in buffer
770 'mh-last-msg-num nil ; Number of last msg in buffer 786 'mh-last-msg-num nil ; Number of last msg in buffer
787 'mh-mode-line-annotation nil ; Indiction this is not the full folder
771 'mh-previous-window-config nil) ; Previous window configuration 788 'mh-previous-window-config nil) ; Previous window configuration
772 (setq truncate-lines t) 789 (setq truncate-lines t)
773 (auto-save-mode -1) 790 (auto-save-mode -1)
774 (setq buffer-offer-save t) 791 (setq buffer-offer-save t)
775 (make-local-variable 'local-write-file-hooks) 792 (if (boundp 'local-write-file-hooks)
776 (setq local-write-file-hooks '(mh-execute-commands)) 793 (setq local-write-file-hooks '(mh-execute-commands)) ;Emacs 19
794 (make-local-variable 'write-file-hooks)
795 (setq write-file-hooks '(mh-execute-commands))) ;Emacs 18
777 (make-local-variable 'revert-buffer-function) 796 (make-local-variable 'revert-buffer-function)
778 (setq revert-buffer-function 'mh-undo-folder) 797 (setq revert-buffer-function 'mh-undo-folder)
779 (or (assq 'mh-showing minor-mode-alist) 798 (or (assq 'mh-showing minor-mode-alist)
780 (setq minor-mode-alist 799 (setq minor-mode-alist
781 (cons '(mh-showing " Show") minor-mode-alist))) 800 (cons '(mh-showing " Show") minor-mode-alist)))
782 (run-hooks 'mh-folder-mode-hook)) 801 (run-hooks 'mh-folder-mode-hook))
783 802
784 803
785 (defun make-local-vars (&rest pairs) 804 (defun mh-make-local-vars (&rest pairs)
786 ;; Take VARIABLE-VALUE pairs and makes local variables initialized to the 805 ;; Take VARIABLE-VALUE pairs and make local variables initialized to the
787 ;; value. 806 ;; value.
788 (while pairs 807 (while pairs
789 (make-variable-buffer-local (car pairs)) 808 (make-variable-buffer-local (car pairs))
790 (set (car pairs) (car (cdr pairs))) 809 (set (car pairs) (car (cdr pairs)))
791 (setq pairs (cdr (cdr pairs))))) 810 (setq pairs (cdr (cdr pairs)))))
805 (message "No messages in %s, range %s" folder range)) 824 (message "No messages in %s, range %s" folder range))
806 (sit-for 5))) 825 (sit-for 5)))
807 (mh-goto-cur-msg)) 826 (mh-goto-cur-msg))
808 827
809 828
810 (defun mh-regenerate-headers (range) 829 (defun mh-regenerate-headers (range &optional update)
811 ;; Replace buffer with scan of its contents over range RANGE. 830 ;; scan folder over range RANGE.
812 (let ((folder mh-current-folder)) 831 ;; If UPDATE, append the scan lines, otherwise replace.
832 (let ((folder mh-current-folder)
833 scan-start)
813 (message "Scanning %s..." folder) 834 (message "Scanning %s..." folder)
814 (with-mh-folder-updating (nil) 835 (with-mh-folder-updating (nil)
815 (erase-buffer) 836 (if update
837 (goto-char (point-max))
838 (erase-buffer))
839 (setq scan-start (point))
816 (mh-exec-cmd-output mh-scan-prog nil 840 (mh-exec-cmd-output mh-scan-prog nil
817 "-noclear" "-noheader" 841 "-noclear" "-noheader"
818 "-width" (window-width) 842 "-width" (window-width)
819 folder range) 843 folder range)
820 (goto-char (point-min)) 844 (goto-char scan-start)
821 (cond ((looking-at "scan: no messages in") 845 (cond ((looking-at "scan: no messages in")
822 (keep-lines mh-valid-scan-line)) ; Flush random scan lines 846 (keep-lines mh-valid-scan-line)) ; Flush random scan lines
823 ((looking-at "scan: ")) ; Keep error messages 847 ((looking-at "scan: ")) ; Keep error messages
824 (t 848 (t
825 (keep-lines mh-valid-scan-line))) ; Flush random scan lines 849 (keep-lines mh-valid-scan-line))) ; Flush random scan lines
826 (mh-delete-seq-locally 'cur) ; To pick up new one
827 (setq mh-seq-list (mh-read-folder-sequences folder nil)) 850 (setq mh-seq-list (mh-read-folder-sequences folder nil))
828 (mh-notate-user-sequences) 851 (mh-notate-user-sequences)
829 (mh-make-folder-mode-line (if (equal range "all") 852 (or update
830 nil 853 (setq mh-mode-line-annotation
831 mh-partial-folder-mode-line-annotation))) 854 (if (equal range "all")
855 nil
856 mh-partial-folder-mode-line-annotation)))
857 (mh-make-folder-mode-line))
832 (message "Scanning %s...done" folder))) 858 (message "Scanning %s...done" folder)))
833 859
834 860
835 (defun mh-get-new-mail (maildrop-name) 861 (defun mh-get-new-mail (maildrop-name)
836 ;; Read new mail from a maildrop into the current buffer. 862 ;; Read new mail from a maildrop into the current buffer.
844 (format "inc %s..." folder))) 870 (format "inc %s..." folder)))
845 (setq mh-next-direction 'forward) 871 (setq mh-next-direction 'forward)
846 (goto-char (point-max)) 872 (goto-char (point-max))
847 (let ((start-of-inc (point))) 873 (let ((start-of-inc (point)))
848 (if maildrop-name 874 (if maildrop-name
875 ;; I think MH 5 used "-ms-file" instead of "-file",
876 ;; which would make inc'ing from maildrops fail.
849 (mh-exec-cmd-output mh-inc-prog nil folder 877 (mh-exec-cmd-output mh-inc-prog nil folder
850 "-file" (expand-file-name maildrop-name) 878 "-file" (expand-file-name maildrop-name)
851 "-width" (window-width) 879 "-width" (window-width)
852 "-truncate") 880 "-truncate")
853 (mh-exec-cmd-output mh-inc-prog nil 881 (mh-exec-cmd-output mh-inc-prog nil
854 "-width" (window-width))) 882 "-width" (window-width)))
855 (message 883 (message
856 (if maildrop-name 884 (if maildrop-name
857 (format "inc %s -file %s...done" folder maildrop-name) 885 (format "inc %s -file %s...done" folder maildrop-name)
858 (format "inc %s...done" folder))) 886 (format "inc %s...done" folder)))
859 (goto-char start-of-inc) 887 (goto-char start-of-inc)
860 (cond ((looking-at "inc: no mail") 888 (cond ((save-excursion
889 (re-search-forward "^inc: no mail" nil t))
861 (message "No new mail%s%s" (if maildrop-name " in " "") 890 (message "No new mail%s%s" (if maildrop-name " in " "")
862 (if maildrop-name maildrop-name ""))) 891 (if maildrop-name maildrop-name "")))
863 ((re-search-forward "^inc:" nil t) ; Error messages 892 ((re-search-forward "^inc:" nil t) ; Error messages
864 (error "inc error")) 893 (error "inc error"))
865 (t 894 (t
866 ;; remove old cur notation (cf mh-goto-cur-msg code) 895 (mh-remove-cur-notation)
867 (let ((cur-msg (car (mh-seq-to-msgs 'cur))))
868 (save-excursion
869 (and cur-msg
870 (mh-goto-msg cur-msg t nil)
871 (looking-at mh-cur-scan-msg-regexp)
872 (mh-notate nil ? mh-cmd-note))))
873 (setq new-mail-p t))) 896 (setq new-mail-p t)))
874 (keep-lines mh-valid-scan-line) ; Flush random scan lines 897 (keep-lines mh-valid-scan-line) ; Flush random scan lines
875 (mh-delete-seq-locally 'cur) ; To pick up new one
876 (setq mh-seq-list (mh-read-folder-sequences folder t)) 898 (setq mh-seq-list (mh-read-folder-sequences folder t))
877 (mh-notate-user-sequences) 899 (mh-notate-user-sequences)
878 (if new-mail-p 900 (if new-mail-p
879 (progn 901 (progn
880 (mh-goto-cur-msg) 902 (mh-goto-cur-msg)
881 (mh-make-folder-mode-line)) 903 (mh-make-folder-mode-line))
882 (goto-char point-before-inc)))))) 904 (goto-char point-before-inc))))))
883 905
884 906
885 (defun mh-make-folder-mode-line (&optional annotation) 907 (defun mh-make-folder-mode-line (&optional ignored)
886 ;; Set the fields of the mode line for a folder buffer. 908 ;; Set the fields of the mode line for a folder buffer.
887 ;; The optional ANNOTATION string is displayed after the folder's name. 909 ;; The optional argument is now obsolete. It used to be used to pass
910 ;; in what is now stored in the buffer-local variable
911 ;; mh-mode-line-annotation.
888 (save-excursion 912 (save-excursion
889 (mh-first-msg) 913 (mh-first-msg)
890 (setq mh-first-msg-num (mh-get-msg-num nil)) 914 (setq mh-first-msg-num (mh-get-msg-num nil))
891 (mh-last-msg) 915 (mh-last-msg)
892 (setq mh-last-msg-num (mh-get-msg-num nil)) 916 (setq mh-last-msg-num (mh-get-msg-num nil))
893 (let ((lines (count-lines (point-min) (point-max)))) 917 (let ((lines (count-lines (point-min) (point-max))))
894 (setq mode-line-buffer-identification 918 (setq mode-line-buffer-identification
895 (list (format "{%%b%s} %d msg%s" 919 (list (format "{%%b%s} %d msg%s"
896 (if annotation (format "/%s" annotation) "") 920 (if mh-mode-line-annotation
921 (format "/%s" mh-mode-line-annotation)
922 "")
897 lines 923 lines
898 (if (zerop lines) 924 (if (zerop lines)
899 "s" 925 "s"
900 (if (> lines 1) 926 (if (> lines 1)
901 (format "s (%d-%d)" mh-first-msg-num 927 (format "s (%d-%d)" mh-first-msg-num
907 ;; Remove all '+' flags from the headers, and if called with a non-nil 933 ;; Remove all '+' flags from the headers, and if called with a non-nil
908 ;; argument, remove all 'D', '^' and '%' flags too. 934 ;; argument, remove all 'D', '^' and '%' flags too.
909 ;; Optimized for speed (i.e., no regular expressions). 935 ;; Optimized for speed (i.e., no regular expressions).
910 (save-excursion 936 (save-excursion
911 (let ((case-fold-search nil) 937 (let ((case-fold-search nil)
912 (last-line (- (point-max) mh-cmd-note)) 938 (last-line (1- (point-max)))
913 char) 939 char)
914 (mh-first-msg) 940 (mh-first-msg)
915 (while (<= (point) last-line) 941 (while (<= (point) last-line)
916 (forward-char mh-cmd-note) 942 (forward-char mh-cmd-note)
917 (setq char (following-char)) 943 (setq char (following-char))
918 (if (or (and remove-all-flags 944 (if (or (and remove-all-flags
919 (or (eql char ?D) 945 (or (eql char (aref mh-note-deleted 0))
920 (eql char ?^) 946 (eql char (aref mh-note-refiled 0))))
921 (eql char ?%))) 947 (eql char (aref mh-note-cur 0)))
922 (eql char ?+))
923 (progn 948 (progn
924 (delete-char 1) 949 (delete-char 1)
925 (insert " "))) 950 (insert " ")))
951 (if remove-all-flags
952 (progn
953 (forward-char 1)
954 (if (eql (following-char) (aref mh-note-seq 0))
955 (progn
956 (delete-char 1)
957 (insert " ")))))
926 (forward-line))))) 958 (forward-line)))))
927 959
960
961 (defun mh-remove-cur-notation ()
962 ;; Remove old cur notation (cf mh-goto-cur-msg code).
963 (let ((cur-msg (car (mh-seq-to-msgs 'cur))))
964 (save-excursion
965 (and cur-msg
966 (mh-goto-msg cur-msg t t)
967 (looking-at mh-cur-scan-msg-regexp)
968 (mh-notate nil ? mh-cmd-note)))))
928 969
929 (defun mh-goto-cur-msg () 970 (defun mh-goto-cur-msg ()
930 ;; Position the cursor at the current message. 971 ;; Position the cursor at the current message.
931 (let ((cur-msg (car (mh-seq-to-msgs 'cur)))) 972 (let ((cur-msg (car (mh-seq-to-msgs 'cur))))
932 (cond ((and cur-msg 973 (cond ((and cur-msg
933 (mh-goto-msg cur-msg t nil)) 974 (mh-goto-msg cur-msg t t))
934 (mh-notate nil ?+ mh-cmd-note) 975 (mh-notate nil mh-note-cur mh-cmd-note)
935 (mh-recenter 0) 976 (mh-recenter 0)
936 (mh-maybe-show cur-msg)) 977 (mh-maybe-show cur-msg))
937 (t 978 (t
938 (mh-last-msg) 979 (mh-last-msg)
939 (message "No current message"))))) 980 (message "No current message")))))
966 (function 1007 (function
967 (lambda (dest) 1008 (lambda (dest)
968 (let ((msgs (mh-seq-to-msgs dest))) 1009 (let ((msgs (mh-seq-to-msgs dest)))
969 (cond (msgs 1010 (cond (msgs
970 (apply 'mh-exec-cmd "refile" 1011 (apply 'mh-exec-cmd "refile"
971 "-src" folder (symbol-name dest) msgs) 1012 "-src" folder (symbol-name dest)
1013 (mh-coalesce-msg-list msgs))
972 (mh-delete-scan-msgs msgs)))))) 1014 (mh-delete-scan-msgs msgs))))))
973 mh-refile-list) 1015 mh-refile-list)
974 (setq mh-refile-list nil) 1016 (setq mh-refile-list nil)
975 1017
976 ;; Now delete messages 1018 ;; Now delete messages
977 (cond (mh-delete-list 1019 (cond (mh-delete-list
978 (apply 'mh-exec-cmd "rmm" folder mh-delete-list) 1020 (apply 'mh-exec-cmd "rmm" folder
1021 (mh-coalesce-msg-list mh-delete-list))
979 (mh-delete-scan-msgs mh-delete-list) 1022 (mh-delete-scan-msgs mh-delete-list)
980 (setq mh-delete-list nil))) 1023 (setq mh-delete-list nil)))
981 1024
982 ;; Don't need to remove sequences since delete and refile do so. 1025 ;; Don't need to remove sequences since delete and refile do so.
983 1026
984 ;; Mark cur message 1027 ;; Mark cur message
985 (if (> (buffer-size) 0) 1028 (if (> (buffer-size) 0)
986 (mh-define-sequence 'cur (or (mh-get-msg-num nil) "last"))) 1029 (mh-define-sequence 'cur (list (or (mh-get-msg-num nil) "last"))))
987 1030
988 (and (buffer-file-name (get-buffer mh-show-buffer)) 1031 (and (buffer-file-name (get-buffer mh-show-buffer))
989 (not (file-exists-p (buffer-file-name (get-buffer mh-show-buffer)))) 1032 (not (file-exists-p (buffer-file-name (get-buffer mh-show-buffer))))
990 ;; If "inc" were to put a new msg in this file, 1033 ;; If "inc" were to put a new msg in this file,
991 ;; we would not notice, so mark it invalid now. 1034 ;; we would not notice, so mark it invalid now.
996 (mh-notate-user-sequences) 1039 (mh-notate-user-sequences)
997 (message "Processing deletes and refiles for %s...done" folder))) 1040 (message "Processing deletes and refiles for %s...done" folder)))
998 1041
999 1042
1000 (defun mh-update-unseen () 1043 (defun mh-update-unseen ()
1001 ;; Push updates to the Unseen sequence out to MH. 1044 ;; Flush updates to the Unseen sequence out to MH.
1045 ;; Return non-NIL iff set the MH folder.
1002 (if mh-seen-list 1046 (if mh-seen-list
1003 (progn 1047 (let* ((unseen-seq (mh-find-seq mh-unseen-seq))
1004 (if (mh-seq-to-msgs mh-unseen-seq) 1048 (unseen-msgs (mh-seq-msgs unseen-seq)))
1005 (mh-undefine-sequence mh-unseen-seq mh-seen-list)) 1049 (if unseen-msgs
1006 (setq mh-seen-list nil)))) 1050 (progn
1051 (mh-undefine-sequence mh-unseen-seq mh-seen-list)
1052 (while mh-seen-list
1053 (setq unseen-msgs (delq (car mh-seen-list) unseen-msgs))
1054 (setq mh-seen-list (cdr mh-seen-list)))
1055 (setcdr unseen-seq unseen-msgs)
1056 t) ;since we set the folder
1057 (setq mh-seen-list nil)))))
1007 1058
1008 1059
1009 (defun mh-delete-scan-msgs (msgs) 1060 (defun mh-delete-scan-msgs (msgs)
1010 ;; Delete the scan listing lines for each of the msgs in the LIST. 1061 ;; Delete the scan listing lines for each of the msgs in the LIST.
1011 ;; Optimized for speed (i.e., no regular expressions). 1062 ;; Optimized for speed (i.e., no regular expressions).
1012 (setq msgs (sort msgs (function <))) ;okay to clobber msgs 1063 (setq msgs (sort msgs '<)) ;okay to clobber msgs
1013 (save-excursion 1064 (save-excursion
1014 (mh-first-msg) 1065 (mh-first-msg)
1015 (while (and msgs (< (point) (point-max))) 1066 (while (and msgs (< (point) (point-max)))
1016 (cond ((equal (mh-get-msg-num nil) (car msgs)) 1067 (cond ((equal (mh-get-msg-num nil) (car msgs))
1017 (delete-region (point) (save-excursion (forward-line) (point))) 1068 (delete-region (point) (save-excursion (forward-line) (point)))
1021 1072
1022 1073
1023 (defun mh-outstanding-commands-p () 1074 (defun mh-outstanding-commands-p ()
1024 ;; Returns non-nil if there are outstanding deletes or refiles. 1075 ;; Returns non-nil if there are outstanding deletes or refiles.
1025 (or mh-delete-list mh-refile-list)) 1076 (or mh-delete-list mh-refile-list))
1077
1078
1079 (defun mh-coalesce-msg-list (messages)
1080 ;; Give a list of MESSAGES, return a list of message number ranges.
1081 ;; Sort of the opposite of mh-read-msg-list, which expands ranges.
1082 ;; Message lists passed to MH programs go through this so
1083 ;; command line arguments won't exceed system limits.
1084 (let ((msgs (sort (copy-sequence messages) 'mh-greaterp))
1085 (range-high nil)
1086 (prev -1)
1087 (ranges nil))
1088 (while prev
1089 (if range-high
1090 (if (or (not (numberp prev))
1091 (not (eql (car msgs) (1- prev))))
1092 (progn ;non-sequential, flush old range
1093 (if (eql prev range-high)
1094 (setq ranges (cons range-high ranges))
1095 (setq ranges (cons (format "%s-%s" prev range-high) ranges)))
1096 (setq range-high nil))))
1097 (or range-high
1098 (setq range-high (car msgs))) ;start new or first range
1099 (setq prev (car msgs))
1100 (setq msgs (cdr msgs)))
1101 ranges))
1102
1103 (defun mh-greaterp (msg1 msg2)
1104 ;; Sort two message indicators. Strings are "smaller" than numbers.
1105 ;; Legal values are things like "cur", "last", 1, and 1820.
1106 (if (numberp msg1)
1107 (if (numberp msg2)
1108 (> msg1 msg2)
1109 t)
1110 (if (numberp msg2)
1111 nil
1112 (string-lessp msg2 msg1))))
1026 1113
1027 1114
1028 1115
1029 ;;; Basic sequence handling 1116 ;;; Basic sequence handling
1030 1117
1056 (delete-region (point-min) (point))))) ; avoid race with mh-process-daemon 1143 (delete-region (point-min) (point))))) ; avoid race with mh-process-daemon
1057 seqs)) 1144 seqs))
1058 1145
1059 (defun mh-read-msg-list () 1146 (defun mh-read-msg-list ()
1060 ;; Return a list of message numbers from the current point to the end of 1147 ;; Return a list of message numbers from the current point to the end of
1061 ;; the line. 1148 ;; the line. Expands ranges into set of individual numbers.
1062 (let ((msgs ()) 1149 (let ((msgs ())
1063 (end-of-line (save-excursion (end-of-line) (point))) 1150 (end-of-line (save-excursion (end-of-line) (point)))
1064 num) 1151 num)
1065 (while (re-search-forward "[0-9]+" end-of-line t) 1152 (while (re-search-forward "[0-9]+" end-of-line t)
1066 (setq num (string-to-int (buffer-substring (match-beginning 0) 1153 (setq num (string-to-int (buffer-substring (match-beginning 0)
1073 (if (< num2 num) 1160 (if (< num2 num)
1074 (error "Bad message range: %d-%d" num num2)) 1161 (error "Bad message range: %d-%d" num num2))
1075 (while (<= num num2) 1162 (while (<= num num2)
1076 (setq msgs (cons num msgs)) 1163 (setq msgs (cons num msgs))
1077 (setq num (1+ num))))) 1164 (setq num (1+ num)))))
1078 ((not (zerop num)) (setq msgs (cons num msgs))))) 1165 ((not (zerop num)) ;"pick" outputs "0" to mean no match
1166 (setq msgs (cons num msgs)))))
1079 msgs)) 1167 msgs))
1080 1168
1081 (defun mh-notate-user-sequences () 1169 (defun mh-notate-user-sequences ()
1082 ;; Mark the scan listing of all messages in user-defined sequences. 1170 ;; Mark the scan listing of all messages in user-defined sequences.
1083 (let ((seqs mh-seq-list) 1171 (let ((seqs mh-seq-list)
1084 name) 1172 name)
1085 (while seqs 1173 (while seqs
1086 (setq name (mh-seq-name (car seqs))) 1174 (setq name (mh-seq-name (car seqs)))
1087 (if (not (mh-internal-seq name)) 1175 (if (not (mh-internal-seq name))
1088 (mh-notate-seq name ?% (1+ mh-cmd-note))) 1176 (mh-notate-seq name mh-note-seq (1+ mh-cmd-note)))
1089 (setq seqs (cdr seqs))))) 1177 (setq seqs (cdr seqs)))))
1090 1178
1091 1179
1092 (defun mh-internal-seq (name) 1180 (defun mh-internal-seq (name)
1093 ;; Return non-NIL if NAME is the name of an internal mh-e sequence. 1181 ;; Return non-NIL if NAME is the name of an internal mh-e sequence.
1095 (eq name mh-unseen-seq) 1183 (eq name mh-unseen-seq)
1096 (eq name mh-previous-seq) 1184 (eq name mh-previous-seq)
1097 (mh-folder-name-p name))) 1185 (mh-folder-name-p name)))
1098 1186
1099 1187
1100 (defun mh-delete-msg-from-seq (msg seq &optional internal-flag) 1188 (defun mh-delete-msg-from-seq (message sequence &optional internal-flag)
1101 "Delete MESSAGE from SEQUENCE. MESSAGE defaults to displayed message. 1189 "Delete MESSAGE from SEQUENCE. MESSAGE defaults to displayed message.
1102 From Lisp, optional third arg INTERNAL non-nil means do not 1190 From Lisp, optional third arg INTERNAL-FLAG non-nil means do not
1103 inform MH of the change." 1191 inform MH of the change."
1104 (interactive (list (mh-get-msg-num t) 1192 (interactive (list (mh-get-msg-num t)
1105 (mh-read-seq-default "Delete from" t) 1193 (mh-read-seq-default "Delete from" t)
1106 nil)) 1194 nil))
1107 (let ((entry (mh-find-seq seq))) 1195 (let ((entry (mh-find-seq sequence)))
1108 (cond (entry 1196 (cond (entry
1109 (mh-notate-if-in-one-seq msg ? (1+ mh-cmd-note) (mh-seq-name entry)) 1197 (mh-notate-if-in-one-seq message ? (1+ mh-cmd-note) sequence)
1110 (if (not internal-flag) 1198 (if (not internal-flag)
1111 (mh-undefine-sequence seq msg)) 1199 (mh-undefine-sequence sequence (list message)))
1112 (setcdr entry (delq msg (mh-seq-msgs entry))))))) 1200 (setcdr entry (delq message (mh-seq-msgs entry)))))))
1113 1201
1114 1202
1115 (defun mh-undefine-sequence (seq msgs) 1203 (defun mh-undefine-sequence (seq msgs)
1116 ;; Remove from the SEQUENCE the MSGS, which may be a list or single msg. 1204 ;; Remove from the SEQUENCE the list of MSGS.
1117 (mh-exec-cmd "mark" mh-current-folder "-delete" 1205 (mh-exec-cmd "mark" mh-current-folder "-delete"
1118 "-sequence" (symbol-name seq) 1206 "-sequence" (symbol-name seq)
1119 msgs)) 1207 (mh-coalesce-msg-list msgs)))
1120 1208
1121 1209
1122 (defun mh-define-sequence (seq msgs) 1210 (defun mh-define-sequence (seq msgs)
1123 ;; Define the SEQUENCE to contain the list of MSGS. 1211 ;; Define the SEQUENCE to contain the list of MSGS.
1124 ;; Do not mark pseudo-sequences or empty sequences. 1212 ;; Do not mark pseudo-sequences or empty sequences.
1126 (if (and msgs 1214 (if (and msgs
1127 (not (mh-folder-name-p seq))) 1215 (not (mh-folder-name-p seq)))
1128 (save-excursion 1216 (save-excursion
1129 (mh-exec-cmd-error nil "mark" mh-current-folder "-add" "-zero" 1217 (mh-exec-cmd-error nil "mark" mh-current-folder "-add" "-zero"
1130 "-sequence" (symbol-name seq) 1218 "-sequence" (symbol-name seq)
1131 msgs)))) 1219 (mh-coalesce-msg-list msgs)))))
1132
1133
1134 (defun mh-define-sequences (seq-list)
1135 ;; Define the sequences in SEQ-LIST.
1136 (mh-map-over-seqs 'mh-define-sequence seq-list))
1137 1220
1138 1221
1139 (defun mh-map-over-seqs (func seq-list) 1222 (defun mh-map-over-seqs (func seq-list)
1140 ;; Apply the FUNCTION to each element in the list of SEQUENCES, 1223 ;; Apply the FUNCTION to each element in the list of SEQUENCES,
1141 ;; passing the sequence name and the list of messages as arguments. 1224 ;; passing the sequence name and the list of messages as arguments.
1146 1229
1147 (defun mh-notate-if-in-one-seq (msg notation offset seq) 1230 (defun mh-notate-if-in-one-seq (msg notation offset seq)
1148 ;; If the MESSAGE is in only the SEQUENCE, then mark the scan listing of the 1231 ;; If the MESSAGE is in only the SEQUENCE, then mark the scan listing of the
1149 ;; message with the CHARACTER at the given OFFSET from the beginning of the 1232 ;; message with the CHARACTER at the given OFFSET from the beginning of the
1150 ;; listing line. 1233 ;; listing line.
1151 (let ((in-seqs (mh-seq-containing-msg msg))) 1234 (let ((in-seqs (mh-seq-containing-msg msg nil)))
1152 (if (and (eq seq (car in-seqs)) (null (cdr in-seqs))) 1235 (if (and (eq seq (car in-seqs)) (null (cdr in-seqs)))
1153 (mh-notate msg notation offset)))) 1236 (mh-notate msg notation offset))))
1154 1237
1155 1238
1156 (defun mh-seq-containing-msg (msg) 1239 (defun mh-seq-containing-msg (msg &optional include-internal-p)
1157 ;; Return a list of the sequences containing MESSAGE. 1240 ;; Return a list of the sequences containing MESSAGE.
1241 ;; If INCLUDE-INTERNAL-P non-nil, include mh-e internal sequences in list.
1158 (let ((l mh-seq-list) 1242 (let ((l mh-seq-list)
1159 (seqs ())) 1243 (seqs ()))
1160 (while l 1244 (while l
1161 (if (memq msg (mh-seq-msgs (car l))) 1245 (and (memq msg (mh-seq-msgs (car l)))
1162 (setq seqs (cons (mh-seq-name (car l)) seqs))) 1246 (or include-internal-p
1247 (not (mh-internal-seq (mh-seq-name (car l)))))
1248 (setq seqs (cons (mh-seq-name (car l)) seqs)))
1163 (setq l (cdr l))) 1249 (setq l (cdr l)))
1164 seqs)) 1250 seqs))
1165 1251
1166 1252
1167 1253
1221 (define-key mh-folder-mode-map "s" 'mh-send) 1307 (define-key mh-folder-mode-map "s" 'mh-send)
1222 (define-key mh-folder-mode-map "r" 'mh-reply) 1308 (define-key mh-folder-mode-map "r" 'mh-reply)
1223 (define-key mh-folder-mode-map "a" 'mh-reply) 1309 (define-key mh-folder-mode-map "a" 'mh-reply)
1224 (define-key mh-folder-mode-map "j" 'mh-goto-msg) 1310 (define-key mh-folder-mode-map "j" 'mh-goto-msg)
1225 (define-key mh-folder-mode-map "g" 'mh-goto-msg) 1311 (define-key mh-folder-mode-map "g" 'mh-goto-msg)
1312 (define-key mh-folder-mode-map "\e<" 'mh-first-msg)
1226 (define-key mh-folder-mode-map "\e>" 'mh-last-msg) 1313 (define-key mh-folder-mode-map "\e>" 'mh-last-msg)
1227 (define-key mh-folder-mode-map "\177" 'mh-previous-page) 1314 (define-key mh-folder-mode-map "\177" 'mh-previous-page)
1228 (define-key mh-folder-mode-map " " 'mh-page-msg) 1315 (define-key mh-folder-mode-map " " 'mh-page-msg)
1316 (define-key mh-folder-mode-map "\r" 'mh-show)
1229 (define-key mh-folder-mode-map "." 'mh-show) 1317 (define-key mh-folder-mode-map "." 'mh-show)
1230 (define-key mh-folder-mode-map "," 'mh-header-display) 1318 (define-key mh-folder-mode-map "," 'mh-header-display)
1231 (define-key mh-folder-mode-map "u" 'mh-undo) 1319 (define-key mh-folder-mode-map "u" 'mh-undo)
1232 (define-key mh-folder-mode-map "d" 'mh-delete-msg) 1320 (define-key mh-folder-mode-map "d" 'mh-delete-msg)
1233 (define-key mh-folder-mode-map "\C-d" 'mh-delete-msg-no-motion) 1321 (define-key mh-folder-mode-map "\C-d" 'mh-delete-msg-no-motion)
1244 ;;;autoload the other mh-e parts 1332 ;;;autoload the other mh-e parts
1245 1333
1246 ;;; mh-comp 1334 ;;; mh-comp
1247 1335
1248 (autoload 'mh-smail "mh-comp" 1336 (autoload 'mh-smail "mh-comp"
1249 "Compose and send mail with the MH mail system." t) 1337 "Compose and send mail with the MH mail system.
1338 This function is an entry point to mh-e, the Emacs front end
1339 to the MH mail system.
1340 See documentation of `\\[mh-send]' for more details on composing mail." t)
1341
1250 (autoload 'mh-smail-other-window "mh-comp" 1342 (autoload 'mh-smail-other-window "mh-comp"
1251 "Compose and send mail in other window with the MH mail system." t) 1343 "Compose and send mail in other window with the MH mail system.
1344 This function is an entry point to mh-e, the Emacs front end
1345 to the MH mail system.
1346 See documentation of `\\[mh-send]' for more details on composing mail." t)
1347
1252 (autoload 'mh-edit-again "mh-comp" 1348 (autoload 'mh-edit-again "mh-comp"
1253 "Clean-up a draft or a message previously sent and make it resendable." t) 1349 "Clean-up a draft or a message previously sent and make it resendable.
1350 Default is the current message.
1351 The variable mh-new-draft-cleaned-headers specifies the headers to remove.
1352 See also documentation for `\\[mh-send]' function." t)
1353
1254 (autoload 'mh-extract-rejected-mail "mh-comp" 1354 (autoload 'mh-extract-rejected-mail "mh-comp"
1255 "Extract a letter returned by the mail system and make it resendable." t) 1355 "Extract a letter returned by the mail system and make it resendable.
1356 Default is the current message. The variable mh-new-draft-cleaned-headers
1357 gives the headers to clean out of the original message.
1358 See also documentation for `\\[mh-send]' function." t)
1359
1256 (autoload 'mh-forward "mh-comp" 1360 (autoload 'mh-forward "mh-comp"
1257 "Forward MESSAGE(s) (default: displayed message)." t) 1361 "Forward a message or message sequence. Defaults to displayed message.
1362 If optional prefix argument provided, then prompt for the message sequence.
1363 See also documentation for `\\[mh-send]' function." t)
1364
1258 (autoload 'mh-redistribute "mh-comp" 1365 (autoload 'mh-redistribute "mh-comp"
1259 "Redistribute a letter." t) 1366 "Redistribute a letter.
1367 Depending on how your copy of MH was compiled, you may need to change the
1368 setting of the variable mh-redist-full-contents. See its documentation." t)
1369
1260 (autoload 'mh-reply "mh-comp" 1370 (autoload 'mh-reply "mh-comp"
1261 "Reply to a MESSAGE (default: displayed message)." t) 1371 "Reply to a MESSAGE (default: displayed message).
1372 If optional prefix argument INCLUDEP provided, then include the message
1373 in the reply using filter mhl.reply in your MH directory.
1374 Prompts for type of addresses to reply to:
1375 from sender only,
1376 to sender and primary recipients,
1377 cc/all sender and all recipients.
1378 If the file named by `mh-repl-formfile' exists, it is used as a skeleton
1379 for the reply. See also documentation for `\\[mh-send]' function." t)
1380
1262 (autoload 'mh-send "mh-comp" 1381 (autoload 'mh-send "mh-comp"
1263 "Compose and send a letter." t) 1382 "Compose and send a letter.
1383 The file named by `mh-comp-formfile' will be used as the form.
1384 Do not call this function from outside mh-e; use \\[mh-smail] instead.
1385 The letter is composed in mh-letter-mode; see its documentation for more
1386 details. If `mh-compose-letter-function' is defined, it is called on the
1387 draft and passed three arguments: to, subject, and cc." t)
1388
1264 (autoload 'mh-send-other-window "mh-comp" 1389 (autoload 'mh-send-other-window "mh-comp"
1265 "Compose and send a letter in another window." t) 1390 "Compose and send a letter in another window.
1391 Do not call this function from outside mh-e;
1392 use \\[mh-smail-other-window] instead.
1393 See also documentation for `\\[mh-send]' function." t)
1394
1266 (autoload 'mh-letter-mode "mh-comp" 1395 (autoload 'mh-letter-mode "mh-comp"
1267 "Mode for composing letters in mh-e." t) 1396 "Mode for composing letters in mh-e.
1397 For more details, type \\[describe-mode] while in MH-Letter mode." t)
1268 1398
1269 1399
1270 ;;; mh-funcs 1400 ;;; mh-funcs
1271 1401
1272 (autoload 'mh-burst-digest "mh-funcs" 1402 (autoload 'mh-burst-digest "mh-funcs"
1273 "Burst apart the current message, which should be a digest." t) 1403 "Burst apart the current message, which should be a digest.
1404 The message is replaced by its table of contents and the messages from the
1405 digest are inserted into the folder after that message." t)
1406
1274 (autoload 'mh-copy-msg "mh-funcs" 1407 (autoload 'mh-copy-msg "mh-funcs"
1275 "Copy specified MESSAGE(s) to another FOLDER without deleting them." t) 1408 "Copy to another FOLDER the specified MESSAGE(s) without deleting them.
1409 Default is the displayed message. If optional prefix argument is
1410 provided, then prompt for the message sequence." t)
1411
1276 (autoload 'mh-kill-folder "mh-funcs" 1412 (autoload 'mh-kill-folder "mh-funcs"
1277 "Remove the current folder." t) 1413 "Remove the current folder." t)
1414
1278 (autoload 'mh-list-folders "mh-funcs" 1415 (autoload 'mh-list-folders "mh-funcs"
1279 "List mail folders." t) 1416 "List mail folders." t)
1417
1280 (autoload 'mh-pack-folder "mh-funcs" 1418 (autoload 'mh-pack-folder "mh-funcs"
1281 "Renumber the messages of a folder to be 1..n." t) 1419 "Renumber the messages of a folder to be 1..n.
1420 First, offer to execute any outstanding commands for the current folder.
1421 If optional prefix argument provided, prompt for the range of messages
1422 to display after packing. Otherwise, show the entire folder." t)
1423
1282 (autoload 'mh-pipe-msg "mh-funcs" 1424 (autoload 'mh-pipe-msg "mh-funcs"
1283 "Pipe the current message through the given shell COMMAND." t) 1425 "Pipe the current message through the given shell COMMAND.
1426 If INCLUDE-HEADERS (prefix argument) is provided, send the entire message.
1427 Otherwise just send the message's body without the headers." t)
1428
1284 (autoload 'mh-page-digest "mh-funcs" 1429 (autoload 'mh-page-digest "mh-funcs"
1285 "Advance displayed message to next digested message." t) 1430 "Advance displayed message to next digested message." t)
1431
1286 (autoload 'mh-page-digest-backwards "mh-funcs" 1432 (autoload 'mh-page-digest-backwards "mh-funcs"
1287 "Back up displayed message to previous digested message." t) 1433 "Back up displayed message to previous digested message." t)
1434
1288 (autoload 'mh-print-msg "mh-funcs" 1435 (autoload 'mh-print-msg "mh-funcs"
1289 "Print MESSAGE(s) (default: displayed message) on a line printer." t) 1436 "Print MESSAGE(s) (default: displayed message) on printer.
1437 If optional prefix argument provided, then prompt for the message sequence.
1438 The variable mh-lpr-command-format is used to generate the print command.
1439 The messages are formatted by mhl. See the variable mhl-formfile." t)
1440
1290 (autoload 'mh-sort-folder "mh-funcs" 1441 (autoload 'mh-sort-folder "mh-funcs"
1291 "Sort the messages in the current folder by date." t) 1442 "Sort the messages in the current folder by date.
1443 Calls the MH program sortm to do the work.
1444 The arguments in the list mh-sortm-args are passed to sortm
1445 if this function is passed an argument." t)
1446
1292 (autoload 'mh-undo-folder "mh-funcs" 1447 (autoload 'mh-undo-folder "mh-funcs"
1293 "Undo all commands in current folder." t) 1448 "Undo all commands in current folder." t)
1449
1294 (autoload 'mh-store-msg "mh-funcs" 1450 (autoload 'mh-store-msg "mh-funcs"
1295 "Store the file(s) contained in the current message into DIRECTORY. 1451 "Store the file(s) contained in the current message into DIRECTORY.
1296 The message can contain a shar file or uuencoded file." t) 1452 The message can contain a shar file or uuencoded file.
1453 Default directory is the last directory used, or initially the value of
1454 mh-store-default-directory or the current directory." t)
1455
1297 (autoload 'mh-store-buffer "mh-funcs" 1456 (autoload 'mh-store-buffer "mh-funcs"
1298 "Store the file(s) contained in the current buffer into DIRECTORY. 1457 "Store the file(s) contained in the current buffer into DIRECTORY.
1299 The buffer can contain a shar file or uuencoded file." t) 1458 The buffer can contain a shar file or uuencoded file.
1459 Default directory is the last directory used, or initially the value of
1460 `mh-store-default-directory' or the current directory." t)
1300 1461
1301 1462
1302 ;;; mh-pick 1463 ;;; mh-pick
1303 1464
1304 (autoload 'mh-search-folder "mh-pick" 1465 (autoload 'mh-search-folder "mh-pick"
1305 "Search FOLDER for messages matching a pattern." t) 1466 "Search FOLDER for messages matching a pattern.
1467 Add the messages found to the sequence named `search'." t)
1306 1468
1307 ;;; mh-seq 1469 ;;; mh-seq
1308 1470
1309 (autoload 'mh-put-msg-in-seq "mh-seq"
1310 "Add MESSAGE(s) (default: displayed message) to SEQUENCE." t)
1311 (autoload 'mh-delete-seq "mh-seq" 1471 (autoload 'mh-delete-seq "mh-seq"
1312 "Delete the SEQUENCE." t) 1472 "Delete the SEQUENCE." t)
1313 (autoload 'mh-list-sequences "mh-seq" 1473 (autoload 'mh-list-sequences "mh-seq"
1314 "List the sequences defined in FOLDER." t) 1474 "List the sequences defined in FOLDER." t)
1315 (autoload 'mh-msg-is-in-seq "mh-seq" 1475 (autoload 'mh-msg-is-in-seq "mh-seq"
1316 "Display the sequences that contain MESSAGE (default: displayed message)." t) 1476 "Display the sequences that contain MESSAGE (default: displayed message)." t)
1317 (autoload 'mh-narrow-to-seq "mh-seq" 1477 (autoload 'mh-narrow-to-seq "mh-seq"
1318 "Restrict display of this folder to just messages in a sequence." t) 1478 "Restrict display of this folder to just messages in SEQUENCE
1479 Use \\[mh-widen] to undo this command." t)
1480 (autoload 'mh-put-msg-in-seq "mh-seq"
1481 "Add MESSAGE(s) (default: displayed message) to SEQUENCE.
1482 If optional prefix argument provided, then prompt for the message sequence." t)
1319 (autoload 'mh-widen "mh-seq" 1483 (autoload 'mh-widen "mh-seq"
1320 "Remove restrictions from current folder, thereby showing all messages." t) 1484 "Remove restrictions from current folder, thereby showing all messages." t)
1321 (autoload 'mh-rename-seq "mh-seq" 1485 (autoload 'mh-rename-seq "mh-seq"
1322 "Rename a SEQUENCE to have a new NAME." t) 1486 "Rename SEQUENCE to have NEW-NAME." t)
1323 1487
1324 ;;; mh-e.el ends here 1488 ;;; mh-e.el ends here