annotate lisp/mail/mh-comp.el @ 48122:770c9bc95b39

(rmail-digest-end-regexps): Simplify. (undigestify-rmail-message): Fix paren-bug and simplify.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sat, 02 Nov 2002 05:16:58 +0000
parents 2568d5a27317
children 8aaba207e44b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38414
67b464da13ec Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 35975
diff changeset
1 ;;; mh-comp.el --- mh-e functions for composing messages
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
3 ;; Copyright (C) 1993,1995,1997,2000,2001,2002 Free Software Foundation, Inc.
30887
c4366892a814 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 29420
diff changeset
4
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
5 ;; Author: Bill Wohler <wohler@newt.com>
33145
e2d1dc22d119 Change maintainer.
Gerd Moellmann <gerd@gnu.org>
parents: 30887
diff changeset
6 ;; Maintainer: Bill Wohler <wohler@newt.com>
30887
c4366892a814 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 29420
diff changeset
7 ;; Keywords: mail
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
8 ;; See: mh-e.el
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
9
38414
67b464da13ec Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 35975
diff changeset
10 ;; This file is part of GNU Emacs.
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
11
11333
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: 13385
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: 13385
diff changeset
24 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13385
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
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
29 ;; Internal support for mh-e package.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
30
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
31 ;;; Change Log:
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
32
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
33 ;; $Id: mh-comp.el,v 1.56 2002/04/07 19:20:56 wohler Exp $
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
34
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
35 ;;; Code:
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
36
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
37 (provide 'mh-comp)
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
38 (require 'mh-e)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
39 (require 'mh-utils)
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
40 (require 'gnus-util)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
41 (require 'easymenu)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
42
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
43 ;;; autoloads from mh-mime
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
44
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
45 (autoload 'mh-mhn-compose-insertion "mh-mime"
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
46 "Add a directive to insert a MIME message part from a file.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
47 This is the typical way to insert non-text parts in a message.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
48 See also \\[mh-edit-mhn]." t)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
49
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
50 (autoload 'mh-mhn-compose-anon-ftp "mh-mime"
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
51 "Add a directive for a MIME anonymous ftp external body part.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
52 This directive tells MH to include a reference to a
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
53 message/external-body part retrievable by anonymous FTP.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
54 See also \\[mh-edit-mhn]." t)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
55
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
56 (autoload 'mh-mhn-compose-external-compressed-tar "mh-mime"
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
57 "Add a directive to include a MIME reference to a compressed tar file.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
58 The file should be available via anonymous ftp. This directive
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
59 tells MH to include a reference to a message/external-body part.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
60 See also \\[mh-edit-mhn]." t)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
61
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
62 (autoload 'mh-mhn-compose-forw "mh-mime"
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
63 "Add a forw directive to this message, to forward a message with MIME.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
64 This directive tells MH to include another message in this one.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
65 See also \\[mh-edit-mhn]." t)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
66
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
67 (autoload 'mh-edit-mhn "mh-mime"
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
68 "Format the current draft for MIME, expanding any mhn directives.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
69 Process the current draft with the mhn program, which,
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
70 using directives already inserted in the draft, fills in
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
71 all the MIME components and header fields.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
72 This step should be done last just before sending the message.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
73 The mhn program is part of MH version 6.8 or later.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
74 The \\[mh-revert-mhn-edit] command undoes this command.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
75 For assistance with creating mhn directives to insert
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
76 various types of components in a message, see
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
77 \\[mh-mhn-compose-insertion] (generic insertion from a file),
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
78 \\[mh-mhn-compose-anon-ftp] (external reference to file via anonymous ftp),
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
79 \\[mh-mhn-compose-external-compressed-tar] \
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
80 \(reference to compressed tar file via anonymous ftp), and
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
81 \\[mh-mhn-compose-forw] (forward message)." t)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
82
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
83 (autoload 'mh-revert-mhn-edit "mh-mime"
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
84 "Undoes the effect of \\[mh-edit-mhn] by reverting to the backup file.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
85 Optional non-nil argument means don't ask for confirmation." t)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
86
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
87 ;;; Other Autoloads.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
88
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
89 (autoload 'Info-goto-node "info")
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
90 (autoload 'mail-mode-fill-paragraph "sendmail")
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
91
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
92 ;;; Site customization (see also mh-utils.el):
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
93
17426
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
94 (defgroup mh-compose nil
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
95 "Mh-e functions for composing messages."
17426
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
96 :prefix "mh-"
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
97 :group 'mh)
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
98
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
99
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
100 (defvar mh-send-prog "send"
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
101 "Name of the MH send program.
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
102 Some sites need to change this because of a name conflict.")
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
103
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
104 (defvar mh-redist-full-contents nil
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
105 "Non-nil if the `dist' command needs whole letter for redistribution.
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
106 This is the case only when `send' is compiled with the BERK option.
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
107 If MH will not allow you to redist a previously redist'd msg, set to nil.")
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
108
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
109 (defvar mh-redist-background nil
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
110 "If non-nil redist will be done in background like send.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
111 This allows transaction log to be visible if -watch, -verbose or -snoop are used.")
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
112
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
113 (defvar mh-note-repl "-"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
114 "String whose first character is used to notate replied to messages.")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
115
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
116 (defvar mh-note-forw "F"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
117 "String whose first character is used to notate forwarded messages.")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
118
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
119 (defvar mh-note-dist "R"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
120 "String whose first character is used to notate redistributed messages.")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
121
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
122 (defvar mh-yank-hooks nil
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
123 "Obsolete hook for modifying a citation just inserted in the mail buffer.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
124 Each hook function can find the citation between point and mark.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
125 And each hook function should leave point and mark around the citation
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
126 text as modified.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
127
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
128 This is a normal hook, misnamed for historical reasons.
19936
78aa8484e6e9 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 17593
diff changeset
129 It is semi-obsolete and is only used if `mail-citation-hook' is nil.")
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
130
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
131 (defvar mail-citation-hook nil
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
132 "*Hook for modifying a citation just inserted in the mail buffer.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
133 Each hook function can find the citation between point and mark.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
134 And each hook function should leave point and mark around the citation
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
135 text as modified.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
136
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
137 If this hook is entirely empty (nil), the text of the message is inserted
19936
78aa8484e6e9 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 17593
diff changeset
138 with `mh-ins-buf-prefix' prefixed to each line.
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
139
19936
78aa8484e6e9 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 17593
diff changeset
140 See also the variable `mh-yank-from-start-of-msg', which controls how
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
141 much of the message passed to the hook.")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
142
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
143 ;;; Personal preferences:
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
144
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
145 (defcustom mh-insert-x-mailer-p t
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
146 "*If t, append an X-Mailer field to the header."
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
147 :type 'boolean
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
148 :group 'mh-compose)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
149
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
150 (defvar mh-x-mailer-string nil
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
151 "*String containing the contents of the X-Mailer header field.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
152 If nil, this variable is initialized to show the version of mh-e, Emacs, and
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
153 MH the first time a message is composed.")
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
154
17426
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
155 (defcustom mh-delete-yanked-msg-window nil
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
156 "*Controls window display when a message is yanked by \\<mh-letter-mode-map>\\[mh-yank-cur-msg].
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
157 If non-nil, yanking the current message into a draft letter deletes any
17426
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
158 windows displaying the message."
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
159 :type 'boolean
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
160 :group 'mh-compose)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
161
17426
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
162 (defcustom mh-yank-from-start-of-msg t
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
163 "*Controls which part of a message is yanked by \\<mh-letter-mode-map>\\[mh-yank-cur-msg].
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
164 If non-nil, include the entire message. If the symbol `body', then yank the
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
165 message minus the header. If nil, yank only the portion of the message
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
166 following the point. If the show buffer has a region, this variable is
17426
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
167 ignored."
22590
fd24f556ad8f (mh-yank-from-start-of-msg): Use `other' widget
Andreas Schwab <schwab@suse.de>
parents: 19952
diff changeset
168 :type '(choice (const :tag "Below point" nil)
fd24f556ad8f (mh-yank-from-start-of-msg): Use `other' widget
Andreas Schwab <schwab@suse.de>
parents: 19952
diff changeset
169 (const :tag "Without header" body)
fd24f556ad8f (mh-yank-from-start-of-msg): Use `other' widget
Andreas Schwab <schwab@suse.de>
parents: 19952
diff changeset
170 (other :tag "Entire message" t))
17426
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
171 :group 'mh-compose)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
172
17426
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
173 (defcustom mh-ins-buf-prefix "> "
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
174 "*String to put before each non-blank line of a yanked or inserted message.
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
175 \\<mh-letter-mode-map>Used when the message is inserted into an outgoing letter
17426
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
176 by \\[mh-insert-letter] or \\[mh-yank-cur-msg]."
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
177 :type 'string
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
178 :group 'mh-compose)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
179
17426
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
180 (defcustom mh-reply-default-reply-to nil
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
181 "*Sets the person or persons to whom a reply will be sent.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
182 If nil, prompt for recipient. If non-nil, then \\<mh-folder-mode-map>`\\[mh-reply]' will use this
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
183 value and it should be one of \"from\", \"to\", \"cc\", or \"all\".
17426
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
184 The values \"cc\" and \"all\" do the same thing."
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
185 :type '(choice (const :tag "Prompt" nil)
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
186 (const "from") (const "to")
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
187 (const "cc") (const "all"))
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
188 :group 'mh-compose)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
189
17426
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
190 (defcustom mh-signature-file-name "~/.signature"
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
191 "*Name of file containing the user's signature.
17426
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
192 Inserted into message by \\<mh-letter-mode-map>\\[mh-insert-signature]."
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
193 :type 'file
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
194 :group 'mh-compose)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
195
17426
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
196 (defcustom mh-forward-subject-format "%s: %s"
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
197 "*Format to generate the Subject: line contents for a forwarded message.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
198 The two string arguments to the format are the sender of the original
17426
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
199 message and the original subject line."
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
200 :type 'string
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
201 :group 'mh-compose)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
202
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
203 (defvar mh-comp-formfile "components"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
204 "Name of file to be used as a skeleton for composing messages.
19936
78aa8484e6e9 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 17593
diff changeset
205 Default is \"components\". If not an absolute file name, the file
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
206 is searched for first in the user's MH directory, then in the
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
207 system MH lib directory.")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
208
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
209 (defvar mh-repl-formfile "replcomps"
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
210 "Name of file to be used as a skeleton for replying to messages.
19936
78aa8484e6e9 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 17593
diff changeset
211 Default is \"replcomps\". If not an absolute file name, the file
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
212 is searched for first in the user's MH directory, then in the
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
213 system MH lib directory.")
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
214
24421
d072093cd922 (mh-repl-formfile): New var.
Karl Heuer <kwzh@gnu.org>
parents: 22590
diff changeset
215 (defvar mh-repl-group-formfile "replgroupcomps"
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
216 "Name of file to be used as a skeleton for replying to the sender and all recipients of a message.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
217 Only used if `mh-nmh-p' is non-nil. Default is \"replgroupcomps\". If not an
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
218 absolute file name, the file is searched for first in the user's MH directory,
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
219 then in the system MH lib directory.")
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
220
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
221 (defcustom mh-reply-show-message-p t
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
222 "*Whether the show buffer is displayed using \\<mh-letter-mode-map>\\[mh-reply].
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
223
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
224 The setting of this variable determines whether the MH `show-buffer' is
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
225 displayed with the current message when using `mh-reply' without a prefix
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
226 argument. Set it to nil if you already include the message automatically
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
227 in your draft using
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
228 repl: -filter repl.filter
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
229 in your ~/.mh_profile file."
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
230 :type 'boolean
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
231 :group 'mh-compose)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
232
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
233 (defcustom mh-letter-fill-column 72
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
234 "*Fill column to use in `mh-letter-mode'.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
235 This is usually less than in other text modes because email messages get
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
236 quoted by some prefix (sometimes many times) when they are replied-to,
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
237 and it's best to avoid quoted lines that span more than 80 columns."
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
238 :type 'integer
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
239 :group 'mh-compose)
24421
d072093cd922 (mh-repl-formfile): New var.
Karl Heuer <kwzh@gnu.org>
parents: 22590
diff changeset
240
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
241 ;;; Hooks:
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
242
17426
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
243 (defcustom mh-letter-mode-hook nil
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
244 "Invoked in `mh-letter-mode' on a new letter."
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
245 :type 'hook
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
246 :group 'mh-compose)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
247
17426
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
248 (defcustom mh-compose-letter-function nil
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
249 "Invoked when setting up a letter draft.
17426
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
250 It is passed three arguments: TO recipients, SUBJECT, and CC recipients."
35975
a6d7df85ca41 (mh-compose-letter-function): Fix :type.
Dave Love <fx@gnu.org>
parents: 33145
diff changeset
251 :type '(choice (const nil) function)
17426
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
252 :group 'mh-compose)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
253
17426
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
254 (defcustom mh-before-send-letter-hook nil
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
255 "Invoked at the beginning of the \\<mh-letter-mode-map>\\[mh-send-letter] command."
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
256 :type 'hook
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
257 :group 'mh-compose)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
258
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
259 (defvar mh-rejected-letter-start
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
260 (regexp-opt
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
261 '("^Content-Type: message/rfc822$" ;MIME MDN
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
262 "^ ----- Unsent message follows -----$" ;from sendmail V5
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
263 "^ ----- Original message follows -----$" ;from sendmail V8
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
264 "^------- Unsent Draft$" ;from MH itself
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
265 "^---------- Original Message ----------$" ;from zmailer
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
266 "^ --- The unsent message follows ---$" ;from AIX mail system
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
267 "^ Your message follows:$" ;from MMDF-II
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
268 "^Content-Description: Returned Content$" ;1993 KJ sendmail
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
269 )))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
270
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
271 (defvar mh-new-draft-cleaned-headers
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
272 "^Date:\\|^Received:\\|^Message-Id:\\|^From:\\|^Sender:\\|^Errors-To:\\|^Delivery-Date:\\|^Return-Path:"
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
273 "Regexp of header lines to remove before offering a message as a new draft.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
274 Used by the \\<mh-folder-mode-map>`\\[mh-edit-again]' and `\\[mh-extract-rejected-mail]' commands.")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
275
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
276 (defvar mh-to-field-choices '(("t" . "To:") ("s" . "Subject:") ("c" . "Cc:")
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
277 ("b" . "Bcc:") ("f" . "Fcc:") ("r" . "From:")
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
278 ("d" . "Dcc:"))
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
279 "Alist of (final-character . field-name) choices for `mh-to-field'.")
6365
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 (defvar mh-letter-mode-map (copy-keymap text-mode-map)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
282 "Keymap for composing mail.")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
283
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
284 (defvar mh-letter-mode-syntax-table nil
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
285 "Syntax table used by mh-e while in MH-Letter mode.")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
286
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
287 (if mh-letter-mode-syntax-table
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
288 ()
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
289 (setq mh-letter-mode-syntax-table
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
290 (make-syntax-table text-mode-syntax-table))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
291 (modify-syntax-entry ?% "." mh-letter-mode-syntax-table))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
292
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
293
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
294 ;;;###autoload
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
295 (defun mh-smail ()
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
296 "Compose and send mail with the MH mail system.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
297 This function is an entry point to mh-e, the Emacs front end
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
298 to the MH mail system.
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
299
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
300 See documentation of `\\[mh-send]' for more details on composing mail."
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
301 (interactive)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
302 (mh-find-path)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
303 (call-interactively 'mh-send))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
304
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
305
13385
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
306 (defvar mh-error-if-no-draft nil) ;raise error over using old draft
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
307
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
308
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
309 ;;;###autoload
24421
d072093cd922 (mh-repl-formfile): New var.
Karl Heuer <kwzh@gnu.org>
parents: 22590
diff changeset
310 (defun mh-smail-batch (&optional to subject other-headers &rest ignored)
13385
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
311 "Set up a mail composition draft with the MH mail system.
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
312 This function is an entry point to mh-e, the Emacs front end
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
313 to the MH mail system. This function does not prompt the user
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
314 for any header fields, and thus is suitable for use by programs
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
315 that want to create a mail buffer.
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
316 Users should use `\\[mh-smail]' to compose mail.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
317 Optional arguments for setting certain fields include TO, SUBJECT, and
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
318 OTHER-HEADERS."
13385
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
319 (mh-find-path)
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
320 (let ((mh-error-if-no-draft t))
26393
d11cb5096a6c (mh-smail-batch): If TO is nil, use "" as
Gerd Moellmann <gerd@gnu.org>
parents: 25535
diff changeset
321 (mh-send (or to "") "" (or subject ""))))
13385
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
322
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
323 ;; XEmacs needs this:
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
324 ;;;###autoload
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
325 (defun mh-user-agent-compose (&optional to subject other-headers continue
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
326 switch-function yank-action
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
327 send-actions)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
328 "Set up mail composition draft with the MH mail system.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
329 This is `mail-user-agent' entry point to mh-e.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
330
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
331 The optional arguments TO and SUBJECT specify recipients and the
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
332 initial Subject field, respectively.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
333
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
334 OTHER-HEADERS is an alist specifying additional
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
335 header fields. Elements look like (HEADER . VALUE) where both
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
336 HEADER and VALUE are strings.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
337
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
338 CONTINUE, SWITCH-FUNCTION, YANK-ACTION and SEND-ACTIONS are ignored."
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
339 (mh-find-path)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
340 (let ((mh-error-if-no-draft t))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
341 (mh-send to "" subject)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
342 (while other-headers
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
343 (mh-insert-fields (concat (car (car other-headers)) ":")
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
344 (cdr (car other-headers)))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
345 (setq other-headers (cdr other-headers)))))
13385
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
346
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
347 (defun mh-edit-again (msg)
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
348 "Clean up a draft or a message MSG previously sent and make it resendable.
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
349 Default is the current message.
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
350 The variable `mh-new-draft-cleaned-headers' specifies the headers to remove.
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
351 See also documentation for `\\[mh-send]' function."
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
352 (interactive (list (mh-get-msg-num t)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
353 (let* ((from-folder mh-current-folder)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
354 (config (current-window-configuration))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
355 (draft
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
356 (cond ((and mh-draft-folder (equal from-folder mh-draft-folder))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
357 (pop-to-buffer (find-file-noselect (mh-msg-filename msg)) t)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
358 (rename-buffer (format "draft-%d" msg))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
359 (buffer-name))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
360 (t
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
361 (mh-read-draft "clean-up" (mh-msg-filename msg) nil)))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
362 (mh-clean-msg-header (point-min) mh-new-draft-cleaned-headers nil)
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
363 (mh-insert-header-separator)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
364 (goto-char (point-min))
13385
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
365 (save-buffer)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
366 (mh-compose-and-send-mail draft "" from-folder nil nil nil nil nil nil
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
367 config)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
368
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
369
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
370 (defun mh-extract-rejected-mail (msg)
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
371 "Extract message MSG returned by the mail system and make it resendable.
19936
78aa8484e6e9 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 17593
diff changeset
372 Default is the current message. The variable `mh-new-draft-cleaned-headers'
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
373 gives the headers to clean out of the original message.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
374 See also documentation for `\\[mh-send]' function."
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
375 (interactive (list (mh-get-msg-num t)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
376 (let ((from-folder mh-current-folder)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
377 (config (current-window-configuration))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
378 (draft (mh-read-draft "extraction" (mh-msg-filename msg) nil)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
379 (goto-char (point-min))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
380 (cond ((re-search-forward mh-rejected-letter-start nil t)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
381 (skip-chars-forward " \t\n")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
382 (delete-region (point-min) (point))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
383 (mh-clean-msg-header (point-min) mh-new-draft-cleaned-headers nil))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
384 (t
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
385 (message "Does not appear to be a rejected letter.")))
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
386 (mh-insert-header-separator)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
387 (goto-char (point-min))
13385
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
388 (save-buffer)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
389 (mh-compose-and-send-mail draft "" from-folder msg
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
390 (mh-get-header-field "To:")
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
391 (mh-get-header-field "From:")
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
392 (mh-get-header-field "Cc:")
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
393 nil nil config)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
394
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
395
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
396 (defun mh-forward (to cc &optional msg-or-seq)
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
397 "Forward displayed message to recipients TO and CC.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
398 If optional prefix argument MSG-OR-SEQ provided, then prompt for the message
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
399 sequence. See also documentation for `\\[mh-send]' function."
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
400 (interactive (list (mh-read-address "To: ")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
401 (mh-read-address "Cc: ")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
402 (if current-prefix-arg
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
403 (mh-read-seq-default "Forward" t)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
404 (mh-get-msg-num t))))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
405 (or msg-or-seq
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
406 (setq msg-or-seq (mh-get-msg-num t)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
407 (let* ((folder mh-current-folder)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
408 (config (current-window-configuration))
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
409 (fwd-msg-file (mh-msg-filename (if (numberp msg-or-seq)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
410 msg-or-seq
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
411 (car (mh-seq-to-msgs msg-or-seq)))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
412 folder))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
413 ;; forw always leaves file in "draft" since it doesn't have -draft
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
414 (draft-name (expand-file-name "draft" mh-user-path))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
415 (draft (cond ((or (not (file-exists-p draft-name))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
416 (y-or-n-p "The file 'draft' exists. Discard it? "))
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
417 (mh-exec-cmd "forw" "-build"
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
418 mh-current-folder msg-or-seq)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
419 (prog1
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
420 (mh-read-draft "" draft-name t)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
421 (mh-insert-fields "To:" to "Cc:" cc)
13385
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
422 (save-buffer)))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
423 (t
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
424 (mh-read-draft "" draft-name nil)))))
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
425 (let (orig-from
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
426 orig-subject)
25535
2fe0f62fa349 (mh-forward): Get new subject line from the original,
Richard M. Stallman <rms@gnu.org>
parents: 24421
diff changeset
427 (save-excursion
2fe0f62fa349 (mh-forward): Get new subject line from the original,
Richard M. Stallman <rms@gnu.org>
parents: 24421
diff changeset
428 (set-buffer (get-buffer-create mh-temp-buffer))
2fe0f62fa349 (mh-forward): Get new subject line from the original,
Richard M. Stallman <rms@gnu.org>
parents: 24421
diff changeset
429 (erase-buffer)
2fe0f62fa349 (mh-forward): Get new subject line from the original,
Richard M. Stallman <rms@gnu.org>
parents: 24421
diff changeset
430 (insert-file-contents fwd-msg-file)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
431 (setq orig-from (mh-get-header-field "From:"))
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
432 (setq orig-subject (mh-get-header-field "Subject:")))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
433 (let ((forw-subject
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
434 (mh-forwarded-letter-subject orig-from orig-subject))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
435 (mail-header-separator mh-mail-header-separator))
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
436 (mh-insert-fields "Subject:" forw-subject)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
437 (goto-char (point-min))
25535
2fe0f62fa349 (mh-forward): Get new subject line from the original,
Richard M. Stallman <rms@gnu.org>
parents: 24421
diff changeset
438 (if (re-search-forward "^------- Forwarded Message" nil t)
2fe0f62fa349 (mh-forward): Get new subject line from the original,
Richard M. Stallman <rms@gnu.org>
parents: 24421
diff changeset
439 (forward-line -1)
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
440 (re-search-forward mail-header-separator)
25535
2fe0f62fa349 (mh-forward): Get new subject line from the original,
Richard M. Stallman <rms@gnu.org>
parents: 24421
diff changeset
441 (forward-line 1))
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
442 (delete-other-windows)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
443 (if (numberp msg-or-seq)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
444 (mh-add-msgs-to-seq msg-or-seq 'forwarded t)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
445 (mh-add-msgs-to-seq (mh-seq-to-msgs msg-or-seq) 'forwarded t))
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
446 (mh-compose-and-send-mail draft "" folder msg-or-seq
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
447 to forw-subject cc
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
448 mh-note-forw "Forwarded:"
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
449 config)))))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
450
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
451 (defun mh-forwarded-letter-subject (from subject)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
452 ;; Return a Subject suitable for a forwarded message.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
453 ;; Original message has headers FROM and SUBJECT.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
454 (let ((addr-start (string-match "<" from))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
455 (comment (string-match "(" from)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
456 (cond ((and addr-start (> addr-start 0))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
457 ;; Full Name <luser@host>
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
458 (setq from (substring from 0 (1- addr-start))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
459 (comment
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
460 ;; luser@host (Full Name)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
461 (setq from (substring from (1+ comment) (1- (length from)))))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
462 (format mh-forward-subject-format from subject))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
463
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
464
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
465 ;;;###autoload
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
466 (defun mh-smail-other-window ()
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
467 "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
468 This function is an entry point to mh-e, the Emacs front end
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
469 to the MH mail system.
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
470
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
471 See documentation of `\\[mh-send]' for more details on composing mail."
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
472 (interactive)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
473 (mh-find-path)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
474 (call-interactively 'mh-send-other-window))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
475
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
476
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
477 (defun mh-redistribute (to cc &optional msg)
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
478 "Redistribute displayed message to recipients TO and CC.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
479 Use optional argument MSG to redistribute another message.
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
480 Depending on how your copy of MH was compiled, you may need to change the
19936
78aa8484e6e9 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 17593
diff changeset
481 setting of the variable `mh-redist-full-contents'. See its documentation."
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
482 (interactive (list (mh-read-address "Redist-To: ")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
483 (mh-read-address "Redist-Cc: ")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
484 (mh-get-msg-num t)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
485 (or msg
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
486 (setq msg (mh-get-msg-num t)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
487 (save-window-excursion
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
488 (let ((folder mh-current-folder)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
489 (draft (mh-read-draft "redistribution"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
490 (if mh-redist-full-contents
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
491 (mh-msg-filename msg)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
492 nil)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
493 nil)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
494 (mh-goto-header-end 0)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
495 (insert "Resent-To: " to "\n")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
496 (if (not (equal cc "")) (insert "Resent-cc: " cc "\n"))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
497 (mh-clean-msg-header (point-min)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
498 "^Message-Id:\\|^Received:\\|^Return-Path:\\|^Sender:\\|^Date:\\|^From:"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
499 nil)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
500 (save-buffer)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
501 (message "Redistributing...")
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
502 (if (not mh-redist-background)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
503 (if mh-redist-full-contents
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
504 (call-process "/bin/sh" nil 0 nil "-c"
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
505 (format "mhdist=1 mhaltmsg=%s %s -push %s"
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
506 buffer-file-name
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
507 (expand-file-name mh-send-prog mh-progs)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
508 buffer-file-name))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
509 (call-process "/bin/sh" nil 0 nil "-c"
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
510 (format "mhdist=1 mhaltmsg=%s mhannotate=1 %s -push %s"
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
511 (mh-msg-filename msg folder)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
512 (expand-file-name mh-send-prog mh-progs)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
513 buffer-file-name))))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
514 (mh-annotate-msg msg folder mh-note-dist
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
515 "-component" "Resent:"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
516 "-text" (format "\"%s %s\"" to cc))
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
517 (if mh-redist-background
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
518 (mh-exec-cmd-daemon "/bin/sh" "-c"
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
519 (format "mhdist=1 mhaltmsg=%s %s %s %s"
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
520 (if mh-redist-full-contents
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
521 buffer-file-name
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
522 (mh-msg-filename msg folder))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
523 (if mh-redist-full-contents
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
524 ""
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
525 "mhannotate=1")
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
526 (mh-expand-file-name "send" mh-progs)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
527 buffer-file-name)))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
528 (kill-buffer draft)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
529 (message "Redistributing...done"))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
530
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
531
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
532 (defun mh-reply (message &optional includep)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
533 "Reply to MESSAGE (default: current message).
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
534 If optional prefix argument INCLUDEP provided, then include the message
19936
78aa8484e6e9 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 17593
diff changeset
535 in the reply using filter `mhl.reply' in your MH directory.
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
536 Prompts for type of addresses to reply to:
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
537 from sender only,
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
538 to sender and primary recipients,
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
539 cc/all sender and all recipients.
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
540 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: 10875
diff changeset
541 for the reply. See also documentation for `\\[mh-send]' function."
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
542 (interactive (list (mh-get-msg-num t) current-prefix-arg))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
543 (let ((minibuffer-help-form
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
544 "from => Sender only\nto => Sender and primary recipients\ncc or all => Sender and all recipients"))
24421
d072093cd922 (mh-repl-formfile): New var.
Karl Heuer <kwzh@gnu.org>
parents: 22590
diff changeset
545 (let* ((reply-to (or mh-reply-default-reply-to
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
546 (completing-read "Reply to whom: "
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
547 '(("from") ("to") ("cc") ("all"))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
548 nil
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
549 t)))
24421
d072093cd922 (mh-repl-formfile): New var.
Karl Heuer <kwzh@gnu.org>
parents: 22590
diff changeset
550 (folder mh-current-folder)
d072093cd922 (mh-repl-formfile): New var.
Karl Heuer <kwzh@gnu.org>
parents: 22590
diff changeset
551 (show-buffer mh-show-buffer)
d072093cd922 (mh-repl-formfile): New var.
Karl Heuer <kwzh@gnu.org>
parents: 22590
diff changeset
552 (config (current-window-configuration))
d072093cd922 (mh-repl-formfile): New var.
Karl Heuer <kwzh@gnu.org>
parents: 22590
diff changeset
553 (group-reply (or (equal reply-to "cc") (equal reply-to "all")))
d072093cd922 (mh-repl-formfile): New var.
Karl Heuer <kwzh@gnu.org>
parents: 22590
diff changeset
554 (form-file (cond ((and mh-nmh-p group-reply
d072093cd922 (mh-repl-formfile): New var.
Karl Heuer <kwzh@gnu.org>
parents: 22590
diff changeset
555 (stringp mh-repl-group-formfile))
d072093cd922 (mh-repl-formfile): New var.
Karl Heuer <kwzh@gnu.org>
parents: 22590
diff changeset
556 mh-repl-group-formfile)
d072093cd922 (mh-repl-formfile): New var.
Karl Heuer <kwzh@gnu.org>
parents: 22590
diff changeset
557 ((stringp mh-repl-formfile) mh-repl-formfile)
d072093cd922 (mh-repl-formfile): New var.
Karl Heuer <kwzh@gnu.org>
parents: 22590
diff changeset
558 (t nil))))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
559 (message "Composing a reply...")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
560 (mh-exec-cmd "repl" "-build" "-noquery" "-nodraftfolder"
24421
d072093cd922 (mh-repl-formfile): New var.
Karl Heuer <kwzh@gnu.org>
parents: 22590
diff changeset
561 (if form-file
d072093cd922 (mh-repl-formfile): New var.
Karl Heuer <kwzh@gnu.org>
parents: 22590
diff changeset
562 (list "-form" form-file))
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
563 mh-current-folder message
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
564 (cond ((or (equal reply-to "from") (equal reply-to ""))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
565 '("-nocc" "all"))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
566 ((equal reply-to "to")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
567 '("-cc" "to"))
24421
d072093cd922 (mh-repl-formfile): New var.
Karl Heuer <kwzh@gnu.org>
parents: 22590
diff changeset
568 (group-reply (if mh-nmh-p
d072093cd922 (mh-repl-formfile): New var.
Karl Heuer <kwzh@gnu.org>
parents: 22590
diff changeset
569 '("-group" "-nocc" "me")
d072093cd922 (mh-repl-formfile): New var.
Karl Heuer <kwzh@gnu.org>
parents: 22590
diff changeset
570 '("-cc" "all" "-nocc" "me"))))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
571 (if includep
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
572 '("-filter" "mhl.reply")))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
573 (let ((draft (mh-read-draft "reply"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
574 (expand-file-name "reply" mh-user-path)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
575 t)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
576 (delete-other-windows)
13385
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
577 (save-buffer)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
578
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
579 (let ((to (mh-get-header-field "To:"))
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
580 (subject (mh-get-header-field "Subject:"))
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
581 (cc (mh-get-header-field "Cc:")))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
582 (goto-char (point-min))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
583 (mh-goto-header-end 1)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
584 (or includep
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
585 (not mh-reply-show-message-p)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
586 (mh-in-show-buffer (show-buffer)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
587 (mh-display-msg message folder)))
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
588 (mh-add-msgs-to-seq message 'answered t)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
589 (message "Composing a reply...done")
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
590 (mh-compose-and-send-mail draft "" folder message to subject cc
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
591 mh-note-repl "Replied:" config))))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
592
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
593
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
594 (defun mh-send (to cc subject)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
595 "Compose and send a letter.
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
596
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
597 Do not call this function from outside mh-e; use \\[mh-smail] instead.
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
598
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
599 The file named by `mh-comp-formfile' will be used as the form.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
600 The letter is composed in `mh-letter-mode'; see its documentation for more
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
601 details.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
602 If `mh-compose-letter-function' is defined, it is called on the draft and
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
603 passed three arguments: TO, CC, and SUBJECT."
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
604 (interactive (list
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
605 (mh-read-address "To: ")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
606 (mh-read-address "Cc: ")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
607 (read-string "Subject: ")))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
608 (let ((config (current-window-configuration)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
609 (delete-other-windows)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
610 (mh-send-sub to cc subject config)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
611
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
612
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
613 (defun mh-send-other-window (to cc subject)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
614 "Compose and send a letter in another window.
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
615
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
616 Do not call this function from outside mh-e; use \\[mh-smail-other-window]
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
617 instead.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
618
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
619 The file named by `mh-comp-formfile' will be used as the form.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
620 The letter is composed in `mh-letter-mode'; see its documentation for more
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
621 details.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
622 If `mh-compose-letter-function' is defined, it is called on the draft and
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
623 passed three arguments: TO, CC, and SUBJECT."
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
624 (interactive (list
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
625 (mh-read-address "To: ")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
626 (mh-read-address "Cc: ")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
627 (read-string "Subject: ")))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
628 (let ((pop-up-windows t))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
629 (mh-send-sub to cc subject (current-window-configuration))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
630
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
631
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
632 (defun mh-send-sub (to cc subject config)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
633 ;; Do the real work of composing and sending a letter.
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
634 ;; Expects the TO, CC, and SUBJECT fields as arguments.
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
635 ;; CONFIG is the window configuration before sending mail.
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
636 (let ((folder mh-current-folder)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
637 (msg-num (mh-get-msg-num nil)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
638 (message "Composing a message...")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
639 (let ((draft (mh-read-draft
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
640 "message"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
641 (let (components)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
642 (cond
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
643 ((file-exists-p
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
644 (setq components
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
645 (expand-file-name mh-comp-formfile mh-user-path)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
646 components)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
647 ((file-exists-p
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
648 (setq components
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
649 (expand-file-name mh-comp-formfile mh-lib)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
650 components)
28739
192cbf5dbea2 (mh-send-sub): Look for mh-comp-formfile in
Gerd Moellmann <gerd@gnu.org>
parents: 26393
diff changeset
651 ((file-exists-p
192cbf5dbea2 (mh-send-sub): Look for mh-comp-formfile in
Gerd Moellmann <gerd@gnu.org>
parents: 26393
diff changeset
652 (setq components
29420
25fb2df6c428 (mh-send-sub): Check mh-etc is bound before using it.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28739
diff changeset
653 (expand-file-name mh-comp-formfile
25fb2df6c428 (mh-send-sub): Check mh-etc is bound before using it.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28739
diff changeset
654 ;; What is this mh-etc ?? -sm
25fb2df6c428 (mh-send-sub): Check mh-etc is bound before using it.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28739
diff changeset
655 (and (boundp 'mh-etc) mh-etc))))
28739
192cbf5dbea2 (mh-send-sub): Look for mh-comp-formfile in
Gerd Moellmann <gerd@gnu.org>
parents: 26393
diff changeset
656 components)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
657 (t
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
658 (error (format "Can't find components file \"%s\""
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
659 components)))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
660 nil)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
661 (mh-insert-fields "To:" to "Subject:" subject "Cc:" cc)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
662 (goto-char (point-max))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
663 (message "Composing a message...done")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
664 (mh-compose-and-send-mail draft "" folder msg-num
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
665 to subject cc
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
666 nil nil config))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
667
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
668
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
669 (defun mh-read-draft (use initial-contents delete-contents-file)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
670 ;; Read draft file into a draft buffer and make that buffer the current one.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
671 ;; USE is a message used for prompting about the intended use of the message.
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
672 ;; INITIAL-CONTENTS is filename that is read into an empty buffer, or NIL
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
673 ;; if buffer should not be modified. Delete the initial-contents file if
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
674 ;; DELETE-CONTENTS-FILE flag is set.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
675 ;; Returns the draft folder's name.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
676 ;; If the draft folder facility is enabled in ~/.mh_profile, a new buffer is
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
677 ;; used each time and saved in the draft folder. The draft file can then be
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
678 ;; reused.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
679 (cond (mh-draft-folder
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
680 (let ((orig-default-dir default-directory)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
681 (draft-file-name (mh-new-draft-name)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
682 (pop-to-buffer (generate-new-buffer
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
683 (format "draft-%s"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
684 (file-name-nondirectory draft-file-name))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
685 (condition-case ()
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
686 (insert-file-contents draft-file-name t)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
687 (file-error))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
688 (setq default-directory orig-default-dir)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
689 (t
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
690 (let ((draft-name (expand-file-name "draft" mh-user-path)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
691 (pop-to-buffer "draft") ; Create if necessary
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
692 (if (buffer-modified-p)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
693 (if (y-or-n-p "Draft has been modified; kill anyway? ")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
694 (set-buffer-modified-p nil)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
695 (error "Draft preserved")))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
696 (setq buffer-file-name draft-name)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
697 (clear-visited-file-modtime)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
698 (unlock-buffer)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
699 (cond ((and (file-exists-p draft-name)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
700 (not (equal draft-name initial-contents)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
701 (insert-file-contents draft-name)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
702 (delete-file draft-name))))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
703 (cond ((and initial-contents
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
704 (or (zerop (buffer-size))
13385
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
705 (if (y-or-n-p
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
706 (format "A draft exists. Use for %s? " use))
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
707 (if mh-error-if-no-draft
38414
67b464da13ec Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 35975
diff changeset
708 (error "A prior draft exists"))
13385
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
709 t)))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
710 (erase-buffer)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
711 (insert-file-contents initial-contents)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
712 (if delete-contents-file (delete-file initial-contents))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
713 (auto-save-mode 1)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
714 (if mh-draft-folder
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
715 (save-buffer)) ; Do not reuse draft name
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
716 (buffer-name))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
717
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
718
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
719 (defun mh-new-draft-name ()
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
720 ;; Returns the pathname of folder for draft messages.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
721 (save-excursion
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
722 (mh-exec-cmd-quiet t "mhpath" mh-draft-folder "new")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
723 (buffer-substring (point-min) (1- (point-max)))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
724
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
725
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
726 (defun mh-annotate-msg (msg buffer note &rest args)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
727 ;; Mark the MESSAGE in BUFFER listing with the character NOTE and annotate
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
728 ;; the saved message with ARGS.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
729 (apply 'mh-exec-cmd "anno" buffer msg args)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
730 (save-excursion
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
731 (cond ((get-buffer buffer) ; Buffer may be deleted
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
732 (set-buffer buffer)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
733 (if (symbolp msg)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
734 (mh-notate-seq msg note (1+ mh-cmd-note))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
735 (mh-notate msg note (1+ mh-cmd-note)))))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
736
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 (defun mh-insert-fields (&rest name-values)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
739 ;; Insert the NAME-VALUE pairs in the current buffer.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
740 ;; If field NAME exists, append VALUE to it.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
741 ;; Do not insert any pairs whose value is the empty string.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
742 (let ((case-fold-search t))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
743 (while name-values
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
744 (let ((field-name (car name-values))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
745 (value (car (cdr name-values))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
746 (cond ((equal value "")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
747 nil)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
748 ((mh-position-on-field field-name)
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
749 (insert " " (or value "")))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
750 (t
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
751 (insert field-name " " value "\n")))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
752 (setq name-values (cdr (cdr name-values)))))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
753
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 (defun mh-position-on-field (field &optional ignore)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
756 ;; Move to the end of the FIELD in the header.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
757 ;; Move to end of entire header if FIELD not found.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
758 ;; Returns non-nil iff FIELD was found.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
759 ;; The optional second arg is for pre-version 4 compatibility.
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
760 (cond ((mh-goto-header-field field)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
761 (mh-header-field-end)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
762 t)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
763 ((mh-goto-header-end 0)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
764 nil)))
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
765
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
766
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
767 (defun mh-get-header-field (field)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
768 ;; Find and return the body of FIELD in the mail header.
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
769 ;; Returns the empty string if the field is not in the header of the
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
770 ;; current buffer.
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
771 (if (mh-goto-header-field field)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
772 (progn
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
773 (skip-chars-forward " \t") ;strip leading white space in body
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
774 (let ((start (point)))
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
775 (mh-header-field-end)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
776 (buffer-substring start (point))))
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
777 ""))
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
778
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
779 (fset 'mh-get-field 'mh-get-header-field) ;mh-e 4 compatibility
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
780
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
781 (defun mh-goto-header-field (field)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
782 ;; Move to FIELD in the message header.
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
783 ;; Move to the end of the FIELD name, which should end in a colon.
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
784 ;; Returns T if found, NIL if not.
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
785 (goto-char (point-min))
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
786 (let ((case-fold-search t)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
787 (headers-end (save-excursion
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
788 (mh-goto-header-end 0)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
789 (point))))
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
790 (re-search-forward (format "^%s" field) headers-end t)))
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
791
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
792 (defun mh-goto-header-end (arg)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
793 ;; Find the end of the message header in the current buffer and position
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
794 ;; the cursor at the ARG'th newline after the header.
11507
595e689b719b Update some MIME doc strings.
Karl Heuer <kwzh@gnu.org>
parents: 11333
diff changeset
795 (if (re-search-forward "^-*$" nil nil)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
796 (forward-line arg)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
797
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
798
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
799 (defun mh-read-address (prompt)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
800 ;; Read a To: or Cc: address, prompting in the minibuffer with PROMPT.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
801 ;; May someday do completion on aliases.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
802 (read-string prompt))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
803
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
804
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 ;;; Mode for composing and sending a draft message.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
807
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
808 (defvar mh-sent-from-folder nil) ;Folder of msg assoc with this letter.
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
809
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
810 (defvar mh-sent-from-msg nil) ;Number of msg assoc with this letter.
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
811
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
812 (defvar mh-send-args nil) ;Extra args to pass to "send" command.
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
813
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
814 (defvar mh-annotate-char nil) ;Character to use to annotate mh-sent-from-msg.
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
815
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
816 (defvar mh-annotate-field nil) ;Field name for message annotation.
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
817
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
818 (put 'mh-letter-mode 'mode-class 'special)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
819
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
820 ;;;###autoload
29420
25fb2df6c428 (mh-send-sub): Check mh-etc is bound before using it.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28739
diff changeset
821 (define-derived-mode mh-letter-mode text-mode "MH-Letter"
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
822 "Mode for composing letters in mh-e.\\<mh-letter-mode-map>
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
823
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
824 When you have finished composing, type \\[mh-send-letter] to send the message
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
825 using the MH mail handling system.
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
826
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
827 If MH MIME directives are added manually, you must first run \\[mh-edit-mhn]
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
828 before sending the message. MIME directives that are added by mh-e commands
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
829 such as \\[mh-mhn-compose-insertion] are processed automatically when the
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
830 message is sent.
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
831
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
832 Options that control this mode can be changed with
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
833 \\[customize-group]; specify the \"mh-compose\" group.
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
834
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
835 When a message is composed, the hooks `text-mode-hook' and
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
836 `mh-letter-mode-hook' are run.
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
837
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
838 \\{mh-letter-mode-map}"
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
839
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
840 (or mh-user-path (mh-find-path))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
841 (make-local-variable 'mh-send-args)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
842 (make-local-variable 'mh-annotate-char)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
843 (make-local-variable 'mh-annotate-field)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
844 (make-local-variable 'mh-previous-window-config)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
845 (make-local-variable 'mh-sent-from-folder)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
846 (make-local-variable 'mh-sent-from-msg)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
847 (make-local-variable 'mail-header-separator)
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
848 (setq mail-header-separator mh-mail-header-separator) ;override sendmail.el
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
849
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
850 ;; From sendmail.el for proper paragraph fill
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
851 ;; sendmail.el also sets a normal-auto-fill-function (not done here)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
852 (make-local-variable 'paragraph-separate)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
853 (make-local-variable 'paragraph-start)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
854 (make-local-variable 'fill-paragraph-function)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
855 (setq fill-paragraph-function 'mail-mode-fill-paragraph)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
856 (make-local-variable 'adaptive-fill-regexp)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
857 (setq adaptive-fill-regexp
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
858 (concat adaptive-fill-regexp
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
859 "\\|[ \t]*[-[:alnum:]]*>+[ \t]*"))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
860 (make-local-variable 'adaptive-fill-first-line-regexp)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
861 (setq adaptive-fill-first-line-regexp
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
862 (concat adaptive-fill-first-line-regexp
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
863 "\\|[ \t]*[-[:alnum:]]*>+[ \t]*"))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
864 ;; `-- ' precedes the signature. `-----' appears at the start of the
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
865 ;; lines that delimit forwarded messages.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
866 ;; Lines containing just >= 3 dashes, perhaps after whitespace,
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
867 ;; are also sometimes used and should be separators.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
868 (setq paragraph-start (concat (regexp-quote mail-header-separator)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
869 "\\|\t*\\([-|#;>* ]\\|(?[0-9]+[.)]\\)+$"
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
870 "\\|[ \t]*[[:alnum:]]*>+[ \t]*$\\|[ \t]*$\\|"
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
871 "-- $\\|---+$\\|"
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
872 page-delimiter))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
873 (setq paragraph-separate paragraph-start)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
874 ;; --- End of code from sendmail.el ---
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
875
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
876 (if (and (boundp 'tool-bar-mode) tool-bar-mode)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
877 (set (make-local-variable 'tool-bar-map) mh-letter-tool-bar-map))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
878 (make-local-variable 'font-lock-defaults)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
879 (cond
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
880 ((equal mh-highlight-citation-p 'font-lock)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
881 (setq font-lock-defaults '(mh-show-font-lock-keywords-with-cite t)))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
882 ((equal mh-highlight-citation-p 'gnus)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
883 (setq font-lock-defaults '(mh-show-font-lock-keywords t))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
884 (mh-gnus-article-highlight-citation))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
885 (t
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
886 (setq font-lock-defaults '(mh-show-font-lock-keywords t))))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
887 (easy-menu-add mh-letter-menu)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
888 ;; See if a "forw: -mime" message containing a MIME composition.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
889 ;; mode clears local vars, so can't do this in mh-forward.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
890 (save-excursion
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
891 (goto-char (point-min))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
892 (when (and (re-search-forward mail-header-separator nil t)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
893 (= 0 (forward-line 1))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
894 (looking-at "^#forw"))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
895 (require 'mh-mime) ;Need mh-mhn-compose-insert-p local var
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
896 (setq mh-mhn-compose-insert-p t)))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
897 (setq fill-column mh-letter-fill-column)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
898 ;; if text-mode-hook turned on auto-fill, tune it for messages
29420
25fb2df6c428 (mh-send-sub): Check mh-etc is bound before using it.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28739
diff changeset
899 (when auto-fill-function
25fb2df6c428 (mh-send-sub): Check mh-etc is bound before using it.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28739
diff changeset
900 (make-local-variable 'auto-fill-function)
25fb2df6c428 (mh-send-sub): Check mh-etc is bound before using it.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28739
diff changeset
901 (setq auto-fill-function 'mh-auto-fill-for-letter)))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
902
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
903
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
904 (defun mh-auto-fill-for-letter ()
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
905 ;; Auto-fill in letters treats the header specially by inserting a tab
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
906 ;; before continuation line.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
907 (if (mh-in-header-p)
11507
595e689b719b Update some MIME doc strings.
Karl Heuer <kwzh@gnu.org>
parents: 11333
diff changeset
908 (let ((fill-prefix "\t"))
595e689b719b Update some MIME doc strings.
Karl Heuer <kwzh@gnu.org>
parents: 11333
diff changeset
909 (do-auto-fill))
595e689b719b Update some MIME doc strings.
Karl Heuer <kwzh@gnu.org>
parents: 11333
diff changeset
910 (do-auto-fill)))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
911
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
912
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
913 (defun mh-insert-header-separator ()
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
914 ;; Inserts `mh-mail-header-separator', if absent.
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
915 (save-excursion
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
916 (goto-char (point-min))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
917 (rfc822-goto-eoh)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
918 (if (looking-at "$")
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
919 (insert mh-mail-header-separator))))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
920
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
921 (defun mh-to-field ()
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
922 "Move point to the end of a specified header field.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
923 The field is indicated by the previous keystroke (the last keystroke
19936
78aa8484e6e9 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 17593
diff changeset
924 of the command) according to the list in the variable `mh-to-field-choices'.
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
925 Create the field if it does not exist. Set the mark to point before moving."
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
926 (interactive)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
927 (expand-abbrev)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
928 (let ((target (cdr (or (assoc (char-to-string (logior last-input-char ?`))
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
929 mh-to-field-choices)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
930 ;; also look for a char for version 4 compat
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
931 (assoc (logior last-input-char ?`) mh-to-field-choices))))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
932 (case-fold-search t))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
933 (push-mark)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
934 (cond ((mh-position-on-field target)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
935 (let ((eol (point)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
936 (skip-chars-backward " \t")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
937 (delete-region (point) eol))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
938 (if (and (not (eq (logior last-input-char ?`) ?s))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
939 (save-excursion
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
940 (backward-char 1)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
941 (not (looking-at "[:,]"))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
942 (insert ", ")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
943 (insert " ")))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
944 (t
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
945 (if (mh-position-on-field "To:")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
946 (forward-line 1))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
947 (insert (format "%s \n" target))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
948 (backward-char 1)))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
949
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
950
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
951 (defun mh-to-fcc (&optional folder)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
952 "Insert an Fcc: FOLDER field in the current message.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
953 Prompt for the field name with a completion list of the current folders."
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
954 (interactive)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
955 (or folder
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
956 (setq folder (mh-prompt-for-folder
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
957 "Fcc"
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
958 (or (and mh-default-folder-for-message-function
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
959 (save-excursion
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
960 (goto-char (point-min))
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
961 (funcall mh-default-folder-for-message-function)))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
962 "")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
963 t)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
964 (let ((last-input-char ?\C-f))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
965 (expand-abbrev)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
966 (save-excursion
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
967 (mh-to-field)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
968 (insert (if (mh-folder-name-p folder)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
969 (substring folder 1)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
970 folder)))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
971
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
972
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
973 (defun mh-insert-signature ()
19936
78aa8484e6e9 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 17593
diff changeset
974 "Insert the file named by `mh-signature-file-name' at point."
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
975 (interactive)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
976 (insert-file-contents mh-signature-file-name)
11578
d8480e4513ea (mh-insert-signature): Use force-mode-line-update.
Karl Heuer <kwzh@gnu.org>
parents: 11507
diff changeset
977 (force-mode-line-update))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
978
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
979
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
980 (defun mh-check-whom ()
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
981 "Verify recipients of the current letter, showing expansion of any aliases."
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
982 (interactive)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
983 (let ((file-name buffer-file-name))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
984 (save-buffer)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
985 (message "Checking recipients...")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
986 (mh-in-show-buffer ("*Recipients*")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
987 (bury-buffer (current-buffer))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
988 (erase-buffer)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
989 (mh-exec-cmd-output "whom" t file-name))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
990 (message "Checking recipients...done")))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
991
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
992
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
993
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
994 ;;; Routines to compose and send a letter.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
995
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
996 (defun mh-insert-x-mailer ()
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
997 ;; Appends an X-Mailer field to the header.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
998 ;; The versions of mh-e, Emacs, and MH are shown.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
999
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1000 ;; Lazily initialize mh-x-mailer-string.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1001 (when (null mh-x-mailer-string)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1002 (save-window-excursion
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1003 (mh-version)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1004 (set-buffer mh-temp-buffer)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1005 (if mh-nmh-p
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1006 (search-forward-regexp "^nmh-\\(\\S +\\)")
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1007 (search-forward-regexp "^MH \\(\\S +\\)" nil t))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1008 (let ((x-mailer-mh (buffer-substring (match-beginning 1) (match-end 1))))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1009 (setq mh-x-mailer-string
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1010 (format "mh-e %s; %s %s; Emacs %d.%d"
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1011 mh-version (if mh-nmh-p "nmh" "MH") x-mailer-mh
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1012 emacs-major-version emacs-minor-version)))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1013 (kill-buffer mh-temp-buffer)))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1014 ;; Insert X-Mailer, but only if it doesn't already exist.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1015 (save-excursion
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1016 (when (null (mh-goto-header-field "X-Mailer"))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1017 (mh-insert-fields "X-Mailer:" mh-x-mailer-string))))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1018
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1019
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1020 (defun mh-compose-and-send-mail (draft send-args
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1021 sent-from-folder sent-from-msg
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1022 to subject cc
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1023 annotate-char annotate-field
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1024 config)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1025 ;; Edit and compose a draft message in buffer DRAFT and send or save it.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1026 ;; SENT-FROM-FOLDER is buffer containing scan listing of current folder, or
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1027 ;; nil if none exists.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1028 ;; SENT-FROM-MSG is the message number or sequence name or nil.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1029 ;; SEND-ARGS is an optional argument passed to the send command.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1030 ;; The TO, SUBJECT, and CC fields are passed to the
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1031 ;; mh-compose-letter-function.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1032 ;; If ANNOTATE-CHAR is non-null, it is used to notate the scan listing of the
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1033 ;; message. In that case, the ANNOTATE-FIELD is used to build a string
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1034 ;; for mh-annotate-msg.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1035 ;; CONFIG is the window configuration to restore after sending the letter.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1036 (pop-to-buffer draft)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1037 (mh-letter-mode)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1038 (setq mh-sent-from-folder sent-from-folder)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1039 (setq mh-sent-from-msg sent-from-msg)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1040 (setq mh-send-args send-args)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1041 (setq mh-annotate-char annotate-char)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1042 (setq mh-annotate-field annotate-field)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1043 (setq mh-previous-window-config config)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1044 (setq mode-line-buffer-identification (list "{%b}"))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1045 (if (and (boundp 'mh-compose-letter-function)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1046 mh-compose-letter-function)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1047 ;; run-hooks will not pass arguments.
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1048 (let ((value mh-compose-letter-function))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1049 (if (and (listp value) (not (eq (car value) 'lambda)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1050 (while value
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1051 (funcall (car value) to subject cc)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1052 (setq value (cdr value)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1053 (funcall mh-compose-letter-function to subject cc)))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1054
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 (defun mh-send-letter (&optional arg)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1057 "Send the draft letter in the current buffer.
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1058 If optional prefix argument ARG is provided, monitor delivery.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1059 Run `mh-before-send-letter-hook' before actually doing anything.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1060 Run `\\[mh-edit-mhn]' if variable `mh-mhn-compose-insert-p' is set."
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1061 (interactive "P")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1062 (run-hooks 'mh-before-send-letter-hook)
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1063 (if (and (boundp 'mh-mhn-compose-insert-p)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1064 mh-mhn-compose-insert-p)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1065 (mh-edit-mhn))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1066 (if mh-insert-x-mailer-p (mh-insert-x-mailer))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1067 (save-buffer)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1068 (message "Sending...")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1069 (let ((draft-buffer (current-buffer))
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1070 (file-name buffer-file-name)
19936
78aa8484e6e9 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 17593
diff changeset
1071 (config mh-previous-window-config)
78aa8484e6e9 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 17593
diff changeset
1072 (coding-system-for-write
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1073 (if (and (local-variable-p 'buffer-file-coding-system
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1074 (current-buffer)) ;XEmacs needs two args
19952
3e0041620fc2 Fix previous change.
Richard M. Stallman <rms@gnu.org>
parents: 19936
diff changeset
1075 ;; We're not sure why, but buffer-file-coding-system
3e0041620fc2 Fix previous change.
Richard M. Stallman <rms@gnu.org>
parents: 19936
diff changeset
1076 ;; tends to get set to undecided-unix.
3e0041620fc2 Fix previous change.
Richard M. Stallman <rms@gnu.org>
parents: 19936
diff changeset
1077 (not (memq buffer-file-coding-system
3e0041620fc2 Fix previous change.
Richard M. Stallman <rms@gnu.org>
parents: 19936
diff changeset
1078 '(undecided undecided-unix undecided-dos))))
19936
78aa8484e6e9 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 17593
diff changeset
1079 buffer-file-coding-system
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1080 (or (and (boundp 'sendmail-coding-system) sendmail-coding-system)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1081 (and (boundp 'default-buffer-file-coding-system )
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1082 default-buffer-file-coding-system)
19936
78aa8484e6e9 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 17593
diff changeset
1083 'iso-latin-1))))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1084 (cond (arg
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1085 (pop-to-buffer "MH mail delivery")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1086 (erase-buffer)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1087 (mh-exec-cmd-output mh-send-prog t "-watch" "-nopush"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1088 "-nodraftfolder" mh-send-args file-name)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1089 (goto-char (point-max)) ; show the interesting part
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1090 (recenter -1)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1091 (set-buffer draft-buffer)) ; for annotation below
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1092 (t
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1093 (mh-exec-cmd-daemon mh-send-prog "-nodraftfolder" "-noverbose"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1094 mh-send-args file-name)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1095 (if mh-annotate-char
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1096 (mh-annotate-msg mh-sent-from-msg
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1097 mh-sent-from-folder
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1098 mh-annotate-char
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1099 "-component" mh-annotate-field
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1100 "-text" (format "\"%s %s\""
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1101 (mh-get-header-field "To:")
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1102 (mh-get-header-field "Cc:"))))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1103
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1104 (cond ((or (not arg)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1105 (y-or-n-p "Kill draft buffer? "))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1106 (kill-buffer draft-buffer)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1107 (if config
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1108 (set-window-configuration config))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1109 (if arg
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1110 (message "Sending...done")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1111 (message "Sending...backgrounded"))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1112
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1113
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1114 (defun mh-insert-letter (folder message verbatim)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1115 "Insert a message into the current letter.
19936
78aa8484e6e9 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 17593
diff changeset
1116 Removes the message's headers using `mh-invisible-headers'. Prefixes
78aa8484e6e9 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 17593
diff changeset
1117 each non-blank line with `mh-ins-buf-prefix'. Prompts for FOLDER and
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1118 MESSAGE. If prefix argument VERBATIM provided, do not indent and do
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1119 not delete headers. Leaves the mark before the letter and point after it."
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1120 (interactive
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1121 (list (mh-prompt-for-folder "Message from" mh-sent-from-folder nil)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1122 (read-input (format "Message number%s: "
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1123 (if mh-sent-from-msg
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1124 (format " [%d]" mh-sent-from-msg)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1125 "")))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1126 current-prefix-arg))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1127 (save-restriction
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1128 (narrow-to-region (point) (point))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1129 (let ((start (point-min)))
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1130 (if (equal message "") (setq message (int-to-string mh-sent-from-msg)))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1131 (mh-exec-lib-cmd-output "mhl" "-nobell" "-noclear"
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1132 (expand-file-name message
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1133 (mh-expand-file-name folder)))
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1134 (cond ((not verbatim)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1135 (mh-clean-msg-header start mh-invisible-headers mh-visible-headers)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1136 (set-mark start) ; since mh-clean-msg-header moves it
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1137 (mh-insert-prefix-string mh-ins-buf-prefix))))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1138
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1139
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1140 (defun mh-yank-cur-msg ()
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1141 "Insert the current message into the draft buffer.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1142 Prefix each non-blank line in the message with the string in
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1143 `mh-ins-buf-prefix'. If a region is set in the message's buffer, then
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1144 only the region will be inserted. Otherwise, the entire message will
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1145 be inserted if `mh-yank-from-start-of-msg' is non-nil. If this variable
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1146 is nil, the portion of the message following the point will be yanked.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1147 If `mh-delete-yanked-msg-window' is non-nil, any window displaying the
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1148 yanked message will be deleted."
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1149 (interactive)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1150 (if (and mh-sent-from-folder mh-sent-from-msg)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1151 (let ((to-point (point))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1152 (to-buffer (current-buffer)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1153 (set-buffer mh-sent-from-folder)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1154 (if mh-delete-yanked-msg-window
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1155 (delete-windows-on mh-show-buffer))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1156 (set-buffer mh-show-buffer) ; Find displayed message
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1157 (let ((mh-ins-str (cond ((if (boundp 'mark-active)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1158 mark-active ;Emacs 19
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1159 (mark)) ;Emacs 18
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1160 (buffer-substring (region-beginning)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1161 (region-end)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1162 ((eq 'body mh-yank-from-start-of-msg)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1163 (buffer-substring
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1164 (save-excursion
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1165 (goto-char (point-min))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1166 (mh-goto-header-end 1)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1167 (point))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1168 (point-max)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1169 (mh-yank-from-start-of-msg
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1170 (buffer-substring (point-min) (point-max)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1171 (t
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1172 (buffer-substring (point) (point-max))))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1173 (set-buffer to-buffer)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1174 (save-restriction
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1175 (narrow-to-region to-point to-point)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1176 (push-mark)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1177 (insert mh-ins-str)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1178 (mh-insert-prefix-string mh-ins-buf-prefix)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1179 (insert "\n"))))
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1180 (error "There is no current message")))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1181
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1182
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1183 (defun mh-insert-prefix-string (mh-ins-string)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1184 ;; Run mail-citation-hook to insert a prefix string before each line
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1185 ;; in the buffer. Generality for supercite users.
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1186 (set-mark (point-max))
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1187 (goto-char (point-min))
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1188 (cond (mail-citation-hook
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1189 (run-hooks 'mail-citation-hook))
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1190 (mh-yank-hooks ;old hook name
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1191 (run-hooks 'mh-yank-hooks))
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1192 (t
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1193 (or (bolp) (forward-line 1))
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1194 (let ((zmacs-regions nil)) ;so "(mark)" works in XEmacs
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1195 (while (< (point) (mark))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1196 (insert mh-ins-string)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1197 (forward-line 1))))))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1198
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1199
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1200 (defun mh-fully-kill-draft ()
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1201 "Kill the draft message file and the draft message buffer.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1202 Use \\[kill-buffer] if you don't want to delete the draft message file."
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1203 (interactive)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1204 (if (y-or-n-p "Kill draft message? ")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1205 (let ((config mh-previous-window-config))
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1206 (if (file-exists-p buffer-file-name)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1207 (delete-file buffer-file-name))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1208 (set-buffer-modified-p nil)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1209 (kill-buffer (buffer-name))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1210 (message "")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1211 (if config
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1212 (set-window-configuration config)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1213 (error "Message not killed")))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1214
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1215
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1216 (defun mh-current-fill-prefix ()
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1217 ;; Return the fill-prefix on the current line as a string.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1218 (save-excursion
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1219 (beginning-of-line)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1220 ;; This assumes that the major-mode sets up adaptive-fill-regexp
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1221 ;; correctly such as mh-letter-mode or sendmail.el's mail-mode. But
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1222 ;; perhaps I should use the variable and simply inserts its value here,
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1223 ;; and set it locally in a let scope. --psg
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1224 (if (re-search-forward adaptive-fill-regexp nil t)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1225 (match-string 0)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1226 "")))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1227
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1228
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1229 (defun mh-open-line ()
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1230 "Insert a newline and leave point after it.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1231 In addition, insert newline and quoting characters before text after point.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1232 This is useful in breaking up paragraphs in replies."
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1233 (interactive)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1234 (let ((column (current-column))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1235 (point (point))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1236 (prefix (mh-current-fill-prefix)))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1237 (if (> (length prefix) column)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1238 (message "Sorry, point seems to be within the line prefix")
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1239 (newline 2)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1240 (insert prefix)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1241 (while (> column (current-column))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1242 (insert " "))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1243 (forward-line -1))))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1244
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1245
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1246 ;;; Build the letter-mode keymap:
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1247 (gnus-define-keys mh-letter-mode-map
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1248 "\C-c\C-f\C-b" mh-to-field
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1249 "\C-c\C-f\C-c" mh-to-field
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1250 "\C-c\C-f\C-d" mh-to-field
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1251 "\C-c\C-f\C-f" mh-to-fcc
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1252 "\C-c\C-f\C-r" mh-to-field
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1253 "\C-c\C-f\C-s" mh-to-field
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1254 "\C-c\C-f\C-t" mh-to-field
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1255 "\C-c\C-fb" mh-to-field
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1256 "\C-c\C-fc" mh-to-field
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1257 "\C-c\C-fd" mh-to-field
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1258 "\C-c\C-ff" mh-to-fcc
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1259 "\C-c\C-fr" mh-to-field
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1260 "\C-c\C-fs" mh-to-field
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1261 "\C-c\C-ft" mh-to-field
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1262 "\C-c\C-i" mh-insert-letter
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1263 "\C-c\C-o" mh-open-line
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1264 "\C-c\C-q" mh-fully-kill-draft
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1265 "\C-c\C-\\" mh-fully-kill-draft ;if no C-q
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1266 "\C-c\C-s" mh-insert-signature
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1267 "\C-c\C-^" mh-insert-signature ;if no C-s
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1268 "\C-c\C-w" mh-check-whom
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1269 "\C-c\C-y" mh-yank-cur-msg
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1270 "\C-c\C-c" mh-send-letter
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1271 "\C-c\C-m\C-f" mh-mhn-compose-forw
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1272 "\C-c\C-m\C-e" mh-mhn-compose-anon-ftp
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1273 "\C-c\C-m\C-t" mh-mhn-compose-external-compressed-tar
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1274 "\C-c\C-m\C-i" mh-mhn-compose-insertion
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1275 "\C-c\C-e" mh-edit-mhn
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1276 "\C-c\C-m\C-u" mh-revert-mhn-edit)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1277
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1278 ;; "C-c /" prefix is used in mh-letter-mode by pgp.el and mailcrypt.el.
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1279
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1280 ;;; Menu extracted from mh-menubar.el V1.1 (31 July 2001)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1281 (cond
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1282 ((fboundp 'easy-menu-define)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1283 (easy-menu-define
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1284 mh-letter-menu mh-letter-mode-map "Menu for mh-e letter mode."
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1285 '("Letter"
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1286 ["Send This Draft" mh-send-letter t]
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1287 ["Split Current Line" mh-open-line t]
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1288 ["Check Recipient" mh-check-whom t]
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1289 ["Yank Current Message" mh-yank-cur-msg t]
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1290 ["Insert a Message..." mh-insert-letter t]
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1291 ["Insert Signature" mh-insert-signature t]
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1292 ["Compose Insertion (MIME)..." mh-mhn-compose-insertion t]
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1293 ["Compose Compressed tar (MIME)..." mh-mhn-compose-external-compressed-tar t]
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1294 ["Compose Anon FTP (MIME)..." mh-mhn-compose-anon-ftp t]
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1295 ["Compose Forward (MIME)..." mh-mhn-compose-forw t]
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1296 ["Pull in All Compositions (MIME)" mh-edit-mhn t]
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1297 ["Revert to Non-MIME Edit" mh-revert-mhn-edit t]
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1298 ["Kill This Draft" mh-fully-kill-draft t]))))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1299
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1300 (defun mh-customize ()
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1301 "Customize mh-e variables."
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1302 (interactive)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1303 (customize-group 'mh))
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1304
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1305 ;;; Support for emacs21 toolbar using gnus/message.el icons (and code).
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1306 (eval-when-compile (defvar tool-bar-map))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1307 (when (and (fboundp 'tool-bar-add-item)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1308 tool-bar-mode)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1309 (defvar mh-letter-tool-bar-map
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1310 (let ((tool-bar-map (make-sparse-keymap)))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1311 (tool-bar-add-item "mail_send" 'mh-send-letter 'mh-letter-send
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1312 :help "Send this letter")
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1313 (tool-bar-add-item "attach" 'mh-mhn-compose-insertion 'mh-letter-compose
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1314 :help "Insert attachment")
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1315 (tool-bar-add-item "spell" 'ispell-message 'mh-letter-ispell
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1316 :help "Check spelling")
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1317 (tool-bar-add-item-from-menu 'save-buffer "save")
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1318 (tool-bar-add-item-from-menu 'undo "undo")
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1319 (tool-bar-add-item-from-menu 'kill-region "cut")
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1320 (tool-bar-add-item-from-menu 'menu-bar-kill-ring-save "copy")
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1321 (tool-bar-add-item "close" 'mh-fully-kill-draft 'mh-letter-kill
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1322 :help "Kill this draft")
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1323 (tool-bar-add-item "preferences" (lambda ()
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1324 (interactive)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1325 (customize-group "mh-compose"))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1326 'mh-letter-customize
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1327 :help "mh-e composition preferences")
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1328 (tool-bar-add-item "help" (lambda ()
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1329 (interactive)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1330 (Info-goto-node "(mh-e)Draft Editing"))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1331 'mh-letter-help :help "Help")
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1332 tool-bar-map)))
38414
67b464da13ec Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 35975
diff changeset
1333
67b464da13ec Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 35975
diff changeset
1334 ;;; mh-comp.el ends here