annotate lisp/mail/mh-comp.el @ 48986:5f0ef23b7e51

(dired-goto-file): Handle \ and ^M quoted by backslash. Fix error message.
author Richard M. Stallman <rms@gnu.org>
date Sat, 28 Dec 2002 21:26:46 +0000
parents 8aaba207e44b
children 30c4902b654d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1 ;;; mh-comp.el --- MH-E functions for composing messages
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
3 ;; Copyright (C) 1993,1995,1997,2000,2001,2002 Free Software Foundation, Inc.
30887
c4366892a814 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 29420
diff changeset
4
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
5 ;; Author: Bill Wohler <wohler@newt.com>
33145
e2d1dc22d119 Change maintainer.
Gerd Moellmann <gerd@gnu.org>
parents: 30887
diff changeset
6 ;; Maintainer: Bill Wohler <wohler@newt.com>
30887
c4366892a814 *** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 29420
diff changeset
7 ;; Keywords: mail
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
8 ;; See: mh-e.el
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
9
38414
67b464da13ec Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 35975
diff changeset
10 ;; This file is part of GNU Emacs.
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
11
11333
53174cfc29fa Comment fixes.
Karl Heuer <kwzh@gnu.org>
parents: 11332
diff changeset
12 ;; GNU Emacs is free software; you can redistribute it and/or modify
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
13 ;; it under the terms of the GNU General Public License as published by
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
14 ;; the Free Software Foundation; either version 2, or (at your option)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
15 ;; any later version.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
16
11333
53174cfc29fa Comment fixes.
Karl Heuer <kwzh@gnu.org>
parents: 11332
diff changeset
17 ;; GNU Emacs is distributed in the hope that it will be useful,
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
20 ;; GNU General Public License for more details.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
21
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
22 ;; You should have received a copy of the GNU General Public License
14169
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13385
diff changeset
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13385
diff changeset
24 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13385
diff changeset
25 ;; Boston, MA 02111-1307, USA.
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
26
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
27 ;;; Commentary:
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
28
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
29 ;; Internal support for MH-E package.
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
30
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
31 ;;; Change Log:
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
32
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
33 ;; $Id: mh-comp.el,v 1.145 2002/11/29 16:49:43 wohler Exp $
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
34
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
35 ;;; Code:
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
36
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
37 (require 'mh-e)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
38 (require 'mh-utils)
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
39 (require 'gnus-util)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
40 (require 'easymenu)
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
41 (require 'cl)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
42
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
43 ;; Shush the byte-compiler
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
44 (defvar adaptive-fill-first-line-regexp)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
45 (defvar font-lock-defaults)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
46 (defvar mark-active)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
47 (defvar sendmail-coding-system)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
48 (defvar tool-bar-mode)
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
49
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
50 ;;; autoloads from mh-mime
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
51 (autoload 'mh-press-button "mh-mime")
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
52
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
53 ;;; autoloads for mh-seq
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
54 (autoload 'mh-notate-seq "mh-seq")
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
55
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
56 (autoload 'mh-compose-insertion "mh-mime"
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
57 "Add a MIME directive to insert a file, using mhn or gnus.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
58 If the variable mh-compose-insertion is set to 'mhn, then that will be used.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
59 If it is set to 'gnus, then that will be used instead.")
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
60
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
61 (autoload 'mh-compose-forward "mh-mime"
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
62 "Add a MIME directive to forward a message, using mhn or gnus.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
63 If the variable mh-compose-insertion is set to 'mhn, then that will be used.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
64 If it is set to 'gnus, then that will be used instead.")
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
65
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
66 (autoload 'mh-mhn-compose-insertion "mh-mime"
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
67 "Add a directive to insert a MIME message part from a file.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
68 This is the typical way to insert non-text parts in a message.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
69 See also \\[mh-edit-mhn]." t)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
70
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
71 (autoload 'mh-mhn-compose-anon-ftp "mh-mime"
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
72 "Add a directive for a MIME anonymous ftp external body part.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
73 This directive tells MH to include a reference to a
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
74 message/external-body part retrievable by anonymous FTP.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
75 See also \\[mh-edit-mhn]." t)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
76
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
77 (autoload 'mh-mhn-compose-external-compressed-tar "mh-mime"
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
78 "Add a directive to include a MIME reference to a compressed tar file.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
79 The file should be available via anonymous ftp. This directive
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
80 tells MH to include a reference to a message/external-body part.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
81 See also \\[mh-edit-mhn]." t)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
82
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
83 (autoload 'mh-mhn-compose-forw "mh-mime"
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
84 "Add a forw directive to this message, to forward a message with MIME.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
85 This directive tells MH to include another message in this one.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
86 See also \\[mh-edit-mhn]." t)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
87
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
88 (autoload 'mh-edit-mhn "mh-mime"
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
89 "Format the current draft for MIME, expanding any mhn directives.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
90 Process the current draft with the mhn program, which,
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
91 using directives already inserted in the draft, fills in
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
92 all the MIME components and header fields.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
93 This step should be done last just before sending the message.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
94 The mhn program is part of MH version 6.8 or later.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
95 The \\[mh-revert-mhn-edit] command undoes this command.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
96 For assistance with creating mhn directives to insert
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
97 various types of components in a message, see
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
98 \\[mh-mhn-compose-insertion] (generic insertion from a file),
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
99 \\[mh-mhn-compose-anon-ftp] (external reference to file via anonymous ftp),
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
100 \\[mh-mhn-compose-external-compressed-tar] \
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
101 \(reference to compressed tar file via anonymous ftp), and
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
102 \\[mh-mhn-compose-forw] (forward message)." t)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
103
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
104 (autoload 'mh-revert-mhn-edit "mh-mime"
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
105 "Undoes the effect of \\[mh-edit-mhn] by reverting to the backup file.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
106 Optional non-nil argument means don't ask for confirmation." t)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
107
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
108 (autoload 'mh-mml-to-mime "mh-mime"
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
109 "Compose MIME message from mml directives.")
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
110
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
111 (autoload 'mh-mml-forward-message "mh-mime"
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
112 "Forward a message as attachment.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
113 The function will prompt the user for a description, a folder and message
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
114 number.")
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
115
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
116 (autoload 'mh-mml-attach-file "mh-mime"
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
117 "Attach a file to the outgoing MIME message.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
118 The file is not inserted or encoded until you send the message with
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
119 `\\[message-send-and-exit]' or `\\[message-send]'.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
120
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
121 Message dispostion is \"inline\" is INLINE is non-nil, else the default is
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
122 \"attachment\".
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
123 FILE is the name of the file to attach. TYPE is its content-type, a
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
124 string of the form \"type/subtype\". DESCRIPTION is a one-line
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
125 description of the attachment.")
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
126
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
127 (autoload 'mh-mml-secure-message-sign-pgpmime "mh-mime"
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
128 "Add MML tag to encrypt/sign the entire message.")
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
129
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
130 (autoload 'mh-mml-secure-message-encrypt-pgpmime "mh-mime"
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
131 "Add MML tag to encrypt and sign the entire message.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
132 If called with a prefix argument, only encrypt (do NOT sign).")
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
133
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
134 ;;; Other Autoloads.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
135
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
136 (autoload 'Info-goto-node "info")
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
137 (autoload 'mail-mode-fill-paragraph "sendmail")
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
138 (autoload 'mm-handle-displayed-p "mm-decode")
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
139
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
140 (autoload 'sc-cite-original "sc"
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
141 "Workhorse citing function which performs the initial citation.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
142 This is callable from the various mail and news readers' reply
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
143 function according to the agreed upon standard. See `\\[sc-describe]'
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
144 for more details. `sc-cite-original' does not do any yanking of the
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
145 original message but it does require a few things:
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
146
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
147 1) The reply buffer is the current buffer.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
148
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
149 2) The original message has been yanked and inserted into the
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
150 reply buffer.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
151
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
152 3) Verbose mail headers from the original message have been
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
153 inserted into the reply buffer directly before the text of the
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
154 original message.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
155
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
156 4) Point is at the beginning of the verbose headers.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
157
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
158 5) Mark is at the end of the body of text to be cited.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
159
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
160 For Emacs 19's, the region need not be active (and typically isn't
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
161 when this function is called. Also, the hook `sc-pre-hook' is run
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
162 before, and `sc-post-hook' is run after the guts of this function.")
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
163
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
164 ;;; Site customization (see also mh-utils.el):
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
165
17426
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
166 (defgroup mh-compose nil
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
167 "MH-E functions for composing messages."
17426
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
168 :prefix "mh-"
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
169 :group 'mh)
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
170
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
171 (defvar mh-send-prog "send"
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
172 "Name of the MH send program.
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
173 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
174
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
175 (defvar mh-redist-full-contents nil
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
176 "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
177 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
178 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
179
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
180 (defvar mh-redist-background nil
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
181 "If non-nil redist will be done in background like send.
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
182 This allows transaction log to be visible if -watch, -verbose or -snoop are
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
183 used.")
11332
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 (defvar mh-note-repl "-"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
186 "String whose first character is used to notate replied to messages.")
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-note-forw "F"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
189 "String whose first character is used to notate forwarded messages.")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
190
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
191 (defvar mh-note-dist "R"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
192 "String whose first character is used to notate redistributed messages.")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
193
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
194 (defvar mh-yank-hooks nil
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
195 "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
196 Each hook function can find the citation between point and mark.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
197 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
198 text as modified.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
199
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
200 This is a normal hook, misnamed for historical reasons.
19936
78aa8484e6e9 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 17593
diff changeset
201 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
202
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
203 (defvar mail-citation-hook nil
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
204 "*Hook for modifying a citation just inserted in the mail buffer.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
205 Each hook function can find the citation between point and mark.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
206 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
207 text as modified.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
208
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
209 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
210 with `mh-ins-buf-prefix' prefixed to each line.
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
211
19936
78aa8484e6e9 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 17593
diff changeset
212 See also the variable `mh-yank-from-start-of-msg', which controls how
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
213 much of the message passed to the hook.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
214
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
215 This hook was historically provided to set up supercite. You may now leave
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
216 this nil and set up supercite by setting the variable
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
217 `mh-yank-from-start-of-msg' to 'supercite or, for more automatic insertion,
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
218 to 'autosupercite.")
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
219
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
220 ;;; Personal preferences:
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
221
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
222 (defcustom mh-compose-insertion (if (locate-library "mml") 'gnus 'mhn)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
223 "Use either 'gnus or 'mhn to insert MIME message directives in messages."
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
224 :type '(choice (const :tag "Use gnus" gnus)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
225 (const :tag "Use mhn" mhn))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
226 :group 'mh-compose)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
227
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
228 (defcustom mh-x-face-file "~/.face"
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
229 "*File name containing the encoded X-Face string to insert in outgoing mail.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
230 If nil, or the file does not exist, nothing is added to message headers."
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
231 :type 'file
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
232 :group 'mh-compose)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
233
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
234 (defcustom mh-insert-x-mailer-flag t
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
235 "*Non-nil means append an X-Mailer field to the header."
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
236 :type 'boolean
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
237 :group 'mh-compose)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
238
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
239 (defvar mh-x-mailer-string nil
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
240 "*String containing the contents of the X-Mailer header field.
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
241 If nil, this variable is initialized to show the version of MH-E, Emacs, and
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
242 MH the first time a message is composed.")
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
243
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
244 (defcustom mh-insert-mail-followup-to-flag t
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
245 "Non-nil means maybe append a Mail-Followup-To field to the header.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
246 The insertion is done if the To: or Cc: fields matches an entry in
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
247 `mh-insert-mail-followup-to-list'."
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
248 :type 'boolean
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
249 :group 'mh-compose)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
250
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
251 (defcustom mh-insert-mail-followup-to-list nil
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
252 "Alist of addresses for which a Mail-Followup-To field is inserted.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
253 Each element has the form (REGEXP ADDRESS).
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
254 When the REGEXP appears in the To or cc fields of a message, the corresponding
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
255 ADDRESS is inserted in a Mail-Followup-To field.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
256
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
257 Here's a customization example:
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
258
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
259 regexp: mh-e-users@lists.s\\\\(ourceforge\\\\|f\\\\).net
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
260 address: mh-e-users@lists.sourceforge.net
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
261
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
262 This corresponds to:
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
263
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
264 (setq mh-insert-mail-followup-to-list
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
265 '((\"mh-e-users@lists.s\\\\(ourceforge\\\\|f\\\\).net\"
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
266 \"mh-e-users@lists.sourceforge.net\")))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
267
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
268 While it might be tempting to add a descriptive name to the mailing list
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
269 address, consider that this field will appear in other people's outgoing
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
270 mail in their To: field. It might be best to keep it simple."
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
271 :type '(repeat (list (string :tag "regexp") (string :tag "address")))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
272 :group 'mh-compose)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
273
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
274 (defcustom mh-delete-yanked-msg-window-flag nil
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
275 "*Non-nil means delete any window displaying the message.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
276 Controls window display when a message is yanked by \\<mh-letter-mode-map>\\[mh-yank-cur-msg].
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
277 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
278 windows displaying the message."
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
279 :type 'boolean
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
280 :group 'mh-compose)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
281
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
282 (defcustom mh-yank-from-start-of-msg 'attribution
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
283 "*Controls which part of a message is yanked by \\<mh-letter-mode-map>\\[mh-yank-cur-msg].
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
284 If t, include the entire message, with full headers. This is historically
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
285 here for use with supercite, but is now deprecated in favor of the setting
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
286 `supercite' below.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
287
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
288 If the symbol `body', then yank the message minus the header.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
289
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
290 If the symbol `supercite', include the entire message, with full headers.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
291 This also causes the invocation of `sc-cite-original' without the setting
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
292 of `mail-citation-hook', now deprecated practice.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
293
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
294 If the symbol `autosupercite', do as for `supercite' automatically when
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
295 show buffer matches the message being replied-to. When this option is used,
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
296 the -noformat switch is passed to the repl program to override a -filter or
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
297 -format switch.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
298
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
299 If the symbol `attribution', then yank the message minus the header and add
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
300 a simple attribution line at the top.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
301
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
302 If the symbol `autoattrib', do as for `attribution' automatically when show
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
303 buffer matches the message being replied-to. You can make sure this is
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
304 always the case by setting `mh-reply-show-message-flag' to t (which is the
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
305 default) and optionally `mh-delete-yanked-msg-window-flag' to t as well such
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
306 that the show window is never displayed. When the `autoattrib' option is
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
307 used, the -noformat switch is passed to the repl program to override a
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
308 -filter or -format switch.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
309
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
310 If nil, yank only the portion of the message following the point.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
311
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
312 If the show buffer has a region, this variable is ignored unless its value is
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
313 one of `attribution' or `autoattrib' in which case the attribution is added
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
314 to the yanked region."
22590
fd24f556ad8f (mh-yank-from-start-of-msg): Use `other' widget
Andreas Schwab <schwab@suse.de>
parents: 19952
diff changeset
315 :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
316 (const :tag "Without header" body)
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
317 (const :tag "Invoke supercite" supercite)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
318 (const :tag "Invoke supercite, automatically" autosupercite)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
319 (const :tag "Without header, with attribution" attribution)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
320 (const :tag "Without header, with attribution, automatically"
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
321 autoattrib)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
322 (const :tag "Entire message with headers" t))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
323 :group 'mh-compose)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
324
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
325 (defcustom mh-extract-from-attribution-verb "wrote:"
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
326 "*Verb to use for attribution when a message is yanked by \\<mh-letter-mode-map>\\[mh-yank-cur-msg]."
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
327 :type '(choice (const "wrote:")
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
328 (const "a écrit :")
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
329 (string :tag "Custom string"))
17426
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
330 :group 'mh-compose)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
331
17426
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
332 (defcustom mh-ins-buf-prefix "> "
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
333 "*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
334 \\<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
335 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
336 :type 'string
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
337 :group 'mh-compose)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
338
17426
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
339 (defcustom mh-reply-default-reply-to nil
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
340 "*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
341 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
342 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
343 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
344 :type '(choice (const :tag "Prompt" nil)
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
345 (const "from") (const "to")
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
346 (const "cc") (const "all"))
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
347 :group 'mh-compose)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
348
17426
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
349 (defcustom mh-signature-file-name "~/.signature"
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
350 "*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
351 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
352 :type 'file
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
353 :group 'mh-compose)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
354
17426
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
355 (defcustom mh-forward-subject-format "%s: %s"
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
356 "*Format to generate the Subject: line contents for a forwarded message.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
357 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
358 message and the original subject line."
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
359 :type 'string
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
360 :group 'mh-compose)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
361
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
362 (defvar mh-comp-formfile "components"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
363 "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
364 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
365 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
366 system MH lib directory.")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
367
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
368 (defvar mh-repl-formfile "replcomps"
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
369 "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
370 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
371 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
372 system MH lib directory.")
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
373
24421
d072093cd922 (mh-repl-formfile): New var.
Karl Heuer <kwzh@gnu.org>
parents: 22590
diff changeset
374 (defvar mh-repl-group-formfile "replgroupcomps"
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
375 "Name of file to be used as a skeleton for replying to messages.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
376 This file is used to form replies to the sender and all recipients of a
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
377 message. Only used if `mh-nmh-flag' is non-nil. Default is \"replgroupcomps\".
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
378 If not an absolute file name, the file is searched for first in the user's MH
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
379 directory, then in the system MH lib directory.")
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
380
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
381 (defcustom mh-reply-show-message-flag t
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
382 "*Non-nil means the show buffer is displayed using \\<mh-letter-mode-map>\\[mh-reply].
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
383
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
384 The setting of this variable determines whether the MH `show-buffer' is
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
385 displayed with the current message when using `mh-reply' without a prefix
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
386 argument. Set it to nil if you already include the message automatically
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
387 in your draft using
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
388 repl: -filter repl.filter
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
389 in your ~/.mh_profile file."
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
390 :type 'boolean
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
391 :group 'mh-compose)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
392
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
393 (defcustom mh-letter-fill-column 72
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
394 "*Fill column to use in `mh-letter-mode'.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
395 This is usually less than in other text modes because email messages get
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
396 quoted by some prefix (sometimes many times) when they are replied to,
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
397 and it's best to avoid quoted lines that span more than 80 columns."
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
398 :type 'integer
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
399 :group 'mh-compose)
24421
d072093cd922 (mh-repl-formfile): New var.
Karl Heuer <kwzh@gnu.org>
parents: 22590
diff changeset
400
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
401 ;;; Hooks:
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
402
17426
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
403 (defcustom mh-letter-mode-hook nil
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
404 "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
405 :type 'hook
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
406 :group 'mh-compose)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
407
17426
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
408 (defcustom mh-compose-letter-function nil
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
409 "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
410 It is passed three arguments: TO recipients, SUBJECT, and CC recipients."
35975
a6d7df85ca41 (mh-compose-letter-function): Fix :type.
Dave Love <fx@gnu.org>
parents: 33145
diff changeset
411 :type '(choice (const nil) function)
17426
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
412 :group 'mh-compose)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
413
17426
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
414 (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
415 "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
416 :type 'hook
5c5fa38a1c79 Add defgroup; use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
417 :group 'mh-compose)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
418
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
419 (defcustom mh-letter-insert-signature-hook nil
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
420 "Invoked at the beginning of the \\<mh-letter-mode-map>\\[mh-insert-signature] command.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
421 Can be used to determine which signature file to use based on message content.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
422 On return, if `mh-signature-file-name' is non-nil that file will be inserted at
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
423 the current point in the buffer."
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
424 :type 'hook
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
425 :group 'mh-compose)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
426
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
427 (defvar mh-rejected-letter-start
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
428 (format "^%s$"
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
429 (regexp-opt
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
430 '("Content-Type: message/rfc822" ;MIME MDN
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
431 " ----- Unsent message follows -----" ;from sendmail V5
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
432 " --------Unsent Message below:" ; from sendmail at BU
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
433 " ----- Original message follows -----" ;from sendmail V8
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
434 "------- Unsent Draft" ;from MH itself
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
435 "---------- Original Message ----------" ;from zmailer
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
436 " --- The unsent message follows ---" ;from AIX mail system
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
437 " Your message follows:" ;from MMDF-II
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
438 "Content-Description: Returned Content" ;1993 KJ sendmail
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
439 ))))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
440
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
441 (defvar mh-new-draft-cleaned-headers
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
442 "^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
443 "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
444 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
445
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
446 (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
447 ("b" . "Bcc:") ("f" . "Fcc:") ("r" . "From:")
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
448 ("d" . "Dcc:"))
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
449 "Alist of (final-character . field-name) choices for `mh-to-field'.")
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
450
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
451 (defvar mh-letter-mode-map (copy-keymap text-mode-map)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
452 "Keymap for composing mail.")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
453
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
454 (defvar mh-letter-mode-syntax-table nil
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
455 "Syntax table used by MH-E while in MH-Letter mode.")
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
456
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
457 (if mh-letter-mode-syntax-table
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
458 ()
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
459 (setq mh-letter-mode-syntax-table
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
460 (make-syntax-table text-mode-syntax-table))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
461 (modify-syntax-entry ?% "." mh-letter-mode-syntax-table))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
462
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
463 (defvar mh-sent-from-folder nil
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
464 "Folder of msg assoc with this letter.")
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
465
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
466 (defvar mh-sent-from-msg nil
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
467 "Number of msg assoc with this letter.")
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
468
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
469 (defvar mh-send-args nil
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
470 "Extra args to pass to \"send\" command.")
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
471
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
472 (defvar mh-annotate-char nil
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
473 "Character to use to annotate `mh-sent-from-msg'.")
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
474
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
475 (defvar mh-annotate-field nil
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
476 "Field name for message annotation.")
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
477
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
478 ;;;###autoload
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
479 (defun mh-smail ()
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
480 "Compose and send mail with the MH mail system.
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
481 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
482 to the MH mail system.
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
483
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
484 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
485 (interactive)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
486 (mh-find-path)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
487 (call-interactively 'mh-send))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
488
13385
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
489 (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
490
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
491 ;;;###autoload
24421
d072093cd922 (mh-repl-formfile): New var.
Karl Heuer <kwzh@gnu.org>
parents: 22590
diff changeset
492 (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
493 "Set up a mail composition draft with the MH mail system.
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
494 This function is an entry point to MH-E, the Emacs front end
13385
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
495 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
496 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
497 that want to create a mail buffer.
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
498 Users should use `\\[mh-smail]' to compose mail.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
499 Optional arguments for setting certain fields include TO, SUBJECT, and
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
500 OTHER-HEADERS. Additional arguments are IGNORED."
13385
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
501 (mh-find-path)
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
502 (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
503 (mh-send (or to "") "" (or subject ""))))
13385
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
504
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
505 ;; XEmacs needs this:
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
506 ;;;###autoload
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
507 (defun mh-user-agent-compose (&optional to subject other-headers continue
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
508 switch-function yank-action
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
509 send-actions)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
510 "Set up mail composition draft with the MH mail system.
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
511 This is `mail-user-agent' entry point to MH-E.
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
512
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
513 The optional arguments TO and SUBJECT specify recipients and the
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
514 initial Subject field, respectively.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
515
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
516 OTHER-HEADERS is an alist specifying additional
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
517 header fields. Elements look like (HEADER . VALUE) where both
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
518 HEADER and VALUE are strings.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
519
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
520 CONTINUE, SWITCH-FUNCTION, YANK-ACTION and SEND-ACTIONS are ignored."
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
521 (mh-find-path)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
522 (let ((mh-error-if-no-draft t))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
523 (mh-send to "" subject)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
524 (while other-headers
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
525 (mh-insert-fields (concat (car (car other-headers)) ":")
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
526 (cdr (car other-headers)))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
527 (setq other-headers (cdr other-headers)))))
13385
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
528
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
529 (defun mh-edit-again (msg)
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
530 "Clean up a draft or a message MSG previously sent and make it resendable.
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
531 Default is the current message.
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
532 The variable `mh-new-draft-cleaned-headers' specifies the headers to remove.
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
533 See also documentation for `\\[mh-send]' function."
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
534 (interactive (list (mh-get-msg-num t)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
535 (let* ((from-folder mh-current-folder)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
536 (config (current-window-configuration))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
537 (draft
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
538 (cond ((and mh-draft-folder (equal from-folder mh-draft-folder))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
539 (pop-to-buffer (find-file-noselect (mh-msg-filename msg)) t)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
540 (rename-buffer (format "draft-%d" msg))
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
541 ;; Make buffer writable...
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
542 (setq buffer-read-only nil)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
543 ;; If buffer was being used to display the message reinsert
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
544 ;; from file...
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
545 (when (eq major-mode 'mh-show-mode)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
546 (erase-buffer)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
547 (insert-file-contents buffer-file-name))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
548 (buffer-name))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
549 (t
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
550 (mh-read-draft "clean-up" (mh-msg-filename msg) nil)))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
551 (mh-clean-msg-header (point-min) mh-new-draft-cleaned-headers nil)
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
552 (mh-insert-header-separator)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
553 (goto-char (point-min))
13385
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
554 (save-buffer)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
555 (mh-compose-and-send-mail draft "" from-folder nil nil nil nil nil nil
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
556 config)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
557 (mh-letter-mode-message)))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
558
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
559 (defun mh-extract-rejected-mail (msg)
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
560 "Extract message MSG returned by the mail system and make it resendable.
19936
78aa8484e6e9 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 17593
diff changeset
561 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
562 gives the headers to clean out of the original message.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
563 See also documentation for `\\[mh-send]' function."
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
564 (interactive (list (mh-get-msg-num t)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
565 (let ((from-folder mh-current-folder)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
566 (config (current-window-configuration))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
567 (draft (mh-read-draft "extraction" (mh-msg-filename msg) nil)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
568 (goto-char (point-min))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
569 (cond ((re-search-forward mh-rejected-letter-start nil t)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
570 (skip-chars-forward " \t\n")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
571 (delete-region (point-min) (point))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
572 (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
573 (t
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
574 (message "Does not appear to be a rejected letter.")))
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
575 (mh-insert-header-separator)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
576 (goto-char (point-min))
13385
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
577 (save-buffer)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
578 (mh-compose-and-send-mail draft "" from-folder msg
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
579 (mh-get-header-field "To:")
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
580 (mh-get-header-field "From:")
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
581 (mh-get-header-field "Cc:")
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
582 nil nil config)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
583 (mh-letter-mode-message)))
6365
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 (defun mh-forward (to cc &optional msg-or-seq)
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
586 "Forward one or more messages to the recipients TO and CC.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
587
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
588 Use the optional MSG-OR-SEQ to specify a message or sequence to forward.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
589
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
590 Default is the displayed message. If optional prefix argument is given then
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
591 prompt for the message sequence. If variable `transient-mark-mode' is non-nil
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
592 and the mark is active, then the selected region is forwarded.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
593 See also documentation for `\\[mh-send]' function."
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
594 (interactive (list (mh-read-address "To: ")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
595 (mh-read-address "Cc: ")
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
596 (cond
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
597 ((mh-mark-active-p t)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
598 (mh-region-to-sequence (region-beginning) (region-end))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
599 'region)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
600 (current-prefix-arg
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
601 (mh-read-seq-default "Forward" t))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
602 (t
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
603 (mh-get-msg-num t)))))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
604 (let* ((folder mh-current-folder)
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
605 (msgs (if (numberp msg-or-seq)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
606 (list msg-or-seq)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
607 (mh-seq-to-msgs msg-or-seq)))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
608 (config (current-window-configuration))
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
609 (fwd-msg-file (mh-msg-filename (car msgs) folder))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
610 ;; 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
611 (draft-name (expand-file-name "draft" mh-user-path))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
612 (draft (cond ((or (not (file-exists-p draft-name))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
613 (y-or-n-p "The file 'draft' exists. Discard it? "))
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
614 (mh-exec-cmd "forw" "-build" (if mh-nmh-flag "-mime")
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
615 mh-current-folder msgs)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
616 (prog1
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
617 (mh-read-draft "" draft-name t)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
618 (mh-insert-fields "To:" to "Cc:" cc)
13385
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
619 (save-buffer)))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
620 (t
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
621 (mh-read-draft "" draft-name nil)))))
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
622 (let (orig-from
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
623 orig-subject)
25535
2fe0f62fa349 (mh-forward): Get new subject line from the original,
Richard M. Stallman <rms@gnu.org>
parents: 24421
diff changeset
624 (save-excursion
2fe0f62fa349 (mh-forward): Get new subject line from the original,
Richard M. Stallman <rms@gnu.org>
parents: 24421
diff changeset
625 (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
626 (erase-buffer)
2fe0f62fa349 (mh-forward): Get new subject line from the original,
Richard M. Stallman <rms@gnu.org>
parents: 24421
diff changeset
627 (insert-file-contents fwd-msg-file)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
628 (setq orig-from (mh-get-header-field "From:"))
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
629 (setq orig-subject (mh-get-header-field "Subject:")))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
630 (let ((forw-subject
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
631 (mh-forwarded-letter-subject orig-from orig-subject))
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
632 (mail-header-separator mh-mail-header-separator)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
633 (compose))
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
634 (mh-insert-fields "Subject:" forw-subject)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
635 (goto-char (point-min))
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
636 ;; If using MML, translate mhn
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
637 (if (equal mh-compose-insertion 'gnus)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
638 (save-excursion
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
639 (setq compose t)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
640 (re-search-forward (format "^\\(%s\\)?$" mail-header-separator))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
641 (while
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
642 (re-search-forward "^#forw \\[\\([^]]+\\)\\] \\(+\\S-+\\) \\(.*\\)$" (point-max) t)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
643 (let ((description (if (equal (match-string 1) "forwarded messages")
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
644 "forwarded message %d"
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
645 (match-string 1)))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
646 (msgs (split-string (match-string 3)))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
647 (i 0))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
648 (beginning-of-line)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
649 (delete-region (point)(progn (forward-line 1)(point)))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
650 (dolist (msg msgs)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
651 (setq i (1+ i))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
652 (mh-mml-forward-message (format description i) folder msg))))))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
653 ;; Postition just before forwarded message
25535
2fe0f62fa349 (mh-forward): Get new subject line from the original,
Richard M. Stallman <rms@gnu.org>
parents: 24421
diff changeset
654 (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
655 (forward-line -1)
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
656 (re-search-forward (format "^\\(%s\\)?$" mail-header-separator))
25535
2fe0f62fa349 (mh-forward): Get new subject line from the original,
Richard M. Stallman <rms@gnu.org>
parents: 24421
diff changeset
657 (forward-line 1))
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
658 (delete-other-windows)
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
659 (mh-add-msgs-to-seq msgs 'forwarded t)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
660 (mh-compose-and-send-mail draft "" folder msg-or-seq
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
661 to forw-subject cc
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
662 mh-note-forw "Forwarded:"
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
663 config)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
664 (if compose
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
665 (setq mh-mml-compose-insert-flag t))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
666 (mh-letter-mode-message)))))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
667
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
668 (defun mh-forwarded-letter-subject (from subject)
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
669 "Return a Subject suitable for a forwarded message.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
670 Original message has headers FROM and SUBJECT."
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
671 (let ((addr-start (string-match "<" from))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
672 (comment (string-match "(" from)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
673 (cond ((and addr-start (> addr-start 0))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
674 ;; Full Name <luser@host>
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
675 (setq from (substring from 0 (1- addr-start))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
676 (comment
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
677 ;; luser@host (Full Name)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
678 (setq from (substring from (1+ comment) (1- (length from)))))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
679 (format mh-forward-subject-format from subject))
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 ;;;###autoload
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
682 (defun mh-smail-other-window ()
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
683 "Compose and send mail in other window with the MH mail system.
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
684 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
685 to the MH mail system.
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
686
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
687 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
688 (interactive)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
689 (mh-find-path)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
690 (call-interactively 'mh-send-other-window))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
691
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
692 (defun mh-redistribute (to cc &optional msg)
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
693 "Redistribute displayed message to recipients TO and CC.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
694 Use optional argument MSG to redistribute another message.
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
695 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
696 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
697 (interactive (list (mh-read-address "Redist-To: ")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
698 (mh-read-address "Redist-Cc: ")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
699 (mh-get-msg-num t)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
700 (or msg
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
701 (setq msg (mh-get-msg-num t)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
702 (save-window-excursion
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
703 (let ((folder mh-current-folder)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
704 (draft (mh-read-draft "redistribution"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
705 (if mh-redist-full-contents
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
706 (mh-msg-filename msg)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
707 nil)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
708 nil)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
709 (mh-goto-header-end 0)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
710 (insert "Resent-To: " to "\n")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
711 (if (not (equal cc "")) (insert "Resent-cc: " cc "\n"))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
712 (mh-clean-msg-header (point-min)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
713 "^Message-Id:\\|^Received:\\|^Return-Path:\\|^Sender:\\|^Date:\\|^From:"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
714 nil)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
715 (save-buffer)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
716 (message "Redistributing...")
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
717 (if (not mh-redist-background)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
718 (if mh-redist-full-contents
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
719 (call-process "/bin/sh" nil 0 nil "-c"
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
720 (format "mhdist=1 mhaltmsg=%s %s -push %s"
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
721 buffer-file-name
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
722 (expand-file-name mh-send-prog mh-progs)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
723 buffer-file-name))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
724 (call-process "/bin/sh" nil 0 nil "-c"
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
725 (format "mhdist=1 mhaltmsg=%s mhannotate=1 %s -push %s"
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
726 (mh-msg-filename msg folder)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
727 (expand-file-name mh-send-prog mh-progs)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
728 buffer-file-name))))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
729 (mh-annotate-msg msg folder mh-note-dist
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
730 "-component" "Resent:"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
731 "-text" (format "\"%s %s\"" to cc))
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
732 (if mh-redist-background
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
733 (mh-exec-cmd-daemon "/bin/sh" "-c"
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
734 (format "mhdist=1 mhaltmsg=%s %s %s %s"
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
735 (if mh-redist-full-contents
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
736 buffer-file-name
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
737 (mh-msg-filename msg folder))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
738 (if mh-redist-full-contents
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
739 ""
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
740 "mhannotate=1")
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
741 (mh-expand-file-name "send" mh-progs)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
742 buffer-file-name)))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
743 (kill-buffer draft)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
744 (message "Redistributing...done"))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
745
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
746 (defun mh-show-buffer-message-number (&optional buffer)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
747 "Message number of displayed message in corresponding show buffer.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
748 Return nil if show buffer not displayed.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
749 If in `mh-letter-mode', don't display the message number being replied to,
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
750 but rather the message number of the show buffer associated with our
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
751 originating folder buffer.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
752 Optional argument BUFFER can be used to specify the buffer."
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
753 (save-excursion
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
754 (if buffer
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
755 (set-buffer buffer))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
756 (cond ((eq major-mode 'mh-show-mode)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
757 (let ((number-start (search "/" buffer-file-name :from-end t)))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
758 (car (read-from-string (subseq buffer-file-name
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
759 (1+ number-start))))))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
760 ((and (eq major-mode 'mh-folder-mode)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
761 mh-show-buffer
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
762 (get-buffer mh-show-buffer))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
763 (mh-show-buffer-message-number mh-show-buffer))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
764 ((and (eq major-mode 'mh-letter-mode)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
765 mh-sent-from-folder
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
766 (get-buffer mh-sent-from-folder))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
767 (mh-show-buffer-message-number mh-sent-from-folder))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
768 (t
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
769 nil))))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
770
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
771 (defun mh-reply (message &optional reply-to includep)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
772 "Reply to MESSAGE (default: current message).
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
773 If the optional argument REPLY-TO is not given, prompts for type of addresses
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
774 to reply to:
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
775 from sender only,
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
776 to sender and primary recipients,
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
777 cc/all sender and all recipients.
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
778 If optional prefix argument INCLUDEP provided, then include the message
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
779 in the reply using filter `mhl.reply' in your MH directory.
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
780 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
781 for the reply. See also documentation for `\\[mh-send]' function."
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
782 (interactive (list
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
783 (mh-get-msg-num t)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
784 (let ((minibuffer-help-form
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
785 "from => Sender only\nto => Sender and primary recipients\ncc or all => Sender and all recipients"))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
786 (or mh-reply-default-reply-to
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
787 (completing-read "Reply to whom? (from, to, all) [from]: "
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
788 '(("from") ("to") ("cc") ("all"))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
789 nil
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
790 t)))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
791 current-prefix-arg))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
792 (let* ((folder mh-current-folder)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
793 (show-buffer mh-show-buffer)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
794 (config (current-window-configuration))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
795 (group-reply (or (equal reply-to "cc") (equal reply-to "all")))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
796 (form-file (cond ((and mh-nmh-flag group-reply
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
797 (stringp mh-repl-group-formfile))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
798 mh-repl-group-formfile)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
799 ((stringp mh-repl-formfile) mh-repl-formfile)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
800 (t nil))))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
801 (message "Composing a reply...")
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
802 (mh-exec-cmd "repl" "-build" "-noquery" "-nodraftfolder"
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
803 (if form-file
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
804 (list "-form" form-file))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
805 mh-current-folder message
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
806 (cond ((or (equal reply-to "from") (equal reply-to ""))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
807 '("-nocc" "all"))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
808 ((equal reply-to "to")
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
809 '("-cc" "to"))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
810 (group-reply (if mh-nmh-flag
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
811 '("-group" "-nocc" "me")
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
812 '("-cc" "all" "-nocc" "me"))))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
813 (cond ((or (eq mh-yank-from-start-of-msg 'autosupercite)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
814 (eq mh-yank-from-start-of-msg 'autoattrib))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
815 '("-noformat"))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
816 (includep '("-filter" "mhl.reply"))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
817 (t '())))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
818 (let ((draft (mh-read-draft "reply"
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
819 (expand-file-name "reply" mh-user-path)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
820 t)))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
821 (delete-other-windows)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
822 (save-buffer)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
823
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
824 (let ((to (mh-get-header-field "To:"))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
825 (subject (mh-get-header-field "Subject:"))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
826 (cc (mh-get-header-field "Cc:")))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
827 (goto-char (point-min))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
828 (mh-goto-header-end 1)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
829 (or includep
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
830 (not mh-reply-show-message-flag)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
831 (mh-in-show-buffer (show-buffer)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
832 (mh-display-msg message folder)))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
833 (mh-add-msgs-to-seq message 'answered t)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
834 (message "Composing a reply...done")
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
835 (mh-compose-and-send-mail draft "" folder message to subject cc
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
836 mh-note-repl "Replied:" config))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
837 (when (and (or (eq 'autosupercite mh-yank-from-start-of-msg)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
838 (eq 'autoattrib mh-yank-from-start-of-msg))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
839 (eq (mh-show-buffer-message-number) mh-sent-from-msg))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
840 (undo-boundary)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
841 (mh-yank-cur-msg))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
842 (mh-letter-mode-message))))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
843
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
844 (defun mh-send (to cc subject)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
845 "Compose and send a letter.
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
846
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
847 Do not call this function from outside MH-E; use \\[mh-smail] instead.
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
848
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
849 The file named by `mh-comp-formfile' will be used as the form.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
850 The letter is composed in `mh-letter-mode'; see its documentation for more
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
851 details.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
852 If `mh-compose-letter-function' is defined, it is called on the draft and
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
853 passed three arguments: TO, CC, and SUBJECT."
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
854 (interactive (list
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
855 (mh-read-address "To: ")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
856 (mh-read-address "Cc: ")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
857 (read-string "Subject: ")))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
858 (let ((config (current-window-configuration)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
859 (delete-other-windows)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
860 (mh-send-sub to cc subject config)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
861
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
862 (defun mh-send-other-window (to cc subject)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
863 "Compose and send a letter in another window.
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
864
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
865 Do not call this function from outside MH-E; use \\[mh-smail-other-window]
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
866 instead.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
867
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
868 The file named by `mh-comp-formfile' will be used as the form.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
869 The letter is composed in `mh-letter-mode'; see its documentation for more
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
870 details.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
871 If `mh-compose-letter-function' is defined, it is called on the draft and
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
872 passed three arguments: TO, CC, and SUBJECT."
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
873 (interactive (list
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
874 (mh-read-address "To: ")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
875 (mh-read-address "Cc: ")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
876 (read-string "Subject: ")))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
877 (let ((pop-up-windows t))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
878 (mh-send-sub to cc subject (current-window-configuration))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
879
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
880 (defun mh-send-sub (to cc subject config)
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
881 "Do the real work of composing and sending a letter.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
882 Expects the TO, CC, and SUBJECT fields as arguments.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
883 CONFIG is the window configuration before sending mail."
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
884 (let ((folder mh-current-folder)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
885 (msg-num (mh-get-msg-num nil)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
886 (message "Composing a message...")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
887 (let ((draft (mh-read-draft
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
888 "message"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
889 (let (components)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
890 (cond
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
891 ((file-exists-p
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
892 (setq components
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
893 (expand-file-name mh-comp-formfile mh-user-path)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
894 components)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
895 ((file-exists-p
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
896 (setq components
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
897 (expand-file-name mh-comp-formfile mh-lib)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
898 components)
28739
192cbf5dbea2 (mh-send-sub): Look for mh-comp-formfile in
Gerd Moellmann <gerd@gnu.org>
parents: 26393
diff changeset
899 ((file-exists-p
192cbf5dbea2 (mh-send-sub): Look for mh-comp-formfile in
Gerd Moellmann <gerd@gnu.org>
parents: 26393
diff changeset
900 (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
901 (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
902 ;; What is this mh-etc ?? -sm
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
903 ;; This is dead code, so
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
904 ;; remove it.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
905 ;(and (boundp 'mh-etc) mh-etc)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
906 )))
28739
192cbf5dbea2 (mh-send-sub): Look for mh-comp-formfile in
Gerd Moellmann <gerd@gnu.org>
parents: 26393
diff changeset
907 components)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
908 (t
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
909 (error (format "Can't find components file \"%s\""
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
910 components)))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
911 nil)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
912 (mh-insert-fields "To:" to "Subject:" subject "Cc:" cc)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
913 (goto-char (point-max))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
914 (mh-compose-and-send-mail draft "" folder msg-num
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
915 to subject cc
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
916 nil nil config)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
917 (mh-letter-mode-message))))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
918
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
919 (defun mh-read-draft (use initial-contents delete-contents-file)
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
920 "Read draft file into a draft buffer and make that buffer the current one.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
921 USE is a message used for prompting about the intended use of the message.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
922 INITIAL-CONTENTS is filename that is read into an empty buffer, or nil
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
923 if buffer should not be modified. Delete the initial-contents file if
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
924 DELETE-CONTENTS-FILE flag is set.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
925 Returns the draft folder's name.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
926 If the draft folder facility is enabled in ~/.mh_profile, a new buffer is
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
927 used each time and saved in the draft folder. The draft file can then be
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
928 reused."
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
929 (cond (mh-draft-folder
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
930 (let ((orig-default-dir default-directory)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
931 (draft-file-name (mh-new-draft-name)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
932 (pop-to-buffer (generate-new-buffer
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
933 (format "draft-%s"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
934 (file-name-nondirectory draft-file-name))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
935 (condition-case ()
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
936 (insert-file-contents draft-file-name t)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
937 (file-error))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
938 (setq default-directory orig-default-dir)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
939 (t
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
940 (let ((draft-name (expand-file-name "draft" mh-user-path)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
941 (pop-to-buffer "draft") ; Create if necessary
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
942 (if (buffer-modified-p)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
943 (if (y-or-n-p "Draft has been modified; kill anyway? ")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
944 (set-buffer-modified-p nil)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
945 (error "Draft preserved")))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
946 (setq buffer-file-name draft-name)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
947 (clear-visited-file-modtime)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
948 (unlock-buffer)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
949 (cond ((and (file-exists-p draft-name)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
950 (not (equal draft-name initial-contents)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
951 (insert-file-contents draft-name)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
952 (delete-file draft-name))))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
953 (cond ((and initial-contents
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
954 (or (zerop (buffer-size))
13385
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
955 (if (y-or-n-p
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
956 (format "A draft exists. Use for %s? " use))
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
957 (if mh-error-if-no-draft
38414
67b464da13ec Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 35975
diff changeset
958 (error "A prior draft exists"))
13385
c0249fda1691 reporter.el support.
Karl Heuer <kwzh@gnu.org>
parents: 11578
diff changeset
959 t)))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
960 (erase-buffer)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
961 (insert-file-contents initial-contents)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
962 (if delete-contents-file (delete-file initial-contents))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
963 (auto-save-mode 1)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
964 (if mh-draft-folder
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
965 (save-buffer)) ; Do not reuse draft name
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
966 (buffer-name))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
967
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
968 (defun mh-new-draft-name ()
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
969 "Return the pathname of folder for draft messages."
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
970 (save-excursion
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
971 (mh-exec-cmd-quiet t "mhpath" mh-draft-folder "new")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
972 (buffer-substring (point-min) (1- (point-max)))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
973
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
974 (defun mh-annotate-msg (msg buffer note &rest args)
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
975 "Mark MSG in BUFFER with character NOTE and annotate message with ARGS."
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
976 (apply 'mh-exec-cmd "anno" buffer msg args)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
977 (save-excursion
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
978 (cond ((get-buffer buffer) ; Buffer may be deleted
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
979 (set-buffer buffer)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
980 (if (symbolp msg)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
981 (mh-notate-seq msg note (1+ mh-cmd-note))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
982 (mh-notate msg note (1+ mh-cmd-note)))))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
983
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
984 (defun mh-insert-fields (&rest name-values)
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
985 "Insert the NAME-VALUES pairs in the current buffer.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
986 If the field exists, append the value to it.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
987 Do not insert any pairs whose value is the empty string."
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
988 (let ((case-fold-search t))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
989 (while name-values
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
990 (let ((field-name (car name-values))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
991 (value (car (cdr name-values))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
992 (cond ((equal value "")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
993 nil)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
994 ((mh-position-on-field field-name)
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
995 (insert " " (or value "")))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
996 (t
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
997 (insert field-name " " value "\n")))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
998 (setq name-values (cdr (cdr name-values)))))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
999
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1000 (defun mh-position-on-field (field &optional ignored)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1001 "Move to the end of the FIELD in the header.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1002 Move to end of entire header if FIELD not found.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1003 Returns non-nil iff FIELD was found.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1004 The optional second arg is for pre-version 4 compatibility and is IGNORED."
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1005 (cond ((mh-goto-header-field field)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1006 (mh-header-field-end)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1007 t)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1008 ((mh-goto-header-end 0)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1009 nil)))
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1010
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1011 (defun mh-get-header-field (field)
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1012 "Find and return the body of FIELD in the mail header.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1013 Returns the empty string if the field is not in the header of the
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1014 current buffer."
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1015 (if (mh-goto-header-field field)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1016 (progn
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1017 (skip-chars-forward " \t") ;strip leading white space in body
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1018 (let ((start (point)))
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1019 (mh-header-field-end)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1020 (buffer-substring start (point))))
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1021 ""))
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1022
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1023 (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
1024
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1025 (defun mh-goto-header-field (field)
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1026 "Move to FIELD in the message header.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1027 Move to the end of the FIELD name, which should end in a colon.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1028 Returns t if found, nil if not."
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1029 (goto-char (point-min))
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1030 (let ((case-fold-search t)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1031 (headers-end (save-excursion
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1032 (mh-goto-header-end 0)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1033 (point))))
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1034 (re-search-forward (format "^%s" field) headers-end t)))
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1035
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1036 (defun mh-goto-header-end (arg)
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1037 "Move the cursor ARG lines after the header."
11507
595e689b719b Update some MIME doc strings.
Karl Heuer <kwzh@gnu.org>
parents: 11333
diff changeset
1038 (if (re-search-forward "^-*$" nil nil)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1039 (forward-line arg)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1040
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1041
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1042 (defun mh-read-address (prompt)
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1043 "Read a To: or Cc: address, prompting in the minibuffer with PROMPT.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1044 May someday do completion on aliases."
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1045 (read-string prompt))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1046
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1047
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1048
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1049 ;;; Mode for composing and sending a draft message.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1050
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1051 (put 'mh-letter-mode 'mode-class 'special)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1052
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1053 ;;; Support for emacs21 toolbar using gnus/message.el icons (and code).
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1054 (eval-when-compile (defvar tool-bar-map))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1055 (defvar mh-letter-tool-bar-map nil)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1056 (when (and (fboundp 'tool-bar-add-item)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1057 tool-bar-mode)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1058 (setq mh-letter-tool-bar-map
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1059 (let ((tool-bar-map (make-sparse-keymap)))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1060 (tool-bar-add-item "mail_send" 'mh-send-letter 'mh-lettertoolbar-send
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1061 :help "Send this letter")
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1062 (tool-bar-add-item "attach" 'mh-compose-insertion
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1063 'mh-lettertoolbar-compose
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1064 :help "Insert attachment")
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1065 (tool-bar-add-item "spell" 'ispell-message 'mh-lettertoolbar-ispell
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1066 :help "Check spelling")
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1067 (tool-bar-add-item-from-menu 'save-buffer "save")
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1068 (tool-bar-add-item-from-menu 'undo "undo")
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1069 (tool-bar-add-item-from-menu 'kill-region "cut")
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1070 (tool-bar-add-item-from-menu 'menu-bar-kill-ring-save "copy")
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1071 (tool-bar-add-item "close" 'mh-fully-kill-draft 'mh-lettertoolbar-kill
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1072 :help "Kill this draft")
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1073 (tool-bar-add-item "preferences" (lambda ()
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1074 (interactive)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1075 (customize-group "mh-compose"))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1076 'mh-lettertoolbar-customize
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1077 :help "MH-E composition preferences")
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1078 (tool-bar-add-item "help" (lambda ()
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1079 (interactive)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1080 (Info-goto-node "(mh-e)Draft Editing"))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1081 'mh-lettertoolbar-help :help "Help")
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1082 tool-bar-map)))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1083
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1084 ;;; Menu extracted from mh-menubar.el V1.1 (31 July 2001)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1085 (eval-when-compile (defvar mh-letter-menu nil))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1086 (cond
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1087 ((fboundp 'easy-menu-define)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1088 (easy-menu-define
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1089 mh-letter-menu mh-letter-mode-map "Menu for MH-E letter mode."
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1090 '("Letter"
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1091 ["Send This Draft" mh-send-letter t]
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1092 ["Split Current Line" mh-open-line t]
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1093 ["Check Recipient" mh-check-whom t]
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1094 ["Yank Current Message" mh-yank-cur-msg t]
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1095 ["Insert a Message..." mh-insert-letter t]
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1096 ["Insert Signature" mh-insert-signature t]
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1097 ["GPG Sign message" mh-mml-secure-message-sign-pgpmime mh-gnus-pgp-support-flag]
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1098 ["GPG Encrypt message" mh-mml-secure-message-encrypt-pgpmime mh-gnus-pgp-support-flag]
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1099 ["Compose Insertion (MIME)..." mh-compose-insertion t]
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1100 ;; ["Compose Compressed tar (MIME)..." mh-mhn-compose-external-compressed-tar t]
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1101 ;; ["Compose Anon FTP (MIME)..." mh-mhn-compose-anon-ftp t]
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1102 ["Compose Forward (MIME)..." mh-compose-forward t]
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1103 ;; The next two will have to be merged. But I also need to make sure the user
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1104 ;; can't mix directives of both types.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1105 ["Pull in All Compositions (mhn)" mh-edit-mhn mh-mhn-compose-insert-flag]
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1106 ["Pull in All Compositions (gnus)" mh-mml-to-mime mh-mml-compose-insert-flag]
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1107 ["Revert to Non-MIME Edit (mhn)" mh-revert-mhn-edit (equal mh-compose-insertion 'mhn)]
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1108 ["Kill This Draft" mh-fully-kill-draft t]))))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1109
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1110 ;;; Help Messages
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1111 ;;; Group messages logically, more or less.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1112 (defvar mh-letter-mode-help-messages
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1113 '((nil
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1114 "Send letter: \\[mh-send-letter]"
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1115 "\t\tOpen line: \\[mh-open-line]\n"
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1116 "Kill letter: \\[mh-fully-kill-draft]"
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1117 "\t\tInsert:\n"
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1118 "Check recipients: \\[mh-check-whom]"
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1119 "\t\t Current message: \\[mh-yank-cur-msg]\n"
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1120 "Encrypt message: \\[mh-mml-secure-message-encrypt-pgpmime]"
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1121 "\t\t Attachment: \\[mh-compose-insertion]\n"
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1122 "Sign message: \\[mh-mml-secure-message-sign-pgpmime]"
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1123 "\t\t Message to forward: \\[mh-compose-forward]\n"
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1124 " "
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1125 "\t\t Signature: \\[mh-insert-signature]"))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1126 "Key binding cheat sheet.
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1127
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1128 This is an associative array which is used to show the most common commands.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1129 The key is a prefix char. The value is one or more strings which are
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1130 concatenated together and displayed in the minibuffer if ? is pressed after
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1131 the prefix character. The special key nil is used to display the
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1132 non-prefixed commands.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1133
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1134 The substitutions described in `substitute-command-keys' are performed as
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1135 well.")
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1136
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1137
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1138 (defun mh-fill-paragraph-function (arg)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1139 "Fill paragraph at or after point.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1140 Prefix ARG means justify as well. This function enables `fill-paragraph' to
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1141 work better in MH-Letter mode."
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1142 (interactive "P")
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1143 (let ((fill-paragraph-function) (fill-prefix))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1144 (if (mh-in-header-p)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1145 (mail-mode-fill-paragraph arg)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1146 (fill-paragraph arg))))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1147
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1148 ;;;###autoload
29420
25fb2df6c428 (mh-send-sub): Check mh-etc is bound before using it.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28739
diff changeset
1149 (define-derived-mode mh-letter-mode text-mode "MH-Letter"
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1150 "Mode for composing letters in MH-E.\\<mh-letter-mode-map>
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1151
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1152 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
1153 using the MH mail handling system.
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1154
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1155 If MH MIME directives are added manually, you must first run \\[mh-edit-mhn]
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1156 before sending the message. MIME directives that are added by MH-E commands
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1157 such as \\[mh-mhn-compose-insertion] are processed automatically when the
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1158 message is sent.
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1159
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1160 Options that control this mode can be changed with
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1161 \\[customize-group]; specify the \"mh-compose\" group.
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1162
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1163 When a message is composed, the hooks `text-mode-hook' and
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1164 `mh-letter-mode-hook' are run.
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1165
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1166 \\{mh-letter-mode-map}"
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1167
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1168 (or mh-user-path (mh-find-path))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1169 (make-local-variable 'mh-send-args)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1170 (make-local-variable 'mh-annotate-char)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1171 (make-local-variable 'mh-annotate-field)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1172 (make-local-variable 'mh-previous-window-config)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1173 (make-local-variable 'mh-sent-from-folder)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1174 (make-local-variable 'mh-sent-from-msg)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1175 (make-local-variable 'mail-header-separator)
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1176 (setq mail-header-separator mh-mail-header-separator) ;override sendmail.el
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1177 (make-local-variable 'mh-help-messages)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1178 (setq mh-help-messages mh-letter-mode-help-messages)
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1179
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1180 ;; From sendmail.el for proper paragraph fill
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1181 ;; sendmail.el also sets a normal-auto-fill-function (not done here)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1182 (make-local-variable 'paragraph-separate)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1183 (make-local-variable 'paragraph-start)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1184 (make-local-variable 'fill-paragraph-function)
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1185 (setq fill-paragraph-function 'mh-fill-paragraph-function)
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1186 (make-local-variable 'adaptive-fill-regexp)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1187 (setq adaptive-fill-regexp
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1188 (concat adaptive-fill-regexp
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1189 "\\|[ \t]*[-[:alnum:]]*>+[ \t]*"))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1190 (make-local-variable 'adaptive-fill-first-line-regexp)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1191 (setq adaptive-fill-first-line-regexp
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1192 (concat adaptive-fill-first-line-regexp
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1193 "\\|[ \t]*[-[:alnum:]]*>+[ \t]*"))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1194 ;; `-- ' precedes the signature. `-----' appears at the start of the
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1195 ;; lines that delimit forwarded messages.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1196 ;; Lines containing just >= 3 dashes, perhaps after whitespace,
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1197 ;; are also sometimes used and should be separators.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1198 (setq paragraph-start (concat (regexp-quote mail-header-separator)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1199 "\\|\t*\\([-|#;>* ]\\|(?[0-9]+[.)]\\)+$"
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1200 "\\|[ \t]*[[:alnum:]]*>+[ \t]*$\\|[ \t]*$\\|"
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1201 "-- $\\|---+$\\|"
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1202 page-delimiter))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1203 (setq paragraph-separate paragraph-start)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1204 ;; --- End of code from sendmail.el ---
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1205
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1206 (if (and (boundp 'tool-bar-mode) tool-bar-mode)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1207 (set (make-local-variable 'tool-bar-map) mh-letter-tool-bar-map))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1208 (make-local-variable 'font-lock-defaults)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1209 (cond
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1210 ((or (equal mh-highlight-citation-p 'font-lock)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1211 (equal mh-highlight-citation-p 'gnus))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1212 ;; Let's use font-lock even if gnus is used in show-mode. The reason
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1213 ;; is that gnus uses static text properties which are not appropriate
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1214 ;; for a buffer that will be edited. So the choice here is either fontify
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1215 ;; the citations and header...
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1216 (setq font-lock-defaults '(mh-show-font-lock-keywords-with-cite t)))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1217 (t
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1218 ;; ...or the header only
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1219 (setq font-lock-defaults '(mh-show-font-lock-keywords t))))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1220 (easy-menu-add mh-letter-menu)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1221 ;; See if a "forw: -mime" message containing a MIME composition.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1222 ;; mode clears local vars, so can't do this in mh-forward.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1223 (save-excursion
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1224 (goto-char (point-min))
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1225 (when (and (re-search-forward (format "^\\(%s\\)?$" mail-header-separator) nil t)
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1226 (= 0 (forward-line 1))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1227 (looking-at "^#forw"))
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1228 (require 'mh-mime) ;Need mh-mhn-compose-insert-flag local var
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1229 (setq mh-mhn-compose-insert-flag t)))
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1230 (setq fill-column mh-letter-fill-column)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1231 ;; 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
1232 (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
1233 (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
1234 (setq auto-fill-function 'mh-auto-fill-for-letter)))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1235
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1236 (defun mh-auto-fill-for-letter ()
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1237 "Perform auto-fill for message.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1238 Header is treated specially by inserting a tab before continuation lines."
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1239 (if (mh-in-header-p)
11507
595e689b719b Update some MIME doc strings.
Karl Heuer <kwzh@gnu.org>
parents: 11333
diff changeset
1240 (let ((fill-prefix "\t"))
595e689b719b Update some MIME doc strings.
Karl Heuer <kwzh@gnu.org>
parents: 11333
diff changeset
1241 (do-auto-fill))
595e689b719b Update some MIME doc strings.
Karl Heuer <kwzh@gnu.org>
parents: 11333
diff changeset
1242 (do-auto-fill)))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1243
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1244 (defun mh-insert-header-separator ()
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1245 "Insert `mh-mail-header-separator', if absent."
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1246 (save-excursion
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1247 (goto-char (point-min))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1248 (rfc822-goto-eoh)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1249 (if (looking-at "$")
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1250 (insert mh-mail-header-separator))))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1251
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1252 (defun mh-to-field ()
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1253 "Move point to the end of a specified header field.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1254 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
1255 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
1256 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
1257 (interactive)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1258 (expand-abbrev)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1259 (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
1260 mh-to-field-choices)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1261 ;; also look for a char for version 4 compat
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1262 (assoc (logior last-input-char ?`) mh-to-field-choices))))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1263 (case-fold-search t))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1264 (push-mark)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1265 (cond ((mh-position-on-field target)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1266 (let ((eol (point)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1267 (skip-chars-backward " \t")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1268 (delete-region (point) eol))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1269 (if (and (not (eq (logior last-input-char ?`) ?s))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1270 (save-excursion
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1271 (backward-char 1)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1272 (not (looking-at "[:,]"))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1273 (insert ", ")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1274 (insert " ")))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1275 (t
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1276 (if (mh-position-on-field "To:")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1277 (forward-line 1))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1278 (insert (format "%s \n" target))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1279 (backward-char 1)))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1280
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1281 (defun mh-to-fcc (&optional folder)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1282 "Insert an Fcc: FOLDER field in the current message.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1283 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
1284 (interactive)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1285 (or folder
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1286 (setq folder (mh-prompt-for-folder
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1287 "Fcc"
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1288 (or (and mh-default-folder-for-message-function
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1289 (save-excursion
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1290 (goto-char (point-min))
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1291 (funcall mh-default-folder-for-message-function)))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1292 "")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1293 t)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1294 (let ((last-input-char ?\C-f))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1295 (expand-abbrev)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1296 (save-excursion
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1297 (mh-to-field)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1298 (insert (if (mh-folder-name-p folder)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1299 (substring folder 1)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1300 folder)))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1301
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1302 (defun mh-insert-signature ()
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1303 "Insert the file named by `mh-signature-file-name' at point.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1304 The value of `mh-letter-insert-signature-hook' is a list of functions to be
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1305 called, with no arguments, before the signature is actually inserted."
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1306 (interactive)
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1307 (let ((mh-signature-file-name mh-signature-file-name))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1308 (run-hooks 'mh-letter-insert-signature-hook)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1309 (if mh-signature-file-name
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1310 (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
1311 (force-mode-line-update))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1312
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1313 (defun mh-check-whom ()
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1314 "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
1315 (interactive)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1316 (let ((file-name buffer-file-name))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1317 (save-buffer)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1318 (message "Checking recipients...")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1319 (mh-in-show-buffer ("*Recipients*")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1320 (bury-buffer (current-buffer))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1321 (erase-buffer)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1322 (mh-exec-cmd-output "whom" t file-name))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1323 (message "Checking recipients...done")))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1324
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1325
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1326
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1327 ;;; Routines to compose and send a letter.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1328
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1329 (defun mh-insert-x-face ()
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1330 "Append X-Face field to header.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1331 If the field already exists, this function does nothing."
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1332 (when (and (file-exists-p mh-x-face-file)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1333 (file-readable-p mh-x-face-file))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1334 (save-excursion
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1335 (when (null (mh-position-on-field "X-Face"))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1336 (insert "X-Face: ")
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1337 (goto-char (+ (point) (cadr (insert-file-contents mh-x-face-file))))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1338 (if (not (looking-at "^"))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1339 (insert "\n"))))))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1340
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1341 (defun mh-insert-x-mailer ()
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1342 "Append an X-Mailer field to the header.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1343 The versions of MH-E, Emacs, and MH are shown."
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1344
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1345 ;; Lazily initialize mh-x-mailer-string.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1346 (when (null mh-x-mailer-string)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1347 (save-window-excursion
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1348 (mh-version)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1349 (set-buffer mh-temp-buffer)
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1350 (if mh-nmh-flag
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1351 (search-forward-regexp "^nmh-\\(\\S +\\)")
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1352 (search-forward-regexp "^MH \\(\\S +\\)" nil t))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1353 (let ((x-mailer-mh (buffer-substring (match-beginning 1) (match-end 1))))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1354 (setq mh-x-mailer-string
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1355 (format "MH-E %s; %s %s; %s %d.%d"
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1356 mh-version (if mh-nmh-flag "nmh" "MH") x-mailer-mh
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1357 (if mh-xemacs-flag
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1358 "XEmacs"
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1359 "Emacs")
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1360 emacs-major-version emacs-minor-version)))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1361 (kill-buffer mh-temp-buffer)))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1362 ;; Insert X-Mailer, but only if it doesn't already exist.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1363 (save-excursion
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1364 (when (null (mh-goto-header-field "X-Mailer"))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1365 (mh-insert-fields "X-Mailer:" mh-x-mailer-string))))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1366
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1367 (defun mh-regexp-in-field-p (regexp &rest fields)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1368 "Non-nil means REGEXP was found in FIELDS."
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1369 (save-excursion
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1370 (let ((search-result nil)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1371 (field))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1372 (while fields
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1373 (setq field (car fields))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1374 (if (and (mh-goto-header-field field)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1375 (re-search-forward
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1376 regexp (save-excursion (mh-header-field-end)(point)) t))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1377 (setq fields nil
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1378 search-result t)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1379 (setq fields (cdr fields))))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1380 search-result)))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1381
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1382 (defun mh-insert-mail-followup-to ()
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1383 "Insert Mail-Followup-To: if To or Cc match `mh-insert-mail-followup-to-list'."
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1384 (save-excursion
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1385 (if (and (or (mh-goto-header-field "To:")(mh-goto-header-field "cc:"))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1386 (not (mh-goto-header-field "Mail-Followup-To: ")))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1387 (let ((list mh-insert-mail-followup-to-list))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1388 (while list
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1389 (let ((regexp (nth 0 (car list)))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1390 (entry (nth 1 (car list))))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1391 (when (mh-regexp-in-field-p regexp "To:" "cc:")
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1392 (if (mh-goto-header-field "Mail-Followup-To: ")
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1393 (insert entry ", ")
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1394 (mh-goto-header-end 0)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1395 (insert "Mail-Followup-To: " entry "\n")))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1396 (setq list (cdr list))))))))
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1397
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1398 (defun mh-compose-and-send-mail (draft send-args
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1399 sent-from-folder sent-from-msg
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1400 to subject cc
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1401 annotate-char annotate-field
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1402 config)
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1403 "Edit and compose a draft message in buffer DRAFT and send or save it.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1404 SEND-ARGS is the argument passed to the send command.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1405 SENT-FROM-FOLDER is buffer containing scan listing of current folder, or
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1406 nil if none exists.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1407 SENT-FROM-MSG is the message number or sequence name or nil.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1408 The TO, SUBJECT, and CC fields are passed to the
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1409 `mh-compose-letter-function'.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1410 If ANNOTATE-CHAR is non-null, it is used to notate the scan listing of the
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1411 message. In that case, the ANNOTATE-FIELD is used to build a string
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1412 for `mh-annotate-msg'.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1413 CONFIG is the window configuration to restore after sending the letter."
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1414 (pop-to-buffer draft)
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1415 (if mh-insert-mail-followup-to-flag (mh-insert-mail-followup-to))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1416 (mh-letter-mode)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1417 (setq mh-sent-from-folder sent-from-folder)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1418 (setq mh-sent-from-msg sent-from-msg)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1419 (setq mh-send-args send-args)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1420 (setq mh-annotate-char annotate-char)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1421 (setq mh-annotate-field annotate-field)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1422 (setq mh-previous-window-config config)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1423 (setq mode-line-buffer-identification (list "{%b}"))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1424 (if (and (boundp 'mh-compose-letter-function)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1425 mh-compose-letter-function)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1426 ;; run-hooks will not pass arguments.
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1427 (let ((value mh-compose-letter-function))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1428 (if (and (listp value) (not (eq (car value) 'lambda)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1429 (while value
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1430 (funcall (car value) to subject cc)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1431 (setq value (cdr value)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1432 (funcall mh-compose-letter-function to subject cc)))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1433
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1434 (defun mh-letter-mode-message ()
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1435 "Display a help message for users of `mh-letter-mode'.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1436 This should be the last function called when composing the draft."
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1437 (message "%s" (substitute-command-keys
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1438 (concat "Type \\[mh-send-letter] to send message, "
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1439 "\\[mh-help] for help."))))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1440
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1441 (defun mh-send-letter (&optional arg)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1442 "Send the draft letter in the current buffer.
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1443 If optional prefix argument ARG is provided, monitor delivery.
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1444 The value of `mh-before-send-letter-hook' is a list of functions to be called,
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1445 with no arguments, before doing anything.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1446 Run `\\[mh-edit-mhn]' if variable `mh-mhn-compose-insert-flag' is set."
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1447 (interactive "P")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1448 (run-hooks 'mh-before-send-letter-hook)
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1449 (cond
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1450 ((and (boundp 'mh-mhn-compose-insert-flag)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1451 mh-mhn-compose-insert-flag)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1452 (mh-edit-mhn))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1453 ((and (boundp 'mh-mml-compose-insert-flag)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1454 mh-mml-compose-insert-flag)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1455 (mh-mml-to-mime)))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1456 (if mh-insert-x-mailer-flag (mh-insert-x-mailer))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1457 (mh-insert-x-face)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1458 (save-buffer)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1459 (message "Sending...")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1460 (let ((draft-buffer (current-buffer))
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1461 (file-name buffer-file-name)
19936
78aa8484e6e9 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 17593
diff changeset
1462 (config mh-previous-window-config)
78aa8484e6e9 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 17593
diff changeset
1463 (coding-system-for-write
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1464 (if (and (local-variable-p 'buffer-file-coding-system
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1465 (current-buffer)) ;XEmacs needs two args
19952
3e0041620fc2 Fix previous change.
Richard M. Stallman <rms@gnu.org>
parents: 19936
diff changeset
1466 ;; We're not sure why, but buffer-file-coding-system
3e0041620fc2 Fix previous change.
Richard M. Stallman <rms@gnu.org>
parents: 19936
diff changeset
1467 ;; tends to get set to undecided-unix.
3e0041620fc2 Fix previous change.
Richard M. Stallman <rms@gnu.org>
parents: 19936
diff changeset
1468 (not (memq buffer-file-coding-system
3e0041620fc2 Fix previous change.
Richard M. Stallman <rms@gnu.org>
parents: 19936
diff changeset
1469 '(undecided undecided-unix undecided-dos))))
19936
78aa8484e6e9 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 17593
diff changeset
1470 buffer-file-coding-system
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1471 (or (and (boundp 'sendmail-coding-system) sendmail-coding-system)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1472 (and (boundp 'default-buffer-file-coding-system )
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1473 default-buffer-file-coding-system)
19936
78aa8484e6e9 Many doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 17593
diff changeset
1474 'iso-latin-1))))
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1475 ;; The default BCC encapsulation will make a MIME message unreadable.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1476 ;; With nmh use the -mime arg to prevent this.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1477 (if (and mh-nmh-flag
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1478 (mh-goto-header-field "Bcc:")
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1479 (mh-goto-header-field "Content-Type:"))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1480 (setq mh-send-args (format "-mime %s" mh-send-args)))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1481 (cond (arg
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1482 (pop-to-buffer "MH mail delivery")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1483 (erase-buffer)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1484 (mh-exec-cmd-output mh-send-prog t "-watch" "-nopush"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1485 "-nodraftfolder" mh-send-args file-name)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1486 (goto-char (point-max)) ; show the interesting part
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1487 (recenter -1)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1488 (set-buffer draft-buffer)) ; for annotation below
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1489 (t
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1490 (mh-exec-cmd-daemon mh-send-prog "-nodraftfolder" "-noverbose"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1491 mh-send-args file-name)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1492 (if mh-annotate-char
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1493 (mh-annotate-msg mh-sent-from-msg
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1494 mh-sent-from-folder
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1495 mh-annotate-char
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1496 "-component" mh-annotate-field
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1497 "-text" (format "\"%s %s\""
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1498 (mh-get-header-field "To:")
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1499 (mh-get-header-field "Cc:"))))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1500
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1501 (cond ((or (not arg)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1502 (y-or-n-p "Kill draft buffer? "))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1503 (kill-buffer draft-buffer)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1504 (if config
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1505 (set-window-configuration config))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1506 (if arg
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1507 (message "Sending...done")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1508 (message "Sending...backgrounded"))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1509
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1510 (defun mh-insert-letter (folder message verbatim)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1511 "Insert a message into the current letter.
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1512 Removes the message's headers using `mh-invisible-headers'. Prefixes each
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1513 non-blank line with `mh-ins-buf-prefix', unless `mh-yank-from-start-of-msg'
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1514 is set for supercite and then use it to format the message.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1515 Prompts for FOLDER and MESSAGE. If prefix argument VERBATIM provided, do
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1516 not indent and do not delete headers. Leaves the mark before the letter
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1517 and point after it."
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1518 (interactive
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1519 (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
1520 (read-input (format "Message number%s: "
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1521 (if mh-sent-from-msg
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1522 (format " [%d]" mh-sent-from-msg)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1523 "")))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1524 current-prefix-arg))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1525 (save-restriction
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1526 (narrow-to-region (point) (point))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1527 (let ((start (point-min)))
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1528 (if (equal message "") (setq message (int-to-string mh-sent-from-msg)))
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1529 (insert-file-contents
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1530 (expand-file-name message (mh-expand-file-name folder)))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1531 (when (not verbatim)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1532 (mh-clean-msg-header start mh-invisible-headers mh-visible-headers)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1533 (goto-char (point-max)) ;Needed for sc-cite-original
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1534 (push-mark) ;Needed for sc-cite-original
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1535 (goto-char (point-min)) ;Needed for sc-cite-original
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1536 (mh-insert-prefix-string mh-ins-buf-prefix)))))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1537
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1538 (defun mh-extract-from-attribution ()
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1539 "Extract phrase or comment from From header field."
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1540 (save-excursion
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1541 (if (not (mh-goto-header-field "From: "))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1542 nil
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1543 (skip-chars-forward " ")
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1544 (cond
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1545 ((looking-at "\"\\([^\"\n]+\\)\" \\(<.+>\\)")
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1546 (format "%s %s %s" (match-string 1)(match-string 2)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1547 mh-extract-from-attribution-verb))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1548 ((looking-at "\\([^<\n]+<.+>\\)$")
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1549 (format "%s %s" (match-string 1) mh-extract-from-attribution-verb))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1550 ((looking-at "\\([^ ]+@[^ ]+\\) +(\\(.+\\))$")
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1551 (format "%s <%s> %s" (match-string 2)(match-string 1)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1552 mh-extract-from-attribution-verb))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1553 ((looking-at " *\\(.+\\)$")
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1554 (format "%s %s" (match-string 1) mh-extract-from-attribution-verb))))))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1555
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1556 (defun mh-yank-cur-msg ()
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1557 "Insert the current message into the draft buffer.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1558 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
1559 `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
1560 only the region will be inserted. Otherwise, the entire message will
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1561 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
1562 is nil, the portion of the message following the point will be yanked.
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1563 If `mh-delete-yanked-msg-window-flag' is non-nil, any window displaying the
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1564 yanked message will be deleted."
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1565 (interactive)
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1566 (if (and mh-sent-from-folder
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1567 (save-excursion (set-buffer mh-sent-from-folder) mh-show-buffer)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1568 (save-excursion (set-buffer mh-sent-from-folder)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1569 (get-buffer mh-show-buffer))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1570 mh-sent-from-msg)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1571 (let ((to-point (point))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1572 (to-buffer (current-buffer)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1573 (set-buffer mh-sent-from-folder)
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1574 (if mh-delete-yanked-msg-window-flag
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1575 (delete-windows-on mh-show-buffer))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1576 (set-buffer mh-show-buffer) ; Find displayed message
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1577 (let* ((from-attr (mh-extract-from-attribution))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1578 (yank-region (mh-mark-active-p nil))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1579 (mh-ins-str
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1580 (cond ((and yank-region
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1581 (or (eq 'supercite mh-yank-from-start-of-msg)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1582 (eq 'autosupercite mh-yank-from-start-of-msg)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1583 (eq t mh-yank-from-start-of-msg)))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1584 ;; supercite needs the full header
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1585 (concat
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1586 (buffer-substring (point-min) (mail-header-end))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1587 "\n"
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1588 (buffer-substring (region-beginning) (region-end))))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1589 (yank-region
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1590 (buffer-substring (region-beginning) (region-end)))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1591 ((or (eq 'body mh-yank-from-start-of-msg)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1592 (eq 'attribution
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1593 mh-yank-from-start-of-msg)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1594 (eq 'autoattrib
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1595 mh-yank-from-start-of-msg))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1596 (buffer-substring
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1597 (save-excursion
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1598 (goto-char (point-min))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1599 (mh-goto-header-end 1)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1600 (point))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1601 (point-max)))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1602 ((or (eq 'supercite mh-yank-from-start-of-msg)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1603 (eq 'autosupercite mh-yank-from-start-of-msg)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1604 (eq t mh-yank-from-start-of-msg))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1605 (buffer-substring (point-min) (point-max)))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1606 (t
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1607 (buffer-substring (point) (point-max))))))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1608 (set-buffer to-buffer)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1609 (save-restriction
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1610 (narrow-to-region to-point to-point)
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1611 (insert (mh-filter-out-non-text mh-ins-str))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1612 (goto-char (point-max)) ;Needed for sc-cite-original
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1613 (push-mark) ;Needed for sc-cite-original
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1614 (goto-char (point-min)) ;Needed for sc-cite-original
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1615 (mh-insert-prefix-string mh-ins-buf-prefix)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1616 (if (or (eq 'attribution mh-yank-from-start-of-msg)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1617 (eq 'autoattrib mh-yank-from-start-of-msg))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1618 (insert from-attr "\n\n"))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1619 ;; If the user has selected a region, he has already "edited" the
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1620 ;; text, so leave the cursor at the end of the yanked text. In
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1621 ;; either case, leave a mark at the opposite end of the included
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1622 ;; text to make it easy to jump or delete to the other end of the
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1623 ;; text.
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1624 (push-mark)
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1625 (goto-char (point-max))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1626 (if (null yank-region)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1627 (mh-exchange-point-and-mark-preserving-active-mark)))))
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1628 (error "There is no current message")))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1629
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1630 (defun mh-filter-out-non-text (string)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1631 "Return STRING but without adornments such as MIME buttons and smileys."
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1632 (with-temp-buffer
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1633 ;; Insert the string to filter
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1634 (insert string)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1635 (goto-char (point-min))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1636
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1637 ;; Remove the MIME buttons
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1638 (let ((can-move-forward t)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1639 (in-button nil))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1640 (while can-move-forward
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1641 (cond ((and (not (get-text-property (point) 'mh-data))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1642 in-button)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1643 (delete-region (save-excursion (forward-line -1) (point))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1644 (point))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1645 (setq in-button nil))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1646 ((get-text-property (point) 'mh-data)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1647 (delete-region (point)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1648 (save-excursion (forward-line) (point)))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1649 (setq in-button t))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1650 (t (setq can-move-forward (= (forward-line) 0))))))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1651
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1652 ;; Return the contents without properties... This gets rid of emphasis
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1653 ;; and smileys
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1654 (buffer-substring-no-properties (point-min) (point-max))))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1655
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1656 (defun mh-insert-prefix-string (mh-ins-string)
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1657 "Insert prefix string before each line in buffer.
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1658 The inserted letter is cited using `sc-cite-original' if
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1659 `mh-yank-from-start-of-msg' is one of 'supercite or 'autosupercite. Otherwise,
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1660 simply insert MH-INS-STRING before each line."
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1661 (goto-char (point-min))
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1662 (cond ((or (eq mh-yank-from-start-of-msg 'supercite)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1663 (eq mh-yank-from-start-of-msg 'autosupercite))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1664 (sc-cite-original))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1665 (mail-citation-hook
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1666 (run-hooks 'mail-citation-hook))
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1667 (mh-yank-hooks ;old hook name
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1668 (run-hooks 'mh-yank-hooks))
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1669 (t
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1670 (or (bolp) (forward-line 1))
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1671 (while (< (point) (point-max))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1672 (insert mh-ins-string)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1673 (forward-line 1))
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1674 (goto-char (point-min))))) ;leave point like sc-cite-original
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1675
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1676 (defun mh-fully-kill-draft ()
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1677 "Kill the draft message file and the draft message buffer.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1678 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
1679 (interactive)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1680 (if (y-or-n-p "Kill draft message? ")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1681 (let ((config mh-previous-window-config))
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1682 (if (file-exists-p buffer-file-name)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1683 (delete-file buffer-file-name))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1684 (set-buffer-modified-p nil)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1685 (kill-buffer (buffer-name))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1686 (message "")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1687 (if config
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1688 (set-window-configuration config)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1689 (error "Message not killed")))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1690
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1691 (defun mh-current-fill-prefix ()
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1692 "Return the `fill-prefix' on the current line as a string."
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1693 (save-excursion
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1694 (beginning-of-line)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1695 ;; This assumes that the major-mode sets up adaptive-fill-regexp
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1696 ;; correctly such as mh-letter-mode or sendmail.el's mail-mode. But
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1697 ;; perhaps I should use the variable and simply inserts its value here,
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1698 ;; and set it locally in a let scope. --psg
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1699 (if (re-search-forward adaptive-fill-regexp nil t)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1700 (match-string 0)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1701 "")))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1702
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1703 (defun mh-open-line ()
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1704 "Insert a newline and leave point after it.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1705 In addition, insert newline and quoting characters before text after point.
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1706 This is useful in breaking up paragraphs in replies."
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1707 (interactive)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1708 (let ((column (current-column))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1709 (prefix (mh-current-fill-prefix)))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1710 (if (> (length prefix) column)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1711 (message "Sorry, point seems to be within the line prefix")
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1712 (newline 2)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1713 (insert prefix)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1714 (while (> column (current-column))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1715 (insert " "))
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1716 (forward-line -1))))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1717
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1718 ;;; Build the letter-mode keymap:
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1719 ;;; If this changes, modify mh-letter-mode-help-messages accordingly, above.
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1720 (gnus-define-keys mh-letter-mode-map
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1721 "\C-c?" mh-help
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1722 "\C-c\C-c" mh-send-letter
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1723 "\C-c\C-e" mh-edit-mhn
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1724 "\C-c\C-f\C-b" mh-to-field
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1725 "\C-c\C-f\C-c" mh-to-field
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1726 "\C-c\C-f\C-d" mh-to-field
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1727 "\C-c\C-f\C-f" mh-to-fcc
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1728 "\C-c\C-f\C-r" mh-to-field
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1729 "\C-c\C-f\C-s" mh-to-field
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1730 "\C-c\C-f\C-t" mh-to-field
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1731 "\C-c\C-fb" mh-to-field
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1732 "\C-c\C-fc" mh-to-field
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1733 "\C-c\C-fd" mh-to-field
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1734 "\C-c\C-ff" mh-to-fcc
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1735 "\C-c\C-fr" mh-to-field
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1736 "\C-c\C-fs" mh-to-field
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1737 "\C-c\C-ft" mh-to-field
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1738 "\C-c\C-i" mh-insert-letter
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1739 "\C-c\C-m\C-e" mh-mml-secure-message-encrypt-pgpmime
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1740 "\C-c\C-m\C-f" mh-compose-forward
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1741 "\C-c\C-m\C-i" mh-compose-insertion
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1742 "\C-c\C-m\C-m" mh-mml-to-mime
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1743 "\C-c\C-m\C-s" mh-mml-secure-message-sign-pgpmime
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1744 "\C-c\C-m\C-u" mh-revert-mhn-edit
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1745 "\C-c\C-me" mh-mml-secure-message-encrypt-pgpmime
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1746 "\C-c\C-mf" mh-compose-forward
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1747 "\C-c\C-mi" mh-compose-insertion
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1748 "\C-c\C-mm" mh-mml-to-mime
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1749 "\C-c\C-ms" mh-mml-secure-message-sign-pgpmime
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1750 "\C-c\C-mu" mh-revert-mhn-edit
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1751 "\C-c\C-o" mh-open-line
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1752 "\C-c\C-q" mh-fully-kill-draft
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1753 "\C-c\C-\\" mh-fully-kill-draft ;if no C-q
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1754 "\C-c\C-s" mh-insert-signature
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1755 "\C-c\C-^" mh-insert-signature ;if no C-s
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1756 "\C-c\C-w" mh-check-whom
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1757 "\C-c\C-y" mh-yank-cur-msg)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1758
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1759 ;; "C-c /" prefix is used in mh-letter-mode by pgp.el and mailcrypt.el.
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1760
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1761 (defun mh-customize ()
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1762 "Customize MH-E variables."
47730
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1763 (interactive)
2568d5a27317 Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents: 42205
diff changeset
1764 (customize-group 'mh))
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 10875
diff changeset
1765
48595
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1766 (provide 'mh-comp)
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1767
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1768 ;;; Local Variables:
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1769 ;;; sentence-end-double-space: nil
8aaba207e44b Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents: 47730
diff changeset
1770 ;;; End:
38414
67b464da13ec Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 35975
diff changeset
1771
67b464da13ec Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 35975
diff changeset
1772 ;;; mh-comp.el ends here