annotate lisp/mail/mh-comp.el @ 30586:9b8feaf1cd2f

(menu-bar-games-menu): Add Zone.
author Eli Zaretskii <eliz@gnu.org>
date Fri, 04 Aug 2000 08:34:51 +0000
parents 25fb2df6c428
children c4366892a814
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1 ;;; mh-comp --- mh-e functions for composing messages
13385
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
2 ;; Time-stamp: <95/08/19 17:48:59 gildea>
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3
17426
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
4 ;; Copyright (C) 1993, 1995, 1997 Free Software Foundation, Inc.
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5
13385
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
6 ;; This file is part of mh-e, part of GNU Emacs.
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
7
11333
53174cfc29fa Comment fixes.
Karl Heuer <kwzh@gnu.org>
parents: 11332
diff changeset
8 ;; 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
9 ;; 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
10 ;; the Free Software Foundation; either version 2, or (at your option)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
11 ;; any later version.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
12
11333
53174cfc29fa Comment fixes.
Karl Heuer <kwzh@gnu.org>
parents: 11332
diff changeset
13 ;; 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
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
16 ;; GNU General Public License for more details.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
17
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
18 ;; 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
19 ;; 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
20 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13385
diff changeset
21 ;; Boston, MA 02111-1307, USA.
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
22
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
23 ;;; Commentary:
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
24
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
25 ;; Internal support for mh-e package.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
26
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
27 ;;; Change Log:
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
28
29420
25fb2df6c428 (mh-send-sub): Check mh-etc is bound before using it.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28739
diff changeset
29 ;; $Id: mh-comp.el,v 1.17 2000/04/27 18:56:42 gerd Exp $
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
30
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
31 ;;; Code:
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
32
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
33 (provide 'mh-comp)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
34 (require 'mh-utils)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
35
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
36 ;;; Site customization (see also mh-utils.el):
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
37
17426
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
38 (defgroup mh-compose nil
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
39 "Mh-e functions for composing messages"
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
40 :prefix "mh-"
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
41 :group 'mh)
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
42
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
43
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
44 (defvar mh-send-prog "send"
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
45 "Name of the MH send program.
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
46 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
47
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
48 (defvar mh-redist-full-contents nil
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
49 "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
50 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
51 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
52
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
53
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
54 (defvar mh-note-repl "-"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
55 "String whose first character is used to notate replied to messages.")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
56
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
57 (defvar mh-note-forw "F"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
58 "String whose first character is used to notate forwarded messages.")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
59
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
60 (defvar mh-note-dist "R"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
61 "String whose first character is used to notate redistributed messages.")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
62
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
63 (defvar mh-yank-hooks nil
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
64 "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
65 Each hook function can find the citation between point and mark.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
66 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
67 text as modified.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
68
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
69 This is a normal hook, misnamed for historical reasons.
19936
78aa8484e6e9 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 17593
diff changeset
70 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
71
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
72 (defvar mail-citation-hook nil
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
73 "*Hook for modifying a citation just inserted in the mail buffer.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
74 Each hook function can find the citation between point and mark.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
75 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
76 text as modified.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
77
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
78 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
79 with `mh-ins-buf-prefix' prefixed to each line.
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
80
19936
78aa8484e6e9 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 17593
diff changeset
81 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
82 much of the message passed to the hook.")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
83
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
84 ;;; Copied from sendmail.el for Hyperbole
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
85 (defvar mail-header-separator "--------"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
86 "*Line used by MH to separate headers from text in messages being composed.")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
87
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
88 ;;; Personal preferences:
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
89
17426
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
90 (defcustom mh-delete-yanked-msg-window nil
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
91 "*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
92 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
93 windows displaying the message."
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
94 :type 'boolean
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
95 :group 'mh-compose)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
96
17426
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
97 (defcustom mh-yank-from-start-of-msg t
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
98 "*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
99 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
100 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
101 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
102 ignored."
22590
fd24f556ad8f (mh-yank-from-start-of-msg): Use `other' widget
Andreas Schwab <schwab@suse.de>
parents: 19952
diff changeset
103 :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
104 (const :tag "Without header" body)
fd24f556ad8f (mh-yank-from-start-of-msg): Use `other' widget
Andreas Schwab <schwab@suse.de>
parents: 19952
diff changeset
105 (other :tag "Entire message" t))
17426
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
106 :group 'mh-compose)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
107
17426
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
108 (defcustom mh-ins-buf-prefix "> "
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
109 "*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
110 \\<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
111 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
112 :type 'string
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
113 :group 'mh-compose)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
114
17426
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
115 (defcustom mh-reply-default-reply-to nil
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
116 "*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
117 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
118 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
119 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
120 :type '(choice (const :tag "Prompt" nil)
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
121 (const "from") (const "to")
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
122 (const "cc") (const "all"))
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
123 :group 'mh-compose)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
124
17426
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
125 (defcustom mh-signature-file-name "~/.signature"
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
126 "*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
127 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
128 :type 'file
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
129 :group 'mh-compose)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
130
17426
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
131 (defcustom mh-forward-subject-format "%s: %s"
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
132 "*Format to generate the Subject: line contents for a forwarded message.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
133 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
134 message and the original subject line."
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
135 :type 'string
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
136 :group 'mh-compose)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
137
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
138 (defvar mh-comp-formfile "components"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
139 "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
140 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
141 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
142 system MH lib directory.")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
143
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
144 (defvar mh-repl-formfile "replcomps"
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
145 "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
146 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
147 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
148 system MH lib directory.")
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
149
24421
d072093cd922 (mh-repl-formfile): New var.
Karl Heuer <kwzh@gnu.org>
parents: 22590
diff changeset
150 (defvar mh-repl-group-formfile "replgroupcomps"
d072093cd922 (mh-repl-formfile): New var.
Karl Heuer <kwzh@gnu.org>
parents: 22590
diff changeset
151 "Name of file to be used as a skeleton for replying to the sender
d072093cd922 (mh-repl-formfile): New var.
Karl Heuer <kwzh@gnu.org>
parents: 22590
diff changeset
152 and all recipients of a messages. Only used if mh-nmh-p is non-nil.
d072093cd922 (mh-repl-formfile): New var.
Karl Heuer <kwzh@gnu.org>
parents: 22590
diff changeset
153 Default is \"replgroupcomps\". If not an absolute file name, the file
d072093cd922 (mh-repl-formfile): New var.
Karl Heuer <kwzh@gnu.org>
parents: 22590
diff changeset
154 is searched for first in the user's MH directory, then in the system
d072093cd922 (mh-repl-formfile): New var.
Karl Heuer <kwzh@gnu.org>
parents: 22590
diff changeset
155 MH lib directory.")
d072093cd922 (mh-repl-formfile): New var.
Karl Heuer <kwzh@gnu.org>
parents: 22590
diff changeset
156
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
157 ;;; Hooks:
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
158
17426
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
159 (defcustom mh-letter-mode-hook nil
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
160 "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
161 :type 'hook
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
162 :group 'mh-compose)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
163
17426
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
164 (defcustom mh-compose-letter-function nil
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
165 "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
166 It is passed three arguments: TO recipients, SUBJECT, and CC recipients."
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
167 :type 'function
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
168 :group 'mh-compose)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
169
17426
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
170 (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
171 "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
172 :type 'hook
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
173 :group 'mh-compose)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
174
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
175
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
176 (defvar mh-rejected-letter-start
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
177 (concat "^ ----- Unsent message follows -----$" ;from sendmail V5
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
178 "\\|^ ----- Original message follows -----$" ;from sendmail V8
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
179 "\\|^------- Unsent Draft$" ;from MH itself
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
180 "\\|^---------- Original Message ----------$" ;from zmailer
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
181 "\\|^ --- The unsent message follows ---$" ;from AIX mail system
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
182 "\\|^ Your message follows:$" ;from MMDF-II
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
183 "\\|^Content-Description: Returned Content$" ;1993 KJ sendmail
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
184 )
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
185 "Regexp specifying the beginning of the wrapper around a returned letter.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
186 This wrapper is generated by the mail system when rejecting a letter.")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
187
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
188 (defvar mh-new-draft-cleaned-headers
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
189 "^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
190 "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
191 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
192
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
193 (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
194 ("b" . "Bcc:") ("f" . "Fcc:") ("r" . "From:")
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
195 ("d" . "Dcc:"))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
196 "Alist of (final-character . field-name) choices for mh-to-field.")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
197
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
198 (defvar mh-letter-mode-map (copy-keymap text-mode-map)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
199 "Keymap for composing mail.")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
200
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
201 (defvar mh-letter-mode-syntax-table nil
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
202 "Syntax table used by mh-e while in MH-Letter mode.")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
203
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
204 (if mh-letter-mode-syntax-table
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
205 ()
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
206 (setq mh-letter-mode-syntax-table
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
207 (make-syntax-table text-mode-syntax-table))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
208 (modify-syntax-entry ?% "." mh-letter-mode-syntax-table))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
209
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
210
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
211 ;;;###autoload
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
212 (defun mh-smail ()
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
213 "Compose and send mail with the MH mail system.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
214 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
215 to the MH mail system.
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
216
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
217 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
218 (interactive)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
219 (mh-find-path)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
220 (call-interactively 'mh-send))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
221
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
222
13385
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
223 (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
224
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
225
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
226 ;;;###autoload
24421
d072093cd922 (mh-repl-formfile): New var.
Karl Heuer <kwzh@gnu.org>
parents: 22590
diff changeset
227 (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
228 "Set up a mail composition draft with the MH mail system.
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
229 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
230 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
231 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
232 that want to create a mail buffer.
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
233 Users should use `\\[mh-smail]' to compose mail."
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
234 (mh-find-path)
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
235 (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
236 (mh-send (or to "") "" (or subject ""))))
13385
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
237
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
238
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
239 (defun mh-edit-again (msg)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
240 "Clean-up a draft or a message previously sent and make it resendable.
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
241 Default is the current message.
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
242 The variable mh-new-draft-cleaned-headers specifies the headers to remove.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
243 See also documentation for `\\[mh-send]' function."
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
244 (interactive (list (mh-get-msg-num t)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
245 (let* ((from-folder mh-current-folder)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
246 (config (current-window-configuration))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
247 (draft
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
248 (cond ((and mh-draft-folder (equal from-folder mh-draft-folder))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
249 (pop-to-buffer (find-file-noselect (mh-msg-filename msg)) t)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
250 (rename-buffer (format "draft-%d" msg))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
251 (buffer-name))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
252 (t
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
253 (mh-read-draft "clean-up" (mh-msg-filename msg) nil)))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
254 (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
255 (goto-char (point-min))
13385
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
256 (save-buffer)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
257 (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
258 config)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
259
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
260
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
261 (defun mh-extract-rejected-mail (msg)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
262 "Extract a letter returned by the mail system and make it resendable.
19936
78aa8484e6e9 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 17593
diff changeset
263 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
264 gives the headers to clean out of the original message.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
265 See also documentation for `\\[mh-send]' function."
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
266 (interactive (list (mh-get-msg-num t)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
267 (let ((from-folder mh-current-folder)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
268 (config (current-window-configuration))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
269 (draft (mh-read-draft "extraction" (mh-msg-filename msg) nil)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
270 (goto-char (point-min))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
271 (cond ((re-search-forward mh-rejected-letter-start nil t)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
272 (skip-chars-forward " \t\n")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
273 (delete-region (point-min) (point))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
274 (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
275 (t
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
276 (message "Does not appear to be a rejected letter.")))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
277 (goto-char (point-min))
13385
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
278 (save-buffer)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
279 (mh-compose-and-send-mail draft "" from-folder msg
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
280 (mh-get-header-field "To:")
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
281 (mh-get-header-field "From:")
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
282 (mh-get-header-field "Cc:")
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
283 nil nil config)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
284
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
285
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
286 (defun mh-forward (to cc &optional msg-or-seq)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
287 "Forward a message or message sequence. Defaults to displayed message.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
288 If optional prefix argument provided, then prompt for the message sequence.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
289 See also documentation for `\\[mh-send]' function."
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
290 (interactive (list (mh-read-address "To: ")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
291 (mh-read-address "Cc: ")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
292 (if current-prefix-arg
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
293 (mh-read-seq-default "Forward" t)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
294 (mh-get-msg-num t))))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
295 (or msg-or-seq
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
296 (setq msg-or-seq (mh-get-msg-num t)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
297 (let* ((folder mh-current-folder)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
298 (config (current-window-configuration))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
299 ;; 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
300 (draft-name (expand-file-name "draft" mh-user-path))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
301 (draft (cond ((or (not (file-exists-p draft-name))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
302 (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
303 (mh-exec-cmd "forw" "-build"
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
304 mh-current-folder msg-or-seq)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
305 (prog1
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
306 (mh-read-draft "" draft-name t)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
307 (mh-insert-fields "To:" to "Cc:" cc)
13385
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
308 (save-buffer)))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
309 (t
25535
2fe0f62fa349 (mh-forward): Get new subject line from the original,
Richard M. Stallman <rms@gnu.org>
parents: 24421
diff changeset
310 (mh-read-draft "" draft-name nil))))
2fe0f62fa349 (mh-forward): Get new subject line from the original,
Richard M. Stallman <rms@gnu.org>
parents: 24421
diff changeset
311 (fwd-msg-file (mh-msg-filename (if (numberp msg-or-seq)
2fe0f62fa349 (mh-forward): Get new subject line from the original,
Richard M. Stallman <rms@gnu.org>
parents: 24421
diff changeset
312 msg-or-seq
2fe0f62fa349 (mh-forward): Get new subject line from the original,
Richard M. Stallman <rms@gnu.org>
parents: 24421
diff changeset
313 (car (mh-seq-to-msgs msg-or-seq)))
2fe0f62fa349 (mh-forward): Get new subject line from the original,
Richard M. Stallman <rms@gnu.org>
parents: 24421
diff changeset
314 folder)))
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
315 (let (orig-from
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
316 orig-subject)
25535
2fe0f62fa349 (mh-forward): Get new subject line from the original,
Richard M. Stallman <rms@gnu.org>
parents: 24421
diff changeset
317 (save-excursion
2fe0f62fa349 (mh-forward): Get new subject line from the original,
Richard M. Stallman <rms@gnu.org>
parents: 24421
diff changeset
318 (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
319 (erase-buffer)
2fe0f62fa349 (mh-forward): Get new subject line from the original,
Richard M. Stallman <rms@gnu.org>
parents: 24421
diff changeset
320 (insert-file-contents fwd-msg-file)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
321 (setq orig-from (mh-get-header-field "From:"))
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
322 (setq orig-subject (mh-get-header-field "Subject:")))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
323 (let ((forw-subject
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
324 (mh-forwarded-letter-subject orig-from orig-subject)))
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
325 (mh-insert-fields "Subject:" forw-subject)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
326 (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
327 (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
328 (forward-line -1)
2fe0f62fa349 (mh-forward): Get new subject line from the original,
Richard M. Stallman <rms@gnu.org>
parents: 24421
diff changeset
329 (re-search-forward "^--------")
2fe0f62fa349 (mh-forward): Get new subject line from the original,
Richard M. Stallman <rms@gnu.org>
parents: 24421
diff changeset
330 (forward-line 1))
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
331 (delete-other-windows)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
332 (if (numberp msg-or-seq)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
333 (mh-add-msgs-to-seq msg-or-seq 'forwarded t)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
334 (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
335 (mh-compose-and-send-mail draft "" folder msg-or-seq
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
336 to forw-subject cc
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
337 mh-note-forw "Forwarded:"
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
338 config)))))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
339
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
340 (defun mh-forwarded-letter-subject (from subject)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
341 ;; Return a Subject suitable for a forwarded message.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
342 ;; Original message has headers FROM and SUBJECT.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
343 (let ((addr-start (string-match "<" from))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
344 (comment (string-match "(" from)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
345 (cond ((and addr-start (> addr-start 0))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
346 ;; Full Name <luser@host>
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
347 (setq from (substring from 0 (1- addr-start))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
348 (comment
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
349 ;; luser@host (Full Name)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
350 (setq from (substring from (1+ comment) (1- (length from)))))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
351 (format mh-forward-subject-format from subject))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
352
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
353
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
354 ;;;###autoload
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
355 (defun mh-smail-other-window ()
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
356 "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
357 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
358 to the MH mail system.
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
359
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
360 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
361 (interactive)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
362 (mh-find-path)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
363 (call-interactively 'mh-send-other-window))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
364
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
366 (defun mh-redistribute (to cc &optional msg)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
367 "Redistribute a letter.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
368 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
369 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
370 (interactive (list (mh-read-address "Redist-To: ")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
371 (mh-read-address "Redist-Cc: ")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
372 (mh-get-msg-num t)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
373 (or msg
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
374 (setq msg (mh-get-msg-num t)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
375 (save-window-excursion
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
376 (let ((folder mh-current-folder)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
377 (draft (mh-read-draft "redistribution"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
378 (if mh-redist-full-contents
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
379 (mh-msg-filename msg)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
380 nil)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
381 nil)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
382 (mh-goto-header-end 0)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
383 (insert "Resent-To: " to "\n")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
384 (if (not (equal cc "")) (insert "Resent-cc: " cc "\n"))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
385 (mh-clean-msg-header (point-min)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
386 "^Message-Id:\\|^Received:\\|^Return-Path:\\|^Sender:\\|^Date:\\|^From:"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
387 nil)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
388 (save-buffer)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
389 (message "Redistributing...")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
390 (if mh-redist-full-contents
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
391 (call-process "/bin/sh" nil 0 nil "-c"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
392 (format "mhdist=1 mhaltmsg=%s %s -push %s"
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
393 buffer-file-name
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
394 (expand-file-name mh-send-prog mh-progs)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
395 buffer-file-name))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
396 (call-process "/bin/sh" nil 0 nil "-c"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
397 (format "mhdist=1 mhaltmsg=%s mhannotate=1 %s -push %s"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
398 (mh-msg-filename msg folder)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
399 (expand-file-name mh-send-prog mh-progs)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
400 buffer-file-name)))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
401 (mh-annotate-msg msg folder mh-note-dist
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
402 "-component" "Resent:"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
403 "-text" (format "\"%s %s\"" to cc))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
404 (kill-buffer draft)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
405 (message "Redistributing...done"))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
406
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
407
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
408 (defun mh-reply (message &optional includep)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
409 "Reply to MESSAGE (default: current message).
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
410 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
411 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
412 Prompts for type of addresses to reply to:
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
413 from sender only,
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
414 to sender and primary recipients,
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
415 cc/all sender and all recipients.
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
416 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
417 for the reply. See also documentation for `\\[mh-send]' function."
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
418 (interactive (list (mh-get-msg-num t) current-prefix-arg))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
419 (let ((minibuffer-help-form
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
420 "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
421 (let* ((reply-to (or mh-reply-default-reply-to
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
422 (completing-read "Reply to whom: "
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
423 '(("from") ("to") ("cc") ("all"))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
424 nil
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
425 t)))
24421
d072093cd922 (mh-repl-formfile): New var.
Karl Heuer <kwzh@gnu.org>
parents: 22590
diff changeset
426 (folder mh-current-folder)
d072093cd922 (mh-repl-formfile): New var.
Karl Heuer <kwzh@gnu.org>
parents: 22590
diff changeset
427 (show-buffer mh-show-buffer)
d072093cd922 (mh-repl-formfile): New var.
Karl Heuer <kwzh@gnu.org>
parents: 22590
diff changeset
428 (config (current-window-configuration))
d072093cd922 (mh-repl-formfile): New var.
Karl Heuer <kwzh@gnu.org>
parents: 22590
diff changeset
429 (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
430 (form-file (cond ((and mh-nmh-p group-reply
d072093cd922 (mh-repl-formfile): New var.
Karl Heuer <kwzh@gnu.org>
parents: 22590
diff changeset
431 (stringp mh-repl-group-formfile))
d072093cd922 (mh-repl-formfile): New var.
Karl Heuer <kwzh@gnu.org>
parents: 22590
diff changeset
432 mh-repl-group-formfile)
d072093cd922 (mh-repl-formfile): New var.
Karl Heuer <kwzh@gnu.org>
parents: 22590
diff changeset
433 ((stringp mh-repl-formfile) mh-repl-formfile)
d072093cd922 (mh-repl-formfile): New var.
Karl Heuer <kwzh@gnu.org>
parents: 22590
diff changeset
434 (t nil))))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
435 (message "Composing a reply...")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
436 (mh-exec-cmd "repl" "-build" "-noquery" "-nodraftfolder"
24421
d072093cd922 (mh-repl-formfile): New var.
Karl Heuer <kwzh@gnu.org>
parents: 22590
diff changeset
437 (if form-file
d072093cd922 (mh-repl-formfile): New var.
Karl Heuer <kwzh@gnu.org>
parents: 22590
diff changeset
438 (list "-form" form-file))
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
439 mh-current-folder message
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
440 (cond ((or (equal reply-to "from") (equal reply-to ""))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
441 '("-nocc" "all"))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
442 ((equal reply-to "to")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
443 '("-cc" "to"))
24421
d072093cd922 (mh-repl-formfile): New var.
Karl Heuer <kwzh@gnu.org>
parents: 22590
diff changeset
444 (group-reply (if mh-nmh-p
d072093cd922 (mh-repl-formfile): New var.
Karl Heuer <kwzh@gnu.org>
parents: 22590
diff changeset
445 '("-group" "-nocc" "me")
d072093cd922 (mh-repl-formfile): New var.
Karl Heuer <kwzh@gnu.org>
parents: 22590
diff changeset
446 '("-cc" "all" "-nocc" "me"))))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
447 (if includep
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
448 '("-filter" "mhl.reply")))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
449 (let ((draft (mh-read-draft "reply"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
450 (expand-file-name "reply" mh-user-path)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
451 t)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
452 (delete-other-windows)
13385
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
453 (save-buffer)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
454
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
455 (let ((to (mh-get-header-field "To:"))
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
456 (subject (mh-get-header-field "Subject:"))
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
457 (cc (mh-get-header-field "Cc:")))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
458 (goto-char (point-min))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
459 (mh-goto-header-end 1)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
460 (or includep
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
461 (mh-in-show-buffer (show-buffer)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
462 (mh-display-msg message folder)))
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
463 (mh-add-msgs-to-seq message 'answered t)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
464 (message "Composing a reply...done")
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
465 (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
466 mh-note-repl "Replied:" config))))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
467
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
468
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
469 (defun mh-send (to cc subject)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
470 "Compose and send a letter.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
471 The file named by `mh-comp-formfile' will be used as the form.
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
472 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
473
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
474 The letter is composed in mh-letter-mode; see its documentation for more
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
475 details. If `mh-compose-letter-function' is defined, it is called on the
19936
78aa8484e6e9 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 17593
diff changeset
476 draft and passed three arguments: TO, SUBJECT, and CC."
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
477 (interactive (list
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
478 (mh-read-address "To: ")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
479 (mh-read-address "Cc: ")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
480 (read-string "Subject: ")))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
481 (let ((config (current-window-configuration)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
482 (delete-other-windows)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
483 (mh-send-sub to cc subject config)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
484
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
485
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
486 (defun mh-send-other-window (to cc subject)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
487 "Compose and send a letter in another window.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
488 Do not call this function from outside mh-e;
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
489 use \\[mh-smail-other-window] instead.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
490 See also documentation for `\\[mh-send]' function."
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
491 (interactive (list
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
492 (mh-read-address "To: ")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
493 (mh-read-address "Cc: ")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
494 (read-string "Subject: ")))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
495 (let ((pop-up-windows t))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
496 (mh-send-sub to cc subject (current-window-configuration))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
497
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
498
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
499 (defun mh-send-sub (to cc subject config)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
500 ;; Do the real work of composing and sending a letter.
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
501 ;; Expects the TO, CC, and SUBJECT fields as arguments.
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
502 ;; CONFIG is the window configuration before sending mail.
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
503 (let ((folder mh-current-folder)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
504 (msg-num (mh-get-msg-num nil)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
505 (message "Composing a message...")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
506 (let ((draft (mh-read-draft
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
507 "message"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
508 (let (components)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
509 (cond
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
510 ((file-exists-p
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
511 (setq components
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
512 (expand-file-name mh-comp-formfile mh-user-path)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
513 components)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
514 ((file-exists-p
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
515 (setq components
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
516 (expand-file-name mh-comp-formfile mh-lib)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
517 components)
28739
192cbf5dbea2 (mh-send-sub): Look for mh-comp-formfile in
Gerd Moellmann <gerd@gnu.org>
parents: 26393
diff changeset
518 ((file-exists-p
192cbf5dbea2 (mh-send-sub): Look for mh-comp-formfile in
Gerd Moellmann <gerd@gnu.org>
parents: 26393
diff changeset
519 (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
520 (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
521 ;; 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
522 (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
523 components)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
524 (t
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
525 (error (format "Can't find components file \"%s\""
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
526 components)))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
527 nil)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
528 (mh-insert-fields "To:" to "Subject:" subject "Cc:" cc)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
529 (goto-char (point-max))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
530 (message "Composing a message...done")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
531 (mh-compose-and-send-mail draft "" folder msg-num
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
532 to subject cc
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
533 nil nil config))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
534
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
535
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
536 (defun mh-read-draft (use initial-contents delete-contents-file)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
537 ;; 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
538 ;; USE is a message used for prompting about the intended use of the message.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
539 ;; INITIAL-CONTENTS is filename that is read into an empty buffer, or NIL
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
540 ;; 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
541 ;; DELETE-CONTENTS-FILE flag is set.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
542 ;; Returns the draft folder's name.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
543 ;; 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
544 ;; 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
545 ;; reused.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
546 (cond (mh-draft-folder
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
547 (let ((orig-default-dir default-directory)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
548 (draft-file-name (mh-new-draft-name)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
549 (pop-to-buffer (generate-new-buffer
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
550 (format "draft-%s"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
551 (file-name-nondirectory draft-file-name))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
552 (condition-case ()
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
553 (insert-file-contents draft-file-name t)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
554 (file-error))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
555 (setq default-directory orig-default-dir)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
556 (t
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
557 (let ((draft-name (expand-file-name "draft" mh-user-path)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
558 (pop-to-buffer "draft") ; Create if necessary
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
559 (if (buffer-modified-p)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
560 (if (y-or-n-p "Draft has been modified; kill anyway? ")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
561 (set-buffer-modified-p nil)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
562 (error "Draft preserved")))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
563 (setq buffer-file-name draft-name)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
564 (clear-visited-file-modtime)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
565 (unlock-buffer)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
566 (cond ((and (file-exists-p draft-name)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
567 (not (equal draft-name initial-contents)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
568 (insert-file-contents draft-name)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
569 (delete-file draft-name))))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
570 (cond ((and initial-contents
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
571 (or (zerop (buffer-size))
13385
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
572 (if (y-or-n-p
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
573 (format "A draft exists. Use for %s? " use))
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
574 (if mh-error-if-no-draft
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
575 (error "A prior draft exists."))
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
576 t)))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
577 (erase-buffer)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
578 (insert-file-contents initial-contents)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
579 (if delete-contents-file (delete-file initial-contents))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
580 (auto-save-mode 1)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
581 (if mh-draft-folder
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
582 (save-buffer)) ; Do not reuse draft name
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
583 (buffer-name))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
584
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
585
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
586 (defun mh-new-draft-name ()
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
587 ;; Returns the pathname of folder for draft messages.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
588 (save-excursion
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
589 (mh-exec-cmd-quiet t "mhpath" mh-draft-folder "new")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
590 (buffer-substring (point-min) (1- (point-max)))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
591
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 (defun mh-annotate-msg (msg buffer note &rest args)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
594 ;; 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
595 ;; the saved message with ARGS.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
596 (apply 'mh-exec-cmd "anno" buffer msg args)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
597 (save-excursion
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
598 (cond ((get-buffer buffer) ; Buffer may be deleted
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
599 (set-buffer buffer)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
600 (if (symbolp msg)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
601 (mh-notate-seq msg note (1+ mh-cmd-note))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
602 (mh-notate msg note (1+ mh-cmd-note)))))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
603
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
604
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
605 (defun mh-insert-fields (&rest name-values)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
606 ;; Insert the NAME-VALUE pairs in the current buffer.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
607 ;; If field NAME exists, append VALUE to it.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
608 ;; Do not insert any pairs whose value is the empty string.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
609 (let ((case-fold-search t))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
610 (while name-values
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
611 (let ((field-name (car name-values))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
612 (value (car (cdr name-values))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
613 (cond ((equal value "")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
614 nil)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
615 ((mh-position-on-field field-name)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
616 (insert " " value))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
617 (t
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
618 (insert field-name " " value "\n")))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
619 (setq name-values (cdr (cdr name-values)))))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
620
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
621
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
622 (defun mh-position-on-field (field &optional ignore)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
623 ;; Move to the end of the FIELD in the header.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
624 ;; Move to end of entire header if FIELD not found.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
625 ;; Returns non-nil iff FIELD was found.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
626 ;; The optional second arg is for pre-version 4 compatibility.
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
627 (if (mh-goto-header-field field)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
628 (progn
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
629 (mh-header-field-end)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
630 t)))
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
631
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
632
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
633 (defun mh-get-header-field (field)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
634 ;; 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
635 ;; 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
636 ;; current buffer.
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
637 (if (mh-goto-header-field field)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
638 (progn
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
639 (skip-chars-forward " \t") ;strip leading white space in body
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
640 (let ((start (point)))
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
641 (mh-header-field-end)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
642 (buffer-substring start (point))))
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
643 ""))
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
644
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
645 (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
646
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
647 (defun mh-goto-header-field (field)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
648 ;; Move to FIELD in the message header.
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
649 ;; Move to the end of the FIELD name, which should end in a colon.
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
650 ;; Returns T if found, NIL if not.
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
651 (goto-char (point-min))
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
652 (let ((case-fold-search t)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
653 (headers-end (save-excursion
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
654 (mh-goto-header-end 0)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
655 (point))))
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
656 (re-search-forward (format "^%s" field) headers-end t)))
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
657
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
658 (defun mh-header-field-end ()
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
659 ;; Move to the end of the current header field.
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
660 ;; Handles RFC 822 continuation lines.
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
661 (forward-line 1)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
662 (while (looking-at "^[ \t]")
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
663 (forward-line 1))
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
664 (backward-char 1)) ;to end of previous line
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
665
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
666
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
667 (defun mh-goto-header-end (arg)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
668 ;; 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
669 ;; 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
670 (if (re-search-forward "^-*$" nil nil)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
671 (forward-line arg)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
672
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
673
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
674 (defun mh-read-address (prompt)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
675 ;; 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
676 ;; May someday do completion on aliases.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
677 (read-string prompt))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
678
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
679
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
680
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
681 ;;; Mode for composing and sending a draft message.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
682
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
683 (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
684
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
685 (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
686
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
687 (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
688
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
689 (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
690
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
691 (defvar mh-annotate-field nil) ;Field name for message annotation.
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
692
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
693 (put 'mh-letter-mode 'mode-class 'special)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
694
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
695 ;;;###autoload
29420
25fb2df6c428 (mh-send-sub): Check mh-etc is bound before using it.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28739
diff changeset
696 (define-derived-mode mh-letter-mode text-mode "MH-Letter"
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
697 "Mode for composing letters in mh-e.\\<mh-letter-mode-map>
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
698 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
699 using the MH mail handling system.
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
700 See the documentation for \\[mh-edit-mhn] for information on composing MIME
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
701 messages.
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
702
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
703 \\{mh-letter-mode-map}
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
704
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
705 Variables controlling this mode (defaults in parentheses):
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
706
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
707 mh-delete-yanked-msg-window (nil)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
708 If non-nil, \\[mh-yank-cur-msg] will delete any windows displaying
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
709 the yanked message.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
710
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
711 mh-yank-from-start-of-msg (t)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
712 If non-nil, \\[mh-yank-cur-msg] will include the entire message.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
713 If `body', just yank the body (no header).
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
714 If nil, only the portion of the message following the point will be yanked.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
715 If there is a region, this variable is ignored.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
716
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
717 mh-ins-buf-prefix (\"> \")
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
718 String to insert before each non-blank line of a message as it is
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
719 inserted in a draft letter.
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
720
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
721 mh-signature-file-name (\"~/.signature\")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
722 File to be inserted into message by \\[mh-insert-signature].
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
723
19936
78aa8484e6e9 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 17593
diff changeset
724 This command runs the normal hooks `text-mode-hook' and `mh-letter-mode-hook'."
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
725 (or mh-user-path (mh-find-path))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
726 (make-local-variable 'paragraph-start)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
727 (setq paragraph-start (concat "^[ \t]*[-_][-_][-_]+$\\|" paragraph-start))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
728 (make-local-variable 'paragraph-separate)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
729 (setq paragraph-separate
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
730 (concat "^[ \t]*[-_][-_][-_]+$\\|" paragraph-separate))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
731 (make-local-variable 'mh-send-args)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
732 (make-local-variable 'mh-annotate-char)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
733 (make-local-variable 'mh-annotate-field)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
734 (make-local-variable 'mh-previous-window-config)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
735 (make-local-variable 'mh-sent-from-folder)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
736 (make-local-variable 'mh-sent-from-msg)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
737 (make-local-variable 'mail-header-separator)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
738 (setq mail-header-separator "--------") ;for Hyperbole
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
739 ;; 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
740 (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
741 (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
742 (setq auto-fill-function 'mh-auto-fill-for-letter)))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
743
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
744
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
745 (defun mh-auto-fill-for-letter ()
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
746 ;; 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
747 ;; before continuation line.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
748 (if (mh-in-header-p)
11507
595e689b719b Update some MIME doc strings.
Karl Heuer <kwzh@gnu.org>
parents: 11333
diff changeset
749 (let ((fill-prefix "\t"))
595e689b719b Update some MIME doc strings.
Karl Heuer <kwzh@gnu.org>
parents: 11333
diff changeset
750 (do-auto-fill))
595e689b719b Update some MIME doc strings.
Karl Heuer <kwzh@gnu.org>
parents: 11333
diff changeset
751 (do-auto-fill)))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
752
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 (defun mh-in-header-p ()
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
755 ;; Return non-nil if the point is in the header of a draft message.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
756 (save-excursion
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
757 (let ((cur-point (point)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
758 (goto-char (point-min))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
759 (re-search-forward "^-*$" nil t)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
760 (< cur-point (point)))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
761
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
762
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
763 (defun mh-to-field ()
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
764 "Move point to the end of a specified header field.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
765 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
766 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
767 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
768 (interactive)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
769 (expand-abbrev)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
770 (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
771 mh-to-field-choices)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
772 ;; also look for a char for version 4 compat
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
773 (assoc (logior last-input-char ?`) mh-to-field-choices))))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
774 (case-fold-search t))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
775 (push-mark)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
776 (cond ((mh-position-on-field target)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
777 (let ((eol (point)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
778 (skip-chars-backward " \t")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
779 (delete-region (point) eol))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
780 (if (and (not (eq (logior last-input-char ?`) ?s))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
781 (save-excursion
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
782 (backward-char 1)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
783 (not (looking-at "[:,]"))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
784 (insert ", ")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
785 (insert " ")))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
786 (t
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
787 (if (mh-position-on-field "To:")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
788 (forward-line 1))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
789 (insert (format "%s \n" target))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
790 (backward-char 1)))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
791
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
792
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
793 (defun mh-to-fcc (&optional folder)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
794 "Insert an Fcc: FOLDER field in the current message.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
795 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
796 (interactive)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
797 (or folder
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
798 (setq folder (mh-prompt-for-folder
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
799 "Fcc"
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
800 (or (and mh-default-folder-for-message-function
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
801 (save-excursion
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
802 (goto-char (point-min))
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
803 (funcall mh-default-folder-for-message-function)))
6365
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 t)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
806 (let ((last-input-char ?\C-f))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
807 (expand-abbrev)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
808 (save-excursion
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
809 (mh-to-field)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
810 (insert (if (mh-folder-name-p folder)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
811 (substring folder 1)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
812 folder)))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
813
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
814
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
815 (defun mh-insert-signature ()
19936
78aa8484e6e9 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 17593
diff changeset
816 "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
817 (interactive)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
818 (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
819 (force-mode-line-update))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
820
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
821
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
822 (defun mh-check-whom ()
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
823 "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
824 (interactive)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
825 (let ((file-name buffer-file-name))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
826 (save-buffer)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
827 (message "Checking recipients...")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
828 (mh-in-show-buffer ("*Recipients*")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
829 (bury-buffer (current-buffer))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
830 (erase-buffer)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
831 (mh-exec-cmd-output "whom" t file-name))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
832 (message "Checking recipients...done")))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
833
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
834
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
835
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
836 ;;; Routines to compose and send a letter.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
837
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
838 (defun mh-compose-and-send-mail (draft send-args
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
839 sent-from-folder sent-from-msg
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
840 to subject cc
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
841 annotate-char annotate-field
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
842 config)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
843 ;; 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
844 ;; 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
845 ;; nil if none exists.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
846 ;; 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
847 ;; SEND-ARGS is an optional argument passed to the send command.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
848 ;; The TO, SUBJECT, and CC fields are passed to the
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
849 ;; mh-compose-letter-function.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
850 ;; 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
851 ;; 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
852 ;; for mh-annotate-msg.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
853 ;; CONFIG is the window configuration to restore after sending the letter.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
854 (pop-to-buffer draft)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
855 (mh-letter-mode)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
856 (setq mh-sent-from-folder sent-from-folder)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
857 (setq mh-sent-from-msg sent-from-msg)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
858 (setq mh-send-args send-args)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
859 (setq mh-annotate-char annotate-char)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
860 (setq mh-annotate-field annotate-field)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
861 (setq mh-previous-window-config config)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
862 (setq mode-line-buffer-identification (list "{%b}"))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
863 (if (and (boundp 'mh-compose-letter-function)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
864 mh-compose-letter-function)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
865 ;; run-hooks will not pass arguments.
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
866 (let ((value mh-compose-letter-function))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
867 (if (and (listp value) (not (eq (car value) 'lambda)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
868 (while value
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
869 (funcall (car value) to subject cc)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
870 (setq value (cdr value)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
871 (funcall mh-compose-letter-function to subject cc)))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
872
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
873
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
874 (defun mh-send-letter (&optional arg)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
875 "Send the draft letter in the current buffer.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
876 If optional prefix argument is provided, monitor delivery.
19936
78aa8484e6e9 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 17593
diff changeset
877 Run `mh-before-send-letter-hook' before actually doing anything."
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
878 (interactive "P")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
879 (run-hooks 'mh-before-send-letter-hook)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
880 (save-buffer)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
881 (message "Sending...")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
882 (let ((draft-buffer (current-buffer))
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
883 (file-name buffer-file-name)
19936
78aa8484e6e9 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 17593
diff changeset
884 (config mh-previous-window-config)
78aa8484e6e9 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 17593
diff changeset
885 (coding-system-for-write
19952
3e0041620fc2 Fix previous change.
Richard M. Stallman <rms@gnu.org>
parents: 19936
diff changeset
886 (if (and (local-variable-p 'buffer-file-coding-system)
3e0041620fc2 Fix previous change.
Richard M. Stallman <rms@gnu.org>
parents: 19936
diff changeset
887 ;; We're not sure why, but buffer-file-coding-system
3e0041620fc2 Fix previous change.
Richard M. Stallman <rms@gnu.org>
parents: 19936
diff changeset
888 ;; tends to get set to undecided-unix.
3e0041620fc2 Fix previous change.
Richard M. Stallman <rms@gnu.org>
parents: 19936
diff changeset
889 (not (memq buffer-file-coding-system
3e0041620fc2 Fix previous change.
Richard M. Stallman <rms@gnu.org>
parents: 19936
diff changeset
890 '(undecided undecided-unix undecided-dos))))
19936
78aa8484e6e9 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 17593
diff changeset
891 buffer-file-coding-system
78aa8484e6e9 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 17593
diff changeset
892 (or sendmail-coding-system
78aa8484e6e9 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 17593
diff changeset
893 default-buffer-file-coding-system
78aa8484e6e9 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 17593
diff changeset
894 'iso-latin-1))))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
895 (cond (arg
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
896 (pop-to-buffer "MH mail delivery")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
897 (erase-buffer)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
898 (mh-exec-cmd-output mh-send-prog t "-watch" "-nopush"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
899 "-nodraftfolder" mh-send-args file-name)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
900 (goto-char (point-max)) ; show the interesting part
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
901 (recenter -1)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
902 (set-buffer draft-buffer)) ; for annotation below
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
903 (t
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
904 (mh-exec-cmd-daemon mh-send-prog "-nodraftfolder" "-noverbose"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
905 mh-send-args file-name)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
906 (if mh-annotate-char
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
907 (mh-annotate-msg mh-sent-from-msg
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
908 mh-sent-from-folder
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
909 mh-annotate-char
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
910 "-component" mh-annotate-field
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
911 "-text" (format "\"%s %s\""
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
912 (mh-get-header-field "To:")
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
913 (mh-get-header-field "Cc:"))))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
914
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
915 (cond ((or (not arg)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
916 (y-or-n-p "Kill draft buffer? "))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
917 (kill-buffer draft-buffer)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
918 (if config
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
919 (set-window-configuration config))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
920 (if arg
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
921 (message "Sending...done")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
922 (message "Sending...backgrounded"))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
923
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
924
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
925 (defun mh-insert-letter (folder message verbatim)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
926 "Insert a message into the current letter.
19936
78aa8484e6e9 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 17593
diff changeset
927 Removes the message's headers using `mh-invisible-headers'. Prefixes
78aa8484e6e9 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 17593
diff changeset
928 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
929 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
930 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
931 (interactive
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
932 (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
933 (read-input (format "Message number%s: "
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
934 (if mh-sent-from-msg
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
935 (format " [%d]" mh-sent-from-msg)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
936 "")))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
937 current-prefix-arg))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
938 (save-restriction
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
939 (narrow-to-region (point) (point))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
940 (let ((start (point-min)))
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
941 (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
942 (mh-exec-lib-cmd-output "mhl" "-nobell" "-noclear"
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
943 (expand-file-name message
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
944 (mh-expand-file-name folder)))
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
945 (cond ((not verbatim)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
946 (mh-clean-msg-header start mh-invisible-headers mh-visible-headers)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
947 (set-mark start) ; since mh-clean-msg-header moves it
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
948 (mh-insert-prefix-string mh-ins-buf-prefix))))))
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-yank-cur-msg ()
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
952 "Insert the current message into the draft buffer.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
953 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
954 `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
955 only the region will be inserted. Otherwise, the entire message will
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
956 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
957 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
958 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
959 yanked message will be deleted."
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
960 (interactive)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
961 (if (and mh-sent-from-folder mh-sent-from-msg)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
962 (let ((to-point (point))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
963 (to-buffer (current-buffer)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
964 (set-buffer mh-sent-from-folder)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
965 (if mh-delete-yanked-msg-window
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
966 (delete-windows-on mh-show-buffer))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
967 (set-buffer mh-show-buffer) ; Find displayed message
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
968 (let ((mh-ins-str (cond ((if (boundp 'mark-active)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
969 mark-active ;Emacs 19
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
970 (mark)) ;Emacs 18
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
971 (buffer-substring (region-beginning)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
972 (region-end)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
973 ((eq 'body mh-yank-from-start-of-msg)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
974 (buffer-substring
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
975 (save-excursion
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
976 (goto-char (point-min))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
977 (mh-goto-header-end 1)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
978 (point))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
979 (point-max)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
980 (mh-yank-from-start-of-msg
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
981 (buffer-substring (point-min) (point-max)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
982 (t
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
983 (buffer-substring (point) (point-max))))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
984 (set-buffer to-buffer)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
985 (save-restriction
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
986 (narrow-to-region to-point to-point)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
987 (push-mark)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
988 (insert mh-ins-str)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
989 (mh-insert-prefix-string mh-ins-buf-prefix)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
990 (insert "\n"))))
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
991 (error "There is no current message")))
6365
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 (defun mh-insert-prefix-string (mh-ins-string)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
995 ;; 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
996 ;; in the buffer. Generality for supercite users.
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
997 (set-mark (point-max))
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
998 (goto-char (point-min))
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
999 (cond (mail-citation-hook
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1000 (run-hooks 'mail-citation-hook))
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1001 (mh-yank-hooks ;old hook name
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1002 (run-hooks 'mh-yank-hooks))
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1003 (t
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1004 (or (bolp) (forward-line 1))
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1005 (let ((zmacs-regions nil)) ;so "(mark)" works in XEmacs
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1006 (while (< (point) (mark))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1007 (insert mh-ins-string)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1008 (forward-line 1))))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1009
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1010
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1011 (defun mh-fully-kill-draft ()
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1012 "Kill the draft message file and the draft message buffer.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1013 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
1014 (interactive)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1015 (if (y-or-n-p "Kill draft message? ")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1016 (let ((config mh-previous-window-config))
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1017 (if (file-exists-p buffer-file-name)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1018 (delete-file buffer-file-name))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1019 (set-buffer-modified-p nil)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1020 (kill-buffer (buffer-name))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1021 (message "")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1022 (if config
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1023 (set-window-configuration config)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1024 (error "Message not killed")))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1025
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1026
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1027 ;;; Build the letter-mode keymap:
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1028
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1029 (define-key mh-letter-mode-map "\C-c\C-f\C-b" 'mh-to-field)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1030 (define-key mh-letter-mode-map "\C-c\C-f\C-c" 'mh-to-field)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1031 (define-key mh-letter-mode-map "\C-c\C-f\C-d" 'mh-to-field)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1032 (define-key mh-letter-mode-map "\C-c\C-f\C-f" 'mh-to-fcc)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1033 (define-key mh-letter-mode-map "\C-c\C-f\C-r" 'mh-to-field)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1034 (define-key mh-letter-mode-map "\C-c\C-f\C-s" 'mh-to-field)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1035 (define-key mh-letter-mode-map "\C-c\C-f\C-t" 'mh-to-field)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1036 (define-key mh-letter-mode-map "\C-c\C-fb" 'mh-to-field)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1037 (define-key mh-letter-mode-map "\C-c\C-fc" 'mh-to-field)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1038 (define-key mh-letter-mode-map "\C-c\C-fd" 'mh-to-field)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1039 (define-key mh-letter-mode-map "\C-c\C-ff" 'mh-to-fcc)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1040 (define-key mh-letter-mode-map "\C-c\C-fr" 'mh-to-field)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1041 (define-key mh-letter-mode-map "\C-c\C-fs" 'mh-to-field)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1042 (define-key mh-letter-mode-map "\C-c\C-ft" 'mh-to-field)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1043 (define-key mh-letter-mode-map "\C-c\C-i" 'mh-insert-letter)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1044 (define-key mh-letter-mode-map "\C-c\C-q" 'mh-fully-kill-draft)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1045 (define-key mh-letter-mode-map "\C-c\C-\\" 'mh-fully-kill-draft) ;if no C-q
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1046 (define-key mh-letter-mode-map "\C-c\C-s" 'mh-insert-signature)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1047 (define-key mh-letter-mode-map "\C-c\C-^" 'mh-insert-signature) ;if no C-s
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1048 (define-key mh-letter-mode-map "\C-c\C-w" 'mh-check-whom)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1049 (define-key mh-letter-mode-map "\C-c\C-y" 'mh-yank-cur-msg)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1050 (define-key mh-letter-mode-map "\C-c\C-c" 'mh-send-letter)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1051 (define-key mh-letter-mode-map "\C-c\C-m\C-f" 'mh-mhn-compose-forw)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1052 (define-key mh-letter-mode-map "\C-c\C-m\C-e" 'mh-mhn-compose-anon-ftp)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1053 (define-key mh-letter-mode-map "\C-c\C-m\C-t" 'mh-mhn-compose-external-compressed-tar)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1054 (define-key mh-letter-mode-map "\C-c\C-m\C-i" 'mh-mhn-compose-insertion)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1055 (define-key mh-letter-mode-map "\C-c\C-e" 'mh-edit-mhn)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1056 (define-key mh-letter-mode-map "\C-c\C-m\C-u" 'mh-revert-mhn-edit)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1057
13385
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
1058 ;; "C-c /" prefix is used in mh-letter-mode by pgp.el
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1059
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1060 ;;; autoloads from mh-mime
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1061
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1062 (autoload 'mh-mhn-compose-insertion "mh-mime"
11507
595e689b719b Update some MIME doc strings.
Karl Heuer <kwzh@gnu.org>
parents: 11333
diff changeset
1063 "Add a directive to insert a MIME message part from a file.
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1064 This is the typical way to insert non-text parts in a message.
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1065 See also \\[mh-edit-mhn]." t)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1066
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1067 (autoload 'mh-mhn-compose-anon-ftp "mh-mime"
11507
595e689b719b Update some MIME doc strings.
Karl Heuer <kwzh@gnu.org>
parents: 11333
diff changeset
1068 "Add a directive for a MIME anonymous ftp external body part.
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1069 This directive tells MH to include a reference to a
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1070 message/external-body part retrievable by anonymous FTP.
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1071 See also \\[mh-edit-mhn]." t)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1072
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1073 (autoload 'mh-mhn-compose-external-compressed-tar "mh-mime"
11507
595e689b719b Update some MIME doc strings.
Karl Heuer <kwzh@gnu.org>
parents: 11333
diff changeset
1074 "Add a directive to include a MIME reference to a compressed tar file.
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1075 The file should be available via anonymous ftp. This directive
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1076 tells MH to include a reference to a message/external-body part.
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1077 See also \\[mh-edit-mhn]." t)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1078
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1079 (autoload 'mh-mhn-compose-forw "mh-mime"
11507
595e689b719b Update some MIME doc strings.
Karl Heuer <kwzh@gnu.org>
parents: 11333
diff changeset
1080 "Add a forw directive to this message, to forward a message with MIME.
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1081 This directive tells MH to include another message in this one.
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1082 See also \\[mh-edit-mhn]." t)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1083
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1084 (autoload 'mh-edit-mhn "mh-mime"
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1085 "Format the current draft for MIME, expanding any mhn directives.
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1086 Process the current draft with the mhn program, which,
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1087 using directives already inserted in the draft, fills in
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1088 all the MIME components and header fields.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1089 This step should be done last just before sending the message.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1090 The mhn program is part of MH version 6.8 or later.
19936
78aa8484e6e9 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 17593
diff changeset
1091 The \\[mh-revert-mhn-edit] command undoes this command.
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1092 For assistance with creating mhn directives to insert
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1093 various types of components in a message, see
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1094 \\[mh-mhn-compose-insertion] (generic insertion from a file),
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1095 \\[mh-mhn-compose-anon-ftp] (external reference to file via anonymous ftp),
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1096 \\[mh-mhn-compose-external-compressed-tar] \
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1097 \(reference to compressed tar file via anonymous ftp), and
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1098 \\[mh-mhn-compose-forw] (forward message)." t)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1099
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1100 (autoload 'mh-revert-mhn-edit "mh-mime"
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1101 "Undoes the effect of \\[mh-edit-mhn] by reverting to the backup file.
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1102 Optional non-nil argument means don't ask for confirmation." t)