annotate lisp/mail/mh-e.el @ 36053:d4d4a154327c

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