Mercurial > emacs
annotate lisp/mh-e/mh-comp.el @ 88344:a66359380d2d
(rmail-perm-variables) fix spello in preveious commit
author | Henrik Enberg <henrik.enberg@telia.com> |
---|---|
date | Fri, 27 Apr 2007 20:00:56 +0000 |
parents | d7ddb3e565de |
children |
rev | line source |
---|---|
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1 ;;; mh-comp.el --- MH-E functions for composing messages |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
2 |
88155 | 3 ;; Copyright (C) 1993, 1995, 1997, |
4 ;; 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
5 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
6 ;; Author: Bill Wohler <wohler@newt.com> |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
7 ;; Maintainer: Bill Wohler <wohler@newt.com> |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
8 ;; Keywords: mail |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
9 ;; See: mh-e.el |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
10 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
11 ;; This file is part of GNU Emacs. |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
12 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
13 ;; GNU Emacs is free software; you can redistribute it and/or modify |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
14 ;; it under the terms of the GNU General Public License as published by |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
15 ;; the Free Software Foundation; either version 2, or (at your option) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
16 ;; any later version. |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
17 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
18 ;; GNU Emacs is distributed in the hope that it will be useful, |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
21 ;; GNU General Public License for more details. |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
22 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
23 ;; You should have received a copy of the GNU General Public License |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
24 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
88155 | 25 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
26 ;; Boston, MA 02110-1301, USA. | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
27 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
28 ;;; Commentary: |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
29 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
30 ;; Internal support for MH-E package. |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
31 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
32 ;;; Change Log: |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
33 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
34 ;;; Code: |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
35 |
88155 | 36 ;;(message "> mh-comp") |
37 (eval-when-compile (require 'mh-acros)) | |
38 (mh-require-cl) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
39 |
88155 | 40 (require 'easymenu) |
41 (require 'gnus-util) | |
42 (require 'mh-buffers) | |
43 (require 'mh-e) | |
44 (require 'mh-gnus) | |
45 | |
46 (eval-when (compile load eval) | |
47 (ignore-errors (require 'mailabbrev))) | |
48 ;;(message "< mh-comp") | |
49 | |
50 | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
51 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
52 ;;; Autoloads |
88155 | 53 |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
54 (autoload 'mail-mode-fill-paragraph "sendmail") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
55 (autoload 'mm-handle-displayed-p "mm-decode") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
56 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
57 (autoload 'sc-cite-original "sc" |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
58 "Workhorse citing function which performs the initial citation. |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
59 This is callable from the various mail and news readers' reply |
88155 | 60 function according to the agreed upon standard. See `sc-describe' |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
61 for more details. `sc-cite-original' does not do any yanking of the |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
62 original message but it does require a few things: |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
63 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
64 1) The reply buffer is the current buffer. |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
65 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
66 2) The original message has been yanked and inserted into the |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
67 reply buffer. |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
68 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
69 3) Verbose mail headers from the original message have been |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
70 inserted into the reply buffer directly before the text of the |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
71 original message. |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
72 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
73 4) Point is at the beginning of the verbose headers. |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
74 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
75 5) Mark is at the end of the body of text to be cited. |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
76 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
77 For Emacs 19's, the region need not be active (and typically isn't |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
78 when this function is called. Also, the hook `sc-pre-hook' is run |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
79 before, and `sc-post-hook' is run after the guts of this function.") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
80 |
88155 | 81 |
82 | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
83 ;;; Site customization (see also mh-utils.el): |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
84 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
85 (defvar mh-send-prog "send" |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
86 "Name of the MH send program. |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
87 Some sites need to change this because of a name conflict.") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
88 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
89 (defvar mh-redist-background nil |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
90 "If non-nil redist will be done in background like send. |
88155 | 91 This allows transaction log to be visible if -watch, -verbose or |
92 -snoop are used.") | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
93 |
88155 | 94 |
95 | |
96 ;;; Scan Line Formats | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
97 |
88155 | 98 (defvar mh-note-repl ?- |
99 "Messages that have been replied to are marked by this character.") | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
100 |
88155 | 101 (defvar mh-note-forw ?F |
102 "Messages that have been forwarded are marked by this character.") | |
103 | |
104 (defvar mh-note-dist ?R | |
105 "Messages that have been redistributed are marked by this character.") | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
106 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
107 (defvar mh-yank-hooks nil |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
108 "Obsolete hook for modifying a citation just inserted in the mail buffer. |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
109 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
110 Each hook function can find the citation between point and mark. |
88155 | 111 And each hook function should leave point and mark around the |
112 citation text as modified. | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
113 |
88155 | 114 This is a normal hook, misnamed for historical reasons. It is |
115 semi-obsolete and is only used if `mail-citation-hook' is nil.") | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
116 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
117 (defvar mh-comp-formfile "components" |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
118 "Name of file to be used as a skeleton for composing messages. |
88155 | 119 |
120 Default is \"components\". | |
121 | |
122 If not an absolute file name, the file is searched for first in the | |
123 user's MH directory, then in the system MH lib directory.") | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
124 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
125 (defvar mh-repl-formfile "replcomps" |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
126 "Name of file to be used as a skeleton for replying to messages. |
88155 | 127 |
128 Default is \"replcomps\". | |
129 | |
130 If not an absolute file name, the file is searched for first in the | |
131 user's MH directory, then in the system MH lib directory.") | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
132 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
133 (defvar mh-repl-group-formfile "replgroupcomps" |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
134 "Name of file to be used as a skeleton for replying to messages. |
88155 | 135 |
136 Default is \"replgroupcomps\". | |
137 | |
138 This file is used to form replies to the sender and all recipients of | |
139 a message. Only used if `(mh-variant-p 'nmh)' is non-nil. | |
140 If not an absolute file name, the file is searched for first in the | |
141 user's MH directory, then in the system MH lib directory.") | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
142 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
143 (defvar mh-rejected-letter-start |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
144 (format "^%s$" |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
145 (regexp-opt |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
146 '("Content-Type: message/rfc822" ;MIME MDN |
88155 | 147 "------ This is a copy of the message, including all the headers. ------";from exim |
148 "--- Below this line is a copy of the message."; from qmail | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
149 " ----- Unsent message follows -----" ;from sendmail V5 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
150 " --------Unsent Message below:" ; from sendmail at BU |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
151 " ----- Original message follows -----" ;from sendmail V8 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
152 "------- Unsent Draft" ;from MH itself |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
153 "---------- Original Message ----------" ;from zmailer |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
154 " --- The unsent message follows ---" ;from AIX mail system |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
155 " Your message follows:" ;from MMDF-II |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
156 "Content-Description: Returned Content" ;1993 KJ sendmail |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
157 )))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
158 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
159 (defvar mh-new-draft-cleaned-headers |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
160 "^Date:\\|^Received:\\|^Message-Id:\\|^From:\\|^Sender:\\|^Errors-To:\\|^Delivery-Date:\\|^Return-Path:" |
88155 | 161 "Regexp of header lines to remove before offering a message as a new draft\\<mh-folder-mode-map>. |
162 Used by the \\[mh-edit-again] and \\[mh-extract-rejected-mail] commands.") | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
163 |
88155 | 164 (defvar mh-to-field-choices '(("a" . "Mail-Reply-To:") |
165 ("b" . "Bcc:") | |
166 ("c" . "Cc:") | |
167 ("d" . "Dcc:") | |
168 ("f" . "Fcc:") | |
169 ("l" . "Mail-Followup-To:") | |
170 ("m" . "From:") | |
171 ("r" . "Reply-To:") | |
172 ("s" . "Subject:") | |
173 ("t" . "To:")) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
174 "Alist of (final-character . field-name) choices for `mh-to-field'.") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
175 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
176 (defvar mh-letter-mode-map (copy-keymap text-mode-map) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
177 "Keymap for composing mail.") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
178 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
179 (defvar mh-letter-mode-syntax-table nil |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
180 "Syntax table used by MH-E while in MH-Letter mode.") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
181 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
182 (if mh-letter-mode-syntax-table |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
183 () |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
184 (setq mh-letter-mode-syntax-table |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
185 (make-syntax-table text-mode-syntax-table)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
186 (modify-syntax-entry ?% "." mh-letter-mode-syntax-table)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
187 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
188 (defvar mh-sent-from-folder nil |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
189 "Folder of msg assoc with this letter.") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
190 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
191 (defvar mh-sent-from-msg nil |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
192 "Number of msg assoc with this letter.") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
193 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
194 (defvar mh-send-args nil |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
195 "Extra args to pass to \"send\" command.") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
196 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
197 (defvar mh-annotate-char nil |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
198 "Character to use to annotate `mh-sent-from-msg'.") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
199 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
200 (defvar mh-annotate-field nil |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
201 "Field name for message annotation.") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
202 |
88155 | 203 (defvar mh-insert-auto-fields-done-local nil |
204 "Buffer-local variable set when `mh-insert-auto-fields' called successfully.") | |
205 (make-variable-buffer-local 'mh-insert-auto-fields-done-local) | |
206 | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
207 ;;;###autoload |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
208 (defun mh-smail () |
88155 | 209 "Compose a message with the MH mail system. |
210 See `mh-send' for more details on composing mail." | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
211 (interactive) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
212 (mh-find-path) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
213 (call-interactively 'mh-send)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
214 |
88155 | 215 ;;;###autoload |
216 (defun mh-smail-other-window () | |
217 "Compose a message with the MH mail system in other window. | |
218 See `mh-send' for more details on composing mail." | |
219 (interactive) | |
220 (mh-find-path) | |
221 (call-interactively 'mh-send-other-window)) | |
222 | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
223 (defvar mh-error-if-no-draft nil) ;raise error over using old draft |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
224 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
225 ;;;###autoload |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
226 (defun mh-smail-batch (&optional to subject other-headers &rest ignored) |
88155 | 227 "Compose a message with the MH mail system. |
228 | |
229 This function does not prompt the user for any header fields, and | |
230 thus is suitable for use by programs that want to create a mail | |
231 buffer. Users should use \\[mh-smail] to compose mail. | |
232 | |
233 Optional arguments for setting certain fields include TO, | |
234 SUBJECT, and OTHER-HEADERS. Additional arguments are IGNORED. | |
235 | |
236 This function remains for Emacs 21 compatibility. New | |
237 applications should use `mh-user-agent-compose'." | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
238 (mh-find-path) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
239 (let ((mh-error-if-no-draft t)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
240 (mh-send (or to "") "" (or subject "")))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
241 |
88155 | 242 ;;;###autoload |
243 (define-mail-user-agent 'mh-e-user-agent | |
244 'mh-user-agent-compose 'mh-send-letter 'mh-fully-kill-draft | |
245 'mh-before-send-letter-hook) | |
246 | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
247 ;;;###autoload |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
248 (defun mh-user-agent-compose (&optional to subject other-headers continue |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
249 switch-function yank-action |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
250 send-actions) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
251 "Set up mail composition draft with the MH mail system. |
88155 | 252 This is the `mail-user-agent' entry point to MH-E. This function |
253 conforms to the contract specified by `define-mail-user-agent' | |
254 which means that this function should accept the same arguments | |
255 as `compose-mail'. | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
256 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
257 The optional arguments TO and SUBJECT specify recipients and the |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
258 initial Subject field, respectively. |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
259 |
88155 | 260 OTHER-HEADERS is an alist specifying additional header fields. |
261 Elements look like (HEADER . VALUE) where both HEADER and VALUE | |
262 are strings. | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
263 |
88155 | 264 CONTINUE, SWITCH-FUNCTION, YANK-ACTION and SEND-ACTIONS are |
265 ignored." | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
266 (mh-find-path) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
267 (let ((mh-error-if-no-draft t)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
268 (mh-send to "" subject) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
269 (while other-headers |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
270 (mh-insert-fields (concat (car (car other-headers)) ":") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
271 (cdr (car other-headers))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
272 (setq other-headers (cdr other-headers))))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
273 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
274 ;;;###mh-autoload |
88155 | 275 (defun mh-edit-again (message) |
276 "Edit a MESSAGE to send it again. | |
277 | |
278 If you don't complete a draft for one reason or another, and if | |
279 the draft buffer is no longer available, you can pick your draft | |
280 up again with this command. If you don't use a draft folder, your | |
281 last \"draft\" file will be used. If you use draft folders, | |
282 you'll need to visit the draft folder with \"\\[mh-visit-folder] | |
283 drafts <RET>\", use \\[mh-next-undeleted-msg] to move to the | |
284 appropriate message, and then use \\[mh-edit-again] to prepare | |
285 the message for editing. | |
286 | |
287 This command can also be used to take messages that were sent to | |
288 you and to send them to more people. | |
289 | |
290 Don't use this command to re-edit a message from a Mailer-Daemon | |
291 who complained that your mail wasn't posted for some reason or | |
292 another (see `mh-extract-rejected-mail'). | |
293 | |
294 The default message is the current message. | |
295 | |
296 See also `mh-send'." | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
297 (interactive (list (mh-get-msg-num t))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
298 (let* ((from-folder mh-current-folder) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
299 (config (current-window-configuration)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
300 (draft |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
301 (cond ((and mh-draft-folder (equal from-folder mh-draft-folder)) |
88155 | 302 (pop-to-buffer (find-file-noselect (mh-msg-filename message)) |
303 t) | |
304 (rename-buffer (format "draft-%d" message)) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
305 ;; Make buffer writable... |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
306 (setq buffer-read-only nil) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
307 ;; If buffer was being used to display the message reinsert |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
308 ;; from file... |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
309 (when (eq major-mode 'mh-show-mode) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
310 (erase-buffer) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
311 (insert-file-contents buffer-file-name)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
312 (buffer-name)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
313 (t |
88155 | 314 (mh-read-draft "clean-up" (mh-msg-filename message) nil))))) |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
315 (mh-clean-msg-header (point-min) mh-new-draft-cleaned-headers nil) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
316 (mh-insert-header-separator) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
317 (goto-char (point-min)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
318 (save-buffer) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
319 (mh-compose-and-send-mail draft "" from-folder nil nil nil nil nil nil |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
320 config) |
88155 | 321 (mh-letter-mode-message) |
322 (mh-letter-adjust-point))) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
323 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
324 ;;;###mh-autoload |
88155 | 325 (defun mh-extract-rejected-mail (message) |
326 "Edit a MESSAGE that was returned by the mail system. | |
327 | |
328 This command prepares the message for editing by removing the | |
329 Mailer-Daemon envelope and unneeded header fields. Fix whatever | |
330 addressing problem you had, and send the message again with | |
331 \\[mh-send-letter]. | |
332 | |
333 The default message is the current message. | |
334 | |
335 See also `mh-send'." | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
336 (interactive (list (mh-get-msg-num t))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
337 (let ((from-folder mh-current-folder) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
338 (config (current-window-configuration)) |
88155 | 339 (draft (mh-read-draft "extraction" (mh-msg-filename message) nil))) |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
340 (goto-char (point-min)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
341 (cond ((re-search-forward mh-rejected-letter-start nil t) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
342 (skip-chars-forward " \t\n") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
343 (delete-region (point-min) (point)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
344 (mh-clean-msg-header (point-min) mh-new-draft-cleaned-headers nil)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
345 (t |
88155 | 346 (message "Does not appear to be a rejected letter"))) |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
347 (mh-insert-header-separator) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
348 (goto-char (point-min)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
349 (save-buffer) |
88155 | 350 (mh-compose-and-send-mail draft "" from-folder message |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
351 (mh-get-header-field "To:") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
352 (mh-get-header-field "From:") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
353 (mh-get-header-field "Cc:") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
354 nil nil config) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
355 (mh-letter-mode-message))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
356 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
357 ;;;###mh-autoload |
88155 | 358 (defun mh-forward (to cc &optional range) |
359 "Forward message. | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
360 |
88155 | 361 You are prompted for the TO and CC recipients. You are given a |
362 draft to edit that looks like it would if you had run the MH | |
363 command \"forw\". You can then add some text. | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
364 |
88155 | 365 You can forward several messages by using a RANGE. All of the |
366 messages in the range are inserted into your draft. Check the | |
367 documentation of `mh-interactive-range' to see how RANGE is read | |
368 in interactive use. | |
369 | |
370 The hook `mh-forward-hook' is called on the draft. | |
371 | |
372 See also `mh-compose-forward-as-mime-flag', | |
373 `mh-forward-subject-format', and `mh-send'." | |
374 (interactive (list (mh-interactive-read-address "To: ") | |
375 (mh-interactive-read-address "Cc: ") | |
376 (mh-interactive-range "Forward"))) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
377 (let* ((folder mh-current-folder) |
88155 | 378 (msgs (mh-range-to-msg-list range)) |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
379 (config (current-window-configuration)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
380 (fwd-msg-file (mh-msg-filename (car msgs) folder)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
381 ;; forw always leaves file in "draft" since it doesn't have -draft |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
382 (draft-name (expand-file-name "draft" mh-user-path)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
383 (draft (cond ((or (not (file-exists-p draft-name)) |
88155 | 384 (y-or-n-p "The file draft exists; discard it? ")) |
385 (mh-exec-cmd "forw" "-build" | |
386 (if (and (mh-variant-p 'nmh) | |
387 mh-compose-forward-as-mime-flag) | |
388 "-mime") | |
389 mh-current-folder | |
390 (mh-coalesce-msg-list msgs)) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
391 (prog1 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
392 (mh-read-draft "" draft-name t) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
393 (mh-insert-fields "To:" to "Cc:" cc) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
394 (save-buffer))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
395 (t |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
396 (mh-read-draft "" draft-name nil))))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
397 (let (orig-from |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
398 orig-subject) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
399 (save-excursion |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
400 (set-buffer (get-buffer-create mh-temp-buffer)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
401 (erase-buffer) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
402 (insert-file-contents fwd-msg-file) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
403 (setq orig-from (mh-get-header-field "From:")) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
404 (setq orig-subject (mh-get-header-field "Subject:"))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
405 (let ((forw-subject |
88155 | 406 (mh-forwarded-letter-subject orig-from orig-subject))) |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
407 (mh-insert-fields "Subject:" forw-subject) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
408 (goto-char (point-min)) |
88155 | 409 ;; If using MML, translate MH-style directive |
410 (if (equal mh-compose-insertion 'mml) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
411 (save-excursion |
88155 | 412 (goto-char (mh-mail-header-end)) |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
413 (while |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
414 (re-search-forward |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
415 "^#forw \\[\\([^]]+\\)\\] \\(+\\S-+\\) \\(.*\\)$" |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
416 (point-max) t) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
417 (let ((description (if (equal (match-string 1) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
418 "forwarded messages") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
419 "forwarded message %d" |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
420 (match-string 1))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
421 (msgs (split-string (match-string 3))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
422 (i 0)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
423 (beginning-of-line) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
424 (delete-region (point) (progn (forward-line 1) (point))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
425 (dolist (msg msgs) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
426 (setq i (1+ i)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
427 (mh-mml-forward-message (format description i) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
428 folder msg)))))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
429 ;; Postition just before forwarded message |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
430 (if (re-search-forward "^------- Forwarded Message" nil t) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
431 (forward-line -1) |
88155 | 432 (goto-char (mh-mail-header-end)) |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
433 (forward-line 1)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
434 (delete-other-windows) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
435 (mh-add-msgs-to-seq msgs 'forwarded t) |
88155 | 436 (mh-compose-and-send-mail draft "" folder msgs |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
437 to forw-subject cc |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
438 mh-note-forw "Forwarded:" |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
439 config) |
88155 | 440 (mh-letter-mode-message) |
441 (mh-letter-adjust-point) | |
442 (run-hooks 'mh-forward-hook))))) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
443 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
444 (defun mh-forwarded-letter-subject (from subject) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
445 "Return a Subject suitable for a forwarded message. |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
446 Original message has headers FROM and SUBJECT." |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
447 (let ((addr-start (string-match "<" from)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
448 (comment (string-match "(" from))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
449 (cond ((and addr-start (> addr-start 0)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
450 ;; Full Name <luser@host> |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
451 (setq from (substring from 0 (1- addr-start)))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
452 (comment |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
453 ;; luser@host (Full Name) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
454 (setq from (substring from (1+ comment) (1- (length from))))))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
455 (format mh-forward-subject-format from subject)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
456 |
88155 | 457 ;;;###mh-autoload |
458 (defun mh-redistribute (to cc &optional message) | |
459 "Redistribute a message. | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
460 |
88155 | 461 This command is similar in function to forwarding mail, but it |
462 does not allow you to edit the message, nor does it add your name | |
463 to the \"From\" header field. It appears to the recipient as if | |
464 the message had come from the original sender. When you run this | |
465 command, you are prompted for the TO and CC recipients. The | |
466 default MESSAGE is the current message. | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
467 |
88155 | 468 Also investigate the command \\[mh-edit-again] for another way to |
469 redistribute messages. | |
470 | |
471 See also `mh-redist-full-contents-flag'." | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
472 (interactive (list (mh-read-address "Redist-To: ") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
473 (mh-read-address "Redist-Cc: ") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
474 (mh-get-msg-num t))) |
88155 | 475 (or message |
476 (setq message (mh-get-msg-num t))) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
477 (save-window-excursion |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
478 (let ((folder mh-current-folder) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
479 (draft (mh-read-draft "redistribution" |
88155 | 480 (if mh-redist-full-contents-flag |
481 (mh-msg-filename message) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
482 nil) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
483 nil))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
484 (mh-goto-header-end 0) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
485 (insert "Resent-To: " to "\n") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
486 (if (not (equal cc "")) (insert "Resent-cc: " cc "\n")) |
88155 | 487 (mh-clean-msg-header |
488 (point-min) | |
489 "^Message-Id:\\|^Received:\\|^Return-Path:\\|^Sender:\\|^Date:\\|^From:" | |
490 nil) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
491 (save-buffer) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
492 (message "Redistributing...") |
88155 | 493 (let ((env "mhdist=1")) |
494 ;; Setup environment... | |
495 (setq env (concat env " mhaltmsg=" | |
496 (if mh-redist-full-contents-flag | |
497 buffer-file-name | |
498 (mh-msg-filename message folder)))) | |
499 (unless mh-redist-full-contents-flag | |
500 (setq env (concat env " mhannotate=1"))) | |
501 ;; Redistribute... | |
502 (if mh-redist-background | |
503 (mh-exec-cmd-env-daemon env mh-send-prog nil buffer-file-name) | |
504 (mh-exec-cmd-error env mh-send-prog "-push" buffer-file-name)) | |
505 ;; Annotate... | |
506 (mh-annotate-msg message folder mh-note-dist | |
507 "-component" "Resent:" | |
508 "-text" (format "\"%s %s\"" to cc))) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
509 (kill-buffer draft) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
510 (message "Redistributing...done")))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
511 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
512 (defun mh-show-buffer-message-number (&optional buffer) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
513 "Message number of displayed message in corresponding show buffer. |
88155 | 514 |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
515 Return nil if show buffer not displayed. |
88155 | 516 If in `mh-letter-mode', don't display the message number being replied |
517 to, but rather the message number of the show buffer associated with | |
518 our originating folder buffer. | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
519 Optional argument BUFFER can be used to specify the buffer." |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
520 (save-excursion |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
521 (if buffer |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
522 (set-buffer buffer)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
523 (cond ((eq major-mode 'mh-show-mode) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
524 (let ((number-start (mh-search-from-end ?/ buffer-file-name))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
525 (car (read-from-string (substring buffer-file-name |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
526 (1+ number-start)))))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
527 ((and (eq major-mode 'mh-folder-mode) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
528 mh-show-buffer |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
529 (get-buffer mh-show-buffer)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
530 (mh-show-buffer-message-number mh-show-buffer)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
531 ((and (eq major-mode 'mh-letter-mode) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
532 mh-sent-from-folder |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
533 (get-buffer mh-sent-from-folder)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
534 (mh-show-buffer-message-number mh-sent-from-folder)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
535 (t |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
536 nil)))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
537 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
538 ;;;###mh-autoload |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
539 (defun mh-reply (message &optional reply-to includep) |
88155 | 540 "Reply to a MESSAGE. |
541 | |
542 When you reply to a message, you are first prompted with \"Reply | |
543 to whom?\" (unless the optional argument REPLY-TO is provided). | |
544 You have several choices here. | |
545 | |
546 Response Reply Goes To | |
547 | |
548 from The person who sent the message. This is the | |
549 default, so <RET> is sufficient. | |
550 | |
551 to Replies to the sender, plus all recipients in the | |
552 \"To:\" header field. | |
553 | |
554 all | |
555 cc Forms a reply to the sender, plus all recipients. | |
556 | |
557 Depending on your answer, \"repl\" is given a different argument | |
558 to form your reply. Specifically, a choice of \"from\" or none at | |
559 all runs \"repl -nocc all\", and a choice of \"to\" runs \"repl | |
560 -cc to\". Finally, either \"cc\" or \"all\" runs \"repl -cc all | |
561 -nocc me\". | |
562 | |
563 Two windows are then created. One window contains the message to | |
564 which you are replying in an MH-Show buffer. Your draft, in | |
565 MH-Letter mode (see `mh-letter-mode'), is in the other window. | |
566 | |
567 If you supply a prefix argument INCLUDEP, the message you are | |
568 replying to is inserted in your reply after having first been run | |
569 through \"mhl\" with the format file \"mhl.reply\". | |
570 | |
571 Alternatively, you can customize the option `mh-yank-behavior' | |
572 and choose one of its \"Automatically\" variants to do the same | |
573 thing. If you do so, the prefix argument has no effect. | |
574 | |
575 Another way to include the message automatically in your draft is | |
576 to use \"repl: -filter repl.filter\" in your MH profile. | |
577 | |
578 If you wish to customize the header or other parts of the reply | |
579 draft, please see \"repl\" and \"mh-format\". | |
580 | |
581 See also `mh-reply-show-message-flag', | |
582 `mh-reply-default-reply-to', and `mh-send'." | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
583 (interactive (list |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
584 (mh-get-msg-num t) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
585 (let ((minibuffer-help-form |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
586 "from => Sender only\nto => Sender and primary recipients\ncc or all => Sender and all recipients")) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
587 (or mh-reply-default-reply-to |
88155 | 588 (completing-read "Reply to whom (default from): " |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
589 '(("from") ("to") ("cc") ("all")) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
590 nil |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
591 t))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
592 current-prefix-arg)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
593 (let* ((folder mh-current-folder) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
594 (show-buffer mh-show-buffer) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
595 (config (current-window-configuration)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
596 (group-reply (or (equal reply-to "cc") (equal reply-to "all"))) |
88155 | 597 (form-file (cond ((and (mh-variant-p 'nmh 'mu-mh) group-reply |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
598 (stringp mh-repl-group-formfile)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
599 mh-repl-group-formfile) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
600 ((stringp mh-repl-formfile) mh-repl-formfile) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
601 (t nil)))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
602 (message "Composing a reply...") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
603 (mh-exec-cmd "repl" "-build" "-noquery" "-nodraftfolder" |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
604 (if form-file |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
605 (list "-form" form-file)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
606 mh-current-folder message |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
607 (cond ((or (equal reply-to "from") (equal reply-to "")) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
608 '("-nocc" "all")) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
609 ((equal reply-to "to") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
610 '("-cc" "to")) |
88155 | 611 (group-reply (if (mh-variant-p 'nmh 'mu-mh) |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
612 '("-group" "-nocc" "me") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
613 '("-cc" "all" "-nocc" "me")))) |
88155 | 614 (cond ((or (eq mh-yank-behavior 'autosupercite) |
615 (eq mh-yank-behavior 'autoattrib)) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
616 '("-noformat")) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
617 (includep '("-filter" "mhl.reply")) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
618 (t '()))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
619 (let ((draft (mh-read-draft "reply" |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
620 (expand-file-name "reply" mh-user-path) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
621 t))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
622 (delete-other-windows) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
623 (save-buffer) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49578
diff
changeset
|
624 |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
625 (let ((to (mh-get-header-field "To:")) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
626 (subject (mh-get-header-field "Subject:")) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
627 (cc (mh-get-header-field "Cc:"))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
628 (goto-char (point-min)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
629 (mh-goto-header-end 1) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
630 (or includep |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
631 (not mh-reply-show-message-flag) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
632 (mh-in-show-buffer (show-buffer) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
633 (mh-display-msg message folder))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
634 (mh-add-msgs-to-seq message 'answered t) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
635 (message "Composing a reply...done") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
636 (mh-compose-and-send-mail draft "" folder message to subject cc |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
637 mh-note-repl "Replied:" config)) |
88155 | 638 (when (and (or (eq 'autosupercite mh-yank-behavior) |
639 (eq 'autoattrib mh-yank-behavior)) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
640 (eq (mh-show-buffer-message-number) mh-sent-from-msg)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
641 (undo-boundary) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
642 (mh-yank-cur-msg)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
643 (mh-letter-mode-message)))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
644 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
645 ;;;###mh-autoload |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
646 (defun mh-send (to cc subject) |
88155 | 647 "Compose a message. |
648 | |
649 Your letter appears in an Emacs buffer whose mode is | |
650 MH-Letter (see `mh-letter-mode'). | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
651 |
88155 | 652 The arguments TO, CC, and SUBJECT can be used to prefill the |
653 draft fields or suppress the prompts if `mh-compose-prompt-flag' | |
654 is on. They are also passed to the function set in the option | |
655 `mh-compose-letter-function'. | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
656 |
88155 | 657 See also `mh-insert-x-mailer-flag' and `mh-letter-mode-hook'. |
658 | |
659 Outside of an MH-Folder buffer (`mh-folder-mode'), you must call | |
660 either \\[mh-smail] or \\[mh-smail-other-window] to compose a new | |
661 message." | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
662 (interactive (list |
88155 | 663 (mh-interactive-read-address "To: ") |
664 (mh-interactive-read-address "Cc: ") | |
665 (mh-interactive-read-string "Subject: "))) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
666 (let ((config (current-window-configuration))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
667 (delete-other-windows) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
668 (mh-send-sub to cc subject config))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
669 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
670 ;;;###mh-autoload |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
671 (defun mh-send-other-window (to cc subject) |
88155 | 672 "Compose a message in another window. |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
673 |
88155 | 674 See `mh-send' for more information and a description of how the |
675 TO, CC, and SUBJECT arguments are used." | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
676 (interactive (list |
88155 | 677 (mh-interactive-read-address "To: ") |
678 (mh-interactive-read-address "Cc: ") | |
679 (mh-interactive-read-string "Subject: "))) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
680 (let ((pop-up-windows t)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
681 (mh-send-sub to cc subject (current-window-configuration)))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
682 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
683 (defun mh-send-sub (to cc subject config) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
684 "Do the real work of composing and sending a letter. |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
685 Expects the TO, CC, and SUBJECT fields as arguments. |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
686 CONFIG is the window configuration before sending mail." |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
687 (let ((folder mh-current-folder) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
688 (msg-num (mh-get-msg-num nil))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
689 (message "Composing a message...") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
690 (let ((draft (mh-read-draft |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
691 "message" |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
692 (let (components) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
693 (cond |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
694 ((file-exists-p |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
695 (setq components |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
696 (expand-file-name mh-comp-formfile mh-user-path))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
697 components) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
698 ((file-exists-p |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
699 (setq components |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
700 (expand-file-name mh-comp-formfile mh-lib))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
701 components) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
702 ((file-exists-p |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
703 (setq components |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
704 (expand-file-name mh-comp-formfile |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
705 ;; What is this mh-etc ?? -sm |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
706 ;; This is dead code, so |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
707 ;; remove it. |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
708 ;(and (boundp 'mh-etc) mh-etc) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
709 ))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
710 components) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
711 (t |
88155 | 712 (error "Can't find components file \"%s\"" |
713 components)))) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
714 nil))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
715 (mh-insert-fields "To:" to "Subject:" subject "Cc:" cc) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
716 (goto-char (point-max)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
717 (mh-compose-and-send-mail draft "" folder msg-num |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
718 to subject cc |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
719 nil nil config) |
88155 | 720 (mh-letter-mode-message) |
721 (mh-letter-adjust-point)))) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
722 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
723 (defun mh-read-draft (use initial-contents delete-contents-file) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
724 "Read draft file into a draft buffer and make that buffer the current one. |
88155 | 725 |
726 USE is a message used for prompting about the intended use of the | |
727 message. | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
728 INITIAL-CONTENTS is filename that is read into an empty buffer, or nil |
88155 | 729 if buffer should not be modified. Delete the initial-contents file if |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
730 DELETE-CONTENTS-FILE flag is set. |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
731 Returns the draft folder's name. |
88155 | 732 If the draft folder facility is enabled in ~/.mh_profile, a new buffer |
733 is used each time and saved in the draft folder. The draft file can | |
734 then be reused." | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
735 (cond (mh-draft-folder |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
736 (let ((orig-default-dir default-directory) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
737 (draft-file-name (mh-new-draft-name))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
738 (pop-to-buffer (generate-new-buffer |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
739 (format "draft-%s" |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
740 (file-name-nondirectory draft-file-name)))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
741 (condition-case () |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
742 (insert-file-contents draft-file-name t) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
743 (file-error)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
744 (setq default-directory orig-default-dir))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
745 (t |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
746 (let ((draft-name (expand-file-name "draft" mh-user-path))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
747 (pop-to-buffer "draft") ; Create if necessary |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
748 (if (buffer-modified-p) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
749 (if (y-or-n-p "Draft has been modified; kill anyway? ") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
750 (set-buffer-modified-p nil) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
751 (error "Draft preserved"))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
752 (setq buffer-file-name draft-name) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
753 (clear-visited-file-modtime) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
754 (unlock-buffer) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
755 (cond ((and (file-exists-p draft-name) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
756 (not (equal draft-name initial-contents))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
757 (insert-file-contents draft-name) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
758 (delete-file draft-name)))))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
759 (cond ((and initial-contents |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
760 (or (zerop (buffer-size)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
761 (if (y-or-n-p |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
762 (format "A draft exists. Use for %s? " use)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
763 (if mh-error-if-no-draft |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
764 (error "A prior draft exists")) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
765 t))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
766 (erase-buffer) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
767 (insert-file-contents initial-contents) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
768 (if delete-contents-file (delete-file initial-contents)))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
769 (auto-save-mode 1) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
770 (if mh-draft-folder |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
771 (save-buffer)) ; Do not reuse draft name |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
772 (buffer-name)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
773 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
774 (defun mh-new-draft-name () |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
775 "Return the pathname of folder for draft messages." |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
776 (save-excursion |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
777 (mh-exec-cmd-quiet t "mhpath" mh-draft-folder "new") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
778 (buffer-substring (point-min) (1- (point-max))))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
779 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
780 (defun mh-annotate-msg (msg buffer note &rest args) |
88155 | 781 "Mark MSG in BUFFER with character NOTE and annotate message with ARGS. |
782 MSG can be a message number, a list of message numbers, or a | |
783 sequence." | |
784 (apply 'mh-exec-cmd "anno" buffer | |
785 (if (listp msg) (append msg args) (cons msg args))) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
786 (save-excursion |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
787 (cond ((get-buffer buffer) ; Buffer may be deleted |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
788 (set-buffer buffer) |
88155 | 789 (mh-iterate-on-range nil msg |
790 (mh-notate nil note | |
791 (+ mh-cmd-note mh-scan-field-destination-offset))))))) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
792 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
793 (defun mh-insert-fields (&rest name-values) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
794 "Insert the NAME-VALUES pairs in the current buffer. |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
795 If the field exists, append the value to it. |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
796 Do not insert any pairs whose value is the empty string." |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
797 (let ((case-fold-search t)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
798 (while name-values |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
799 (let ((field-name (car name-values)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
800 (value (car (cdr name-values)))) |
88155 | 801 (if (not (string-match "^.*:$" field-name)) |
802 (setq field-name (concat field-name ":"))) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
803 (cond ((equal value "") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
804 nil) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
805 ((mh-position-on-field field-name) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
806 (insert " " (or value ""))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
807 (t |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
808 (insert field-name " " value "\n"))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
809 (setq name-values (cdr (cdr name-values))))))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
810 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
811 (defun mh-position-on-field (field &optional ignored) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
812 "Move to the end of the FIELD in the header. |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
813 Move to end of entire header if FIELD not found. |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
814 Returns non-nil iff FIELD was found. |
88155 | 815 The optional second arg is for pre-version 4 compatibility and is |
816 IGNORED." | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
817 (cond ((mh-goto-header-field field) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
818 (mh-header-field-end) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
819 t) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
820 ((mh-goto-header-end 0) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
821 nil))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
822 |
88155 | 823 ;;;###mh-autoload |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
824 (defun mh-get-header-field (field) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
825 "Find and return the body of FIELD in the mail header. |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
826 Returns the empty string if the field is not in the header of the |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
827 current buffer." |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
828 (if (mh-goto-header-field field) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
829 (progn |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
830 (skip-chars-forward " \t") ;strip leading white space in body |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
831 (let ((start (point))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
832 (mh-header-field-end) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
833 (buffer-substring-no-properties start (point)))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
834 "")) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
835 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
836 (fset 'mh-get-field 'mh-get-header-field) ;MH-E 4 compatibility |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
837 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
838 (defun mh-goto-header-field (field) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
839 "Move to FIELD in the message header. |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
840 Move to the end of the FIELD name, which should end in a colon. |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
841 Returns t if found, nil if not." |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
842 (goto-char (point-min)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
843 (let ((case-fold-search t) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
844 (headers-end (save-excursion |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
845 (mh-goto-header-end 0) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
846 (point)))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
847 (re-search-forward (format "^%s" field) headers-end t))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
848 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
849 (defun mh-goto-header-end (arg) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
850 "Move the cursor ARG lines after the header." |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
851 (if (re-search-forward "^-*$" nil nil) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
852 (forward-line arg))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
853 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
854 (defun mh-extract-from-header-value () |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
855 "Extract From: string from header." |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
856 (save-excursion |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
857 (if (not (mh-goto-header-field "From:")) |
88155 | 858 nil |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
859 (skip-chars-forward " \t") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
860 (buffer-substring-no-properties |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
861 (point) (progn (mh-header-field-end)(point)))))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
862 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
863 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
864 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
865 ;;; Mode for composing and sending a draft message. |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
866 |
88155 | 867 (defvar mh-pgp-support-flag (not (not (locate-library "mml2015"))) |
868 "Non-nil means PGP support is available.") | |
869 | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
870 (put 'mh-letter-mode 'mode-class 'special) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
871 |
88155 | 872 ;; Menu extracted from mh-menubar.el V1.1 (31 July 2001) |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
873 (eval-when-compile (defvar mh-letter-menu nil)) |
88155 | 874 (easy-menu-define |
875 mh-letter-menu mh-letter-mode-map "Menu for MH-E letter mode." | |
876 '("Letter" | |
877 ["Send This Draft" mh-send-letter t] | |
878 ["Split Current Line" mh-open-line t] | |
879 ["Check Recipient" mh-check-whom t] | |
880 ["Yank Current Message" mh-yank-cur-msg t] | |
881 ["Insert a Message..." mh-insert-letter t] | |
882 ["Insert Signature" mh-insert-signature t] | |
883 ("Encrypt/Sign Message" | |
884 ["Sign Message" | |
885 mh-mml-secure-message-sign mh-pgp-support-flag] | |
886 ["Encrypt Message" | |
887 mh-mml-secure-message-encrypt mh-pgp-support-flag] | |
888 ["Sign+Encrypt Message" | |
889 mh-mml-secure-message-signencrypt mh-pgp-support-flag] | |
890 ["Disable Security" | |
891 mh-mml-unsecure-message mh-pgp-support-flag] | |
892 "--" | |
893 "Security Method" | |
894 ["PGP (MIME)" (setq mh-mml-method-default "pgpmime") | |
895 :style radio | |
896 :selected (equal mh-mml-method-default "pgpmime")] | |
897 ["PGP" (setq mh-mml-method-default "pgp") | |
898 :style radio | |
899 :selected (equal mh-mml-method-default "pgp")] | |
900 ["S/MIME" (setq mh-mml-method-default "smime") | |
901 :style radio | |
902 :selected (equal mh-mml-method-default "smime")] | |
903 "--" | |
904 ["Save Method as Default" | |
905 (customize-save-variable 'mh-mml-method-default mh-mml-method-default) t] | |
906 ) | |
907 ["Compose Insertion..." mh-compose-insertion t] | |
908 ["Compose Compressed tar (MH)..." | |
909 mh-mh-compose-external-compressed-tar t] | |
910 ["Compose Get File (MH)..." mh-mh-compose-anon-ftp t] | |
911 ["Compose Forward..." mh-compose-forward t] | |
912 ;; The next two will have to be merged. But I also need to make sure the | |
913 ;; user can't mix tags of both types. | |
914 ["Pull in All Compositions (MH)" | |
915 mh-mh-to-mime (mh-mh-directive-present-p)] | |
916 ["Pull in All Compositions (MML)" | |
917 mh-mml-to-mime (mh-mml-tag-present-p)] | |
918 ["Revert to Non-MIME Edit (MH)" | |
919 mh-mh-to-mime-undo (equal mh-compose-insertion 'mh)] | |
920 ["Kill This Draft" mh-fully-kill-draft t])) | |
921 | |
922 | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
923 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
924 ;;; Help Messages |
88155 | 925 |
926 ;; Group messages logically, more or less. | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
927 (defvar mh-letter-mode-help-messages |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
928 '((nil |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
929 "Send letter: \\[mh-send-letter]" |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
930 "\t\tOpen line: \\[mh-open-line]\n" |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
931 "Kill letter: \\[mh-fully-kill-draft]" |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
932 "\t\tInsert:\n" |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
933 "Check recipients: \\[mh-check-whom]" |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
934 "\t\t Current message: \\[mh-yank-cur-msg]\n" |
88155 | 935 "\t\t Attachment: \\[mh-compose-insertion]\n" |
936 "\t\t Message to forward: \\[mh-compose-forward]\n" | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
937 " " |
88155 | 938 "Security:" |
939 "\t\t Encrypt message: \\[mh-mml-secure-message-encrypt]" | |
940 "\t\t Sign+Encrypt message: \\[mh-mml-secure-message-signencrypt]" | |
941 "\t\t Sign message: \\[mh-mml-secure-message-sign]\n" | |
942 " " | |
943 "\t\t Signature: \\[mh-insert-signature]")) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
944 "Key binding cheat sheet. |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
945 |
88155 | 946 This is an associative array which is used to show the most |
947 common commands. The key is a prefix char. The value is one or | |
948 more strings which are concatenated together and displayed in the | |
949 minibuffer if ? is pressed after the prefix character. The | |
950 special key nil is used to display the non-prefixed commands. | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
951 |
88155 | 952 The substitutions described in `substitute-command-keys' are |
953 performed as well.") | |
954 | |
955 ;; Shush compiler. | |
956 (eval-when-compile | |
957 (defvar adaptive-fill-first-line-regexp) | |
958 (defvar tool-bar-map)) | |
959 | |
960 (defvar mh-letter-buttons-init-flag nil) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
961 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
962 ;;;###autoload |
88155 | 963 (define-derived-mode mh-letter-mode mail-mode "MH-Letter" |
964 "Mode for composing letters in MH-E\\<mh-letter-mode-map>. | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
965 |
88155 | 966 When you have finished composing, type \\[mh-send-letter] to send |
967 the message using the MH mail handling system. | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
968 |
88155 | 969 There are two types of tags used by MH-E when composing MIME |
970 messages: MML and MH. The option `mh-compose-insertion' controls | |
971 what type of tags are inserted by MH-E commands. These tags can | |
972 be converted to MIME body parts by running \\[mh-mh-to-mime] for | |
973 MH-style directives or \\[mh-mml-to-mime] for MML tags. | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
974 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
975 Options that control this mode can be changed with |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
976 \\[customize-group]; specify the \"mh-compose\" group. |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
977 |
88155 | 978 When a message is composed, the hooks `text-mode-hook', |
979 `mail-mode-hook', and `mh-letter-mode-hook' are run (in that | |
980 order). | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
981 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
982 \\{mh-letter-mode-map}" |
88155 | 983 (mh-find-path) |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
984 (make-local-variable 'mh-send-args) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
985 (make-local-variable 'mh-annotate-char) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
986 (make-local-variable 'mh-annotate-field) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
987 (make-local-variable 'mh-previous-window-config) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
988 (make-local-variable 'mh-sent-from-folder) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
989 (make-local-variable 'mh-sent-from-msg) |
88155 | 990 (mh-do-in-gnu-emacs |
991 (unless mh-letter-buttons-init-flag | |
992 (mh-tool-bar-letter-buttons-init) | |
993 (setq mh-letter-buttons-init-flag t))) | |
994 ;; Set the local value of mh-mail-header-separator according to what is | |
995 ;; present in the buffer... | |
996 (set (make-local-variable 'mh-mail-header-separator) | |
997 (save-excursion | |
998 (goto-char (mh-mail-header-end)) | |
999 (buffer-substring-no-properties (point) (line-end-position)))) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1000 (make-local-variable 'mail-header-separator) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1001 (setq mail-header-separator mh-mail-header-separator) ;override sendmail.el |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1002 (make-local-variable 'mh-help-messages) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1003 (setq mh-help-messages mh-letter-mode-help-messages) |
88155 | 1004 (setq buffer-invisibility-spec '((vanish . t) t)) |
1005 (set (make-local-variable 'line-move-ignore-invisible) t) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1006 |
88155 | 1007 ;; Enable undo since a show-mode buffer might have been reused. |
1008 (buffer-enable-undo) | |
1009 (set (make-local-variable 'tool-bar-map) mh-letter-tool-bar-map) | |
1010 (mh-funcall-if-exists mh-tool-bar-init :letter) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1011 (make-local-variable 'font-lock-defaults) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1012 (cond |
88155 | 1013 ((or (equal mh-highlight-citation-style 'font-lock) |
1014 (equal mh-highlight-citation-style 'gnus)) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1015 ;; Let's use font-lock even if gnus is used in show-mode. The reason |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1016 ;; is that gnus uses static text properties which are not appropriate |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1017 ;; for a buffer that will be edited. So the choice here is either fontify |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1018 ;; the citations and header... |
88155 | 1019 (setq font-lock-defaults '(mh-letter-font-lock-keywords t))) |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1020 (t |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1021 ;; ...or the header only |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1022 (setq font-lock-defaults '(mh-show-font-lock-keywords t)))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1023 (easy-menu-add mh-letter-menu) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1024 (setq fill-column mh-letter-fill-column) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1025 ;; If text-mode-hook turned on auto-fill, tune it for messages |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1026 (when auto-fill-function |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1027 (make-local-variable 'auto-fill-function) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1028 (setq auto-fill-function 'mh-auto-fill-for-letter))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1029 |
88155 | 1030 (defun mh-font-lock-field-data (limit) |
1031 "Find header field region between point and LIMIT." | |
1032 (and (< (point) (mh-letter-header-end)) | |
1033 (< (point) limit) | |
1034 (let ((end (min limit (mh-letter-header-end))) | |
1035 (point (point)) | |
1036 data-end data-begin field) | |
1037 (end-of-line) | |
1038 (setq data-end (if (re-search-forward "^[^ \t]" end t) | |
1039 (match-beginning 0) | |
1040 end)) | |
1041 (goto-char (1- data-end)) | |
1042 (if (not (re-search-backward "\\(^[^ \t][^:]*\\):[ \t]*" nil t)) | |
1043 (setq data-begin (point-min)) | |
1044 (setq data-begin (match-end 0)) | |
1045 (setq field (match-string 1))) | |
1046 (setq data-begin (max point data-begin)) | |
1047 (goto-char (if (equal point data-end) (1+ data-end) data-end)) | |
1048 (cond ((and field (mh-letter-skipped-header-field-p field)) | |
1049 (set-match-data nil) | |
1050 nil) | |
1051 (t (set-match-data | |
1052 (list data-begin data-end data-begin data-end)) | |
1053 t))))) | |
1054 | |
1055 (defun mh-letter-header-end () | |
1056 "Find the end of the message header. | |
1057 This function is to be used only for font locking. It works by | |
1058 searching for `mh-mail-header-separator' in the buffer." | |
1059 (save-excursion | |
1060 (goto-char (point-min)) | |
1061 (cond ((equal mh-mail-header-separator "") (point-min)) | |
1062 ((search-forward (format "\n%s\n" mh-mail-header-separator) nil t) | |
1063 (line-beginning-position 0)) | |
1064 (t (point-min))))) | |
1065 | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1066 (defun mh-auto-fill-for-letter () |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1067 "Perform auto-fill for message. |
88155 | 1068 Header is treated specially by inserting a tab before continuation |
1069 lines." | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1070 (if (mh-in-header-p) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1071 (let ((fill-prefix "\t")) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1072 (do-auto-fill)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1073 (do-auto-fill))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1074 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1075 (defun mh-insert-header-separator () |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1076 "Insert `mh-mail-header-separator', if absent." |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1077 (save-excursion |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1078 (goto-char (point-min)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1079 (rfc822-goto-eoh) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1080 (if (looking-at "$") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1081 (insert mh-mail-header-separator)))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1082 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1083 ;;;###mh-autoload |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1084 (defun mh-to-field () |
88155 | 1085 "Move to specified header field. |
1086 | |
1087 The field is indicated by the previous keystroke (the last | |
1088 keystroke of the command) according to the list in the variable | |
1089 `mh-to-field-choices'. | |
1090 Create the field if it does not exist. | |
1091 Set the mark to point before moving." | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1092 (interactive) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1093 (expand-abbrev) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1094 (let ((target (cdr (or (assoc (char-to-string (logior last-input-char ?`)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1095 mh-to-field-choices) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1096 ;; also look for a char for version 4 compat |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1097 (assoc (logior last-input-char ?`) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1098 mh-to-field-choices)))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1099 (case-fold-search t)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1100 (push-mark) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1101 (cond ((mh-position-on-field target) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1102 (let ((eol (point))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1103 (skip-chars-backward " \t") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1104 (delete-region (point) eol)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1105 (if (and (not (eq (logior last-input-char ?`) ?s)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1106 (save-excursion |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1107 (backward-char 1) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1108 (not (looking-at "[:,]")))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1109 (insert ", ") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1110 (insert " "))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1111 (t |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1112 (if (mh-position-on-field "To:") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1113 (forward-line 1)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1114 (insert (format "%s \n" target)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1115 (backward-char 1))))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1116 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1117 ;;;###mh-autoload |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1118 (defun mh-to-fcc (&optional folder) |
88155 | 1119 "Move to \"Fcc:\" header field. |
1120 | |
1121 This command will prompt you for the FOLDER name in which to file | |
1122 a copy of the draft." | |
1123 (interactive (list (mh-prompt-for-folder | |
1124 "Fcc" | |
1125 (or (and mh-default-folder-for-message-function | |
1126 (save-excursion | |
1127 (goto-char (point-min)) | |
1128 (funcall | |
1129 mh-default-folder-for-message-function))) | |
1130 "") | |
1131 t))) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1132 (let ((last-input-char ?\C-f)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1133 (expand-abbrev) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1134 (save-excursion |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1135 (mh-to-field) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1136 (insert (if (mh-folder-name-p folder) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1137 (substring folder 1) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1138 folder))))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1139 |
88155 | 1140 (defun mh-file-is-vcard-p (file) |
1141 "Return t if FILE is a .vcf vcard." | |
1142 (let ((case-fold-search t)) | |
1143 (and (stringp file) | |
1144 (file-exists-p file) | |
1145 (or (and (not (mh-have-file-command)) | |
1146 (not (null (string-match "\.vcf$" file)))) | |
1147 (string-equal "text/x-vcard" (mh-file-mime-type file)))))) | |
1148 | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1149 ;;;###mh-autoload |
88155 | 1150 (defun mh-insert-signature (&optional file) |
1151 "Insert signature in message. | |
1152 | |
1153 This command inserts your signature at the current cursor location. | |
1154 | |
1155 By default, the text of your signature is taken from the file | |
1156 \"~/.signature\". You can read from other sources by changing the | |
1157 option `mh-signature-file-name'. | |
1158 | |
1159 A signature separator (\"-- \") will be added if the signature block | |
1160 does not contain one and `mh-signature-separator-flag' is on. | |
1161 | |
1162 The hook `mh-insert-signature-hook' is run after the signature is | |
1163 inserted. Hook functions may access the actual name of the file or the | |
1164 function used to insert the signature with `mh-signature-file-name'. | |
1165 | |
1166 The signature can also be inserted using Identities (see | |
1167 `mh-identity-list'). | |
1168 | |
1169 In a program, you can pass in a signature FILE." | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1170 (interactive) |
88155 | 1171 (save-excursion |
1172 (insert "\n") | |
1173 (let ((mh-signature-file-name (or file mh-signature-file-name)) | |
1174 (mh-mh-p (mh-mh-directive-present-p)) | |
1175 (mh-mml-p (mh-mml-tag-present-p))) | |
1176 (save-restriction | |
1177 (narrow-to-region (point) (point)) | |
1178 (cond | |
1179 ((mh-file-is-vcard-p mh-signature-file-name) | |
1180 (if (equal mh-compose-insertion 'mml) | |
1181 (insert "<#part type=\"text/x-vcard\" filename=\"" | |
1182 mh-signature-file-name | |
1183 "\" disposition=inline description=VCard>\n<#/part>") | |
1184 (insert "#text/x-vcard; name=\"" | |
1185 (file-name-nondirectory mh-signature-file-name) | |
1186 "\" [VCard] " (expand-file-name mh-signature-file-name)))) | |
1187 (t | |
1188 (cond | |
1189 (mh-mh-p | |
1190 (insert "#\n" "Content-Description: Signature\n")) | |
1191 (mh-mml-p | |
1192 (mml-insert-tag 'part 'type "text/plain" 'disposition "inline" | |
1193 'description "Signature"))) | |
1194 (cond ((null mh-signature-file-name)) | |
1195 ((and (stringp mh-signature-file-name) | |
1196 (file-readable-p mh-signature-file-name)) | |
1197 (insert-file-contents mh-signature-file-name)) | |
1198 ((functionp mh-signature-file-name) | |
1199 (funcall mh-signature-file-name))))) | |
1200 (save-restriction | |
1201 (widen) | |
1202 (run-hooks 'mh-insert-signature-hook)) | |
1203 (goto-char (point-min)) | |
1204 (when (and (not (mh-file-is-vcard-p mh-signature-file-name)) | |
1205 mh-signature-separator-flag | |
1206 (> (point-max) (point-min)) | |
1207 (not (mh-signature-separator-p))) | |
1208 (cond (mh-mh-p | |
1209 (forward-line 2)) | |
1210 (mh-mml-p | |
1211 (forward-line 1))) | |
1212 (insert mh-signature-separator)) | |
1213 (if (not (> (point-max) (point-min))) | |
1214 (message "No signature found"))))) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1215 (force-mode-line-update)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1216 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1217 ;;;###mh-autoload |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1218 (defun mh-check-whom () |
88155 | 1219 "Verify recipients, showing expansion of any aliases. |
1220 | |
1221 This command expands aliases so you can check the actual address(es) | |
1222 in the alias. A new buffer named \"*MH-E Recipients*\" is created with | |
1223 the output of \"whom\"." | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1224 (interactive) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1225 (let ((file-name buffer-file-name)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1226 (save-buffer) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1227 (message "Checking recipients...") |
49578
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
1228 (mh-in-show-buffer (mh-recipients-buffer) |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1229 (bury-buffer (current-buffer)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1230 (erase-buffer) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1231 (mh-exec-cmd-output "whom" t file-name)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1232 (message "Checking recipients...done"))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1233 |
49578
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
1234 (defun mh-tidy-draft-buffer () |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
1235 "Run when a draft buffer is destroyed." |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
1236 (let ((buffer (get-buffer mh-recipients-buffer))) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
1237 (if buffer |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
1238 (kill-buffer buffer)))) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
1239 |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1240 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1241 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1242 ;;; Routines to compose and send a letter. |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1243 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1244 (defun mh-insert-x-face () |
88155 | 1245 "Append X-Face, Face or X-Image-URL field to header. |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1246 If the field already exists, this function does nothing." |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1247 (when (and (file-exists-p mh-x-face-file) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1248 (file-readable-p mh-x-face-file)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1249 (save-excursion |
88155 | 1250 (unless (or (mh-position-on-field "X-Face") |
1251 (mh-position-on-field "Face") | |
1252 (mh-position-on-field "X-Image-URL")) | |
1253 (save-excursion | |
1254 (goto-char (+ (point) (cadr (insert-file-contents mh-x-face-file)))) | |
1255 (if (not (looking-at "^")) | |
1256 (insert "\n"))) | |
1257 (unless (looking-at "\\(X-Face\\|Face\\|X-Image-URL\\): ") | |
1258 (insert "X-Face: ")))))) | |
1259 | |
1260 (defvar mh-x-mailer-string nil | |
1261 "*String containing the contents of the X-Mailer header field. | |
1262 If nil, this variable is initialized to show the version of MH-E, | |
1263 Emacs, and MH the first time a message is composed.") | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1264 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1265 (defun mh-insert-x-mailer () |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1266 "Append an X-Mailer field to the header. |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1267 The versions of MH-E, Emacs, and MH are shown." |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1268 ;; Lazily initialize mh-x-mailer-string. |
88155 | 1269 (when (and mh-insert-x-mailer-flag (null mh-x-mailer-string)) |
1270 (setq mh-x-mailer-string | |
1271 (format "MH-E %s; %s; %sEmacs %s" | |
1272 mh-version mh-variant-in-use | |
1273 (if mh-xemacs-flag "X" "GNU ") | |
1274 (cond ((not mh-xemacs-flag) emacs-version) | |
1275 ((string-match "[0-9.]*\\( +\([ a-z]+[0-9]+\)\\)?" | |
1276 emacs-version) | |
1277 (match-string 0 emacs-version)) | |
1278 (t (format "%s.%s" emacs-major-version | |
1279 emacs-minor-version)))))) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1280 ;; Insert X-Mailer, but only if it doesn't already exist. |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1281 (save-excursion |
88155 | 1282 (when (and mh-insert-x-mailer-flag |
1283 (null (mh-goto-header-field "X-Mailer"))) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1284 (mh-insert-fields "X-Mailer:" mh-x-mailer-string)))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1285 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1286 (defun mh-regexp-in-field-p (regexp &rest fields) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1287 "Non-nil means REGEXP was found in FIELDS." |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1288 (save-excursion |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1289 (let ((search-result nil) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1290 (field)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1291 (while fields |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1292 (setq field (car fields)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1293 (if (and (mh-goto-header-field field) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1294 (re-search-forward |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1295 regexp (save-excursion (mh-header-field-end)(point)) t)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1296 (setq fields nil |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1297 search-result t) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1298 (setq fields (cdr fields)))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1299 search-result))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1300 |
88155 | 1301 ;;;###mh-autoload |
1302 (defun mh-insert-auto-fields (&optional non-interactive) | |
1303 "Insert custom fields if recipient is found in `mh-auto-fields-list'. | |
1304 | |
1305 Sets buffer-local `mh-insert-auto-fields-done-local' if header | |
1306 fields were added. If NON-INTERACTIVE is non-nil, perform actions | |
1307 quietly and only if `mh-insert-auto-fields-done-local' is nil. | |
1308 | |
1309 An `identity' entry is skipped if one was already entered | |
1310 manually. | |
1311 | |
1312 Return t if fields added; otherwise return nil." | |
1313 (interactive) | |
1314 (when (or (not non-interactive) | |
1315 (not mh-insert-auto-fields-done-local)) | |
1316 (save-excursion | |
1317 (when (and (or (mh-goto-header-field "To:") | |
1318 (mh-goto-header-field "cc:"))) | |
1319 (let ((list mh-auto-fields-list) | |
1320 (fields-inserted nil)) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1321 (while list |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1322 (let ((regexp (nth 0 (car list))) |
88155 | 1323 (entries (nth 1 (car list)))) |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1324 (when (mh-regexp-in-field-p regexp "To:" "cc:") |
88155 | 1325 (setq mh-insert-auto-fields-done-local t) |
1326 (setq fields-inserted t) | |
1327 (if (not non-interactive) | |
1328 (message "Fields for %s added" regexp)) | |
1329 (let ((entry-list entries)) | |
1330 (while entry-list | |
1331 (let ((field (caar entry-list)) | |
1332 (value (cdar entry-list))) | |
1333 (cond | |
1334 ((equal ":identity" field) | |
1335 (when ;;(and (not mh-identity-local) | |
1336 ;; Bug 1204506. But do we need to be able | |
1337 ;; to set an identity manually that won't be | |
1338 ;; overridden by mh-insert-auto-fields? | |
1339 (assoc value mh-identity-list) | |
1340 ;;) | |
1341 (mh-insert-identity value))) | |
1342 (t | |
1343 (mh-modify-header-field field value | |
1344 (equal field "From"))))) | |
1345 (setq entry-list (cdr entry-list)))))) | |
1346 (setq list (cdr list))) | |
1347 fields-inserted))))) | |
1348 | |
1349 (defun mh-modify-header-field (field value &optional overwrite-flag) | |
1350 "To header FIELD add VALUE. | |
1351 If OVERWRITE-FLAG is non-nil then the old value, if present, is | |
1352 discarded." | |
1353 (cond ((and overwrite-flag | |
1354 (mh-goto-header-field (concat field ":"))) | |
1355 (insert " " value) | |
1356 (delete-region (point) (line-end-position))) | |
1357 ((and (not overwrite-flag) | |
1358 (mh-regexp-in-field-p (concat "\\b" value "\\b") field)) | |
1359 ;; Already there, do nothing. | |
1360 ) | |
1361 ((and (not overwrite-flag) | |
1362 (mh-goto-header-field (concat field ":"))) | |
1363 (insert " " value ",")) | |
1364 (t | |
1365 (mh-goto-header-end 0) | |
1366 (insert field ": " value "\n")))) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1367 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1368 (defun mh-compose-and-send-mail (draft send-args |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1369 sent-from-folder sent-from-msg |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1370 to subject cc |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1371 annotate-char annotate-field |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1372 config) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1373 "Edit and compose a draft message in buffer DRAFT and send or save it. |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1374 SEND-ARGS is the argument passed to the send command. |
88155 | 1375 SENT-FROM-FOLDER is buffer containing scan listing of current folder, |
1376 or nil if none exists. | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1377 SENT-FROM-MSG is the message number or sequence name or nil. |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1378 The TO, SUBJECT, and CC fields are passed to the |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1379 `mh-compose-letter-function'. |
88155 | 1380 If ANNOTATE-CHAR is non-null, it is used to notate the scan listing of |
1381 the message. In that case, the ANNOTATE-FIELD is used to build a | |
1382 string for `mh-annotate-msg'. | |
1383 CONFIG is the window configuration to restore after sending the | |
1384 letter." | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1385 (pop-to-buffer draft) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1386 (mh-letter-mode) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49578
diff
changeset
|
1387 |
88155 | 1388 ;; Insert identity. |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1389 (if (and (boundp 'mh-identity-default) |
88155 | 1390 mh-identity-default |
1391 (not mh-identity-local)) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1392 (mh-insert-identity mh-identity-default)) |
88155 | 1393 (mh-identity-make-menu) |
1394 (easy-menu-add mh-identity-menu) | |
1395 | |
1396 ;; Insert extra fields. | |
1397 (mh-insert-x-mailer) | |
1398 (mh-insert-x-face) | |
1399 | |
1400 (mh-letter-hide-all-skipped-fields) | |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49578
diff
changeset
|
1401 |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1402 (setq mh-sent-from-folder sent-from-folder) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1403 (setq mh-sent-from-msg sent-from-msg) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1404 (setq mh-send-args send-args) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1405 (setq mh-annotate-char annotate-char) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1406 (setq mh-annotate-field annotate-field) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1407 (setq mh-previous-window-config config) |
49578
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
1408 (setq mode-line-buffer-identification (list " {%b}")) |
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
1409 (mh-logo-display) |
88155 | 1410 (mh-make-local-hook 'kill-buffer-hook) |
49578
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
1411 (add-hook 'kill-buffer-hook 'mh-tidy-draft-buffer nil t) |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1412 (if (and (boundp 'mh-compose-letter-function) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1413 mh-compose-letter-function) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1414 ;; run-hooks will not pass arguments. |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1415 (let ((value mh-compose-letter-function)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1416 (if (and (listp value) (not (eq (car value) 'lambda))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1417 (while value |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1418 (funcall (car value) to subject cc) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1419 (setq value (cdr value))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1420 (funcall mh-compose-letter-function to subject cc))))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1421 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1422 (defun mh-letter-mode-message () |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1423 "Display a help message for users of `mh-letter-mode'. |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1424 This should be the last function called when composing the draft." |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1425 (message "%s" (substitute-command-keys |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1426 (concat "Type \\[mh-send-letter] to send message, " |
88155 | 1427 "\\[mh-help] for help")))) |
1428 | |
1429 (defun mh-ascii-buffer-p () | |
1430 "Check if current buffer is entirely composed of ASCII. | |
1431 The function doesn't work for XEmacs since `find-charset-region' | |
1432 doesn't exist there." | |
1433 (loop for charset in (mh-funcall-if-exists | |
1434 find-charset-region (point-min) (point-max)) | |
1435 unless (eq charset 'ascii) return nil | |
1436 finally return t)) | |
1437 | |
1438 ;; Shush compiler. | |
1439 (eval-when-compile (defvar sendmail-coding-system)) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1440 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1441 ;;;###mh-autoload |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1442 (defun mh-send-letter (&optional arg) |
88155 | 1443 "Save draft and send message. |
1444 | |
1445 When you are all through editing a message, you send it with this | |
1446 command. You can give a prefix argument ARG to monitor the first stage | |
1447 of the delivery\; this output can be found in a buffer called \"*MH-E | |
1448 Mail Delivery*\". | |
1449 | |
1450 The hook `mh-before-send-letter-hook' is run at the beginning of | |
1451 this command. For example, if you want to check your spelling in | |
1452 your message before sending, add the function `ispell-message'. | |
1453 | |
1454 In case the MH \"send\" program is installed under a different name, | |
1455 use `mh-send-prog' to tell MH-E the name." | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1456 (interactive "P") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1457 (run-hooks 'mh-before-send-letter-hook) |
88155 | 1458 (if (and (mh-insert-auto-fields t) |
1459 mh-auto-fields-prompt-flag | |
1460 (goto-char (point-min))) | |
1461 (if (not (y-or-n-p "Auto fields inserted, send? ")) | |
1462 (error "Send aborted"))) | |
1463 (cond ((mh-mh-directive-present-p) | |
1464 (mh-mh-to-mime)) | |
1465 ((or (mh-mml-tag-present-p) (not (mh-ascii-buffer-p))) | |
1466 (mh-mml-to-mime))) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1467 (save-buffer) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1468 (message "Sending...") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1469 (let ((draft-buffer (current-buffer)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1470 (file-name buffer-file-name) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1471 (config mh-previous-window-config) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1472 (coding-system-for-write |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1473 (if (and (local-variable-p 'buffer-file-coding-system |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1474 (current-buffer)) ;XEmacs needs two args |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1475 ;; We're not sure why, but buffer-file-coding-system |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1476 ;; tends to get set to undecided-unix. |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1477 (not (memq buffer-file-coding-system |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1478 '(undecided undecided-unix undecided-dos)))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1479 buffer-file-coding-system |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1480 (or (and (boundp 'sendmail-coding-system) sendmail-coding-system) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1481 (and (boundp 'default-buffer-file-coding-system ) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1482 default-buffer-file-coding-system) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1483 'iso-latin-1)))) |
88155 | 1484 ;; Adding a Message-ID field looks good, makes it easier to search for |
1485 ;; message in your +outbox, and best of all doesn't break threading for | |
1486 ;; the recipient if you reply to a message in your +outbox. | |
1487 (setq mh-send-args (concat "-msgid " mh-send-args)) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1488 ;; The default BCC encapsulation will make a MIME message unreadable. |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1489 ;; With nmh use the -mime arg to prevent this. |
88155 | 1490 (if (and (mh-variant-p 'nmh) |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1491 (mh-goto-header-field "Bcc:") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1492 (mh-goto-header-field "Content-Type:")) |
88155 | 1493 (setq mh-send-args (concat "-mime " mh-send-args))) |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1494 (cond (arg |
88155 | 1495 (pop-to-buffer mh-mail-delivery-buffer) |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1496 (erase-buffer) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1497 (mh-exec-cmd-output mh-send-prog t "-watch" "-nopush" |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1498 "-nodraftfolder" mh-send-args file-name) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1499 (goto-char (point-max)) ; show the interesting part |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1500 (recenter -1) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1501 (set-buffer draft-buffer)) ; for annotation below |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1502 (t |
49578
b35587af8747
Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents:
49459
diff
changeset
|
1503 (mh-exec-cmd-daemon mh-send-prog nil "-nodraftfolder" "-noverbose" |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1504 mh-send-args file-name))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1505 (if mh-annotate-char |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1506 (mh-annotate-msg mh-sent-from-msg |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1507 mh-sent-from-folder |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1508 mh-annotate-char |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1509 "-component" mh-annotate-field |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1510 "-text" (format "\"%s %s\"" |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1511 (mh-get-header-field "To:") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1512 (mh-get-header-field "Cc:")))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1513 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1514 (cond ((or (not arg) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1515 (y-or-n-p "Kill draft buffer? ")) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1516 (kill-buffer draft-buffer) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1517 (if config |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1518 (set-window-configuration config)))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1519 (if arg |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1520 (message "Sending...done") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1521 (message "Sending...backgrounded")))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1522 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1523 ;;;###mh-autoload |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1524 (defun mh-insert-letter (folder message verbatim) |
88155 | 1525 "Insert a message. |
1526 | |
1527 This command prompts you for the FOLDER and MESSAGE number, which | |
1528 defaults to the current message in that folder. It then inserts | |
1529 the message, indented by `mh-ins-buf-prefix' (\"> \") unless | |
1530 `mh-yank-behavior' is set to one of the supercite flavors in | |
1531 which case supercite is used to format the message. Certain | |
1532 undesirable header fields (see | |
1533 `mh-invisible-header-fields-compiled') are removed before | |
1534 insertion. | |
1535 | |
1536 If given a prefix argument VERBATIM, the header is left intact, the | |
1537 message is not indented, and \"> \" is not inserted before each line. | |
1538 This command leaves the mark before the letter and point after it." | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1539 (interactive |
88155 | 1540 (let* ((folder |
1541 (mh-prompt-for-folder "Message from" | |
1542 mh-sent-from-folder nil)) | |
1543 (default | |
1544 (if (and (equal folder mh-sent-from-folder) | |
1545 (numberp mh-sent-from-msg)) | |
1546 mh-sent-from-msg | |
1547 (nth 0 (mh-translate-range folder "cur")))) | |
1548 (message | |
1549 (read-string (concat "Message number" | |
1550 (or (and default | |
1551 (format " (default %d): " default)) | |
1552 ": "))))) | |
1553 (list folder message current-prefix-arg))) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1554 (save-restriction |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1555 (narrow-to-region (point) (point)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1556 (let ((start (point-min))) |
88155 | 1557 (if (and (equal message "") (numberp mh-sent-from-msg)) |
1558 (setq message (int-to-string mh-sent-from-msg))) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1559 (insert-file-contents |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1560 (expand-file-name message (mh-expand-file-name folder))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1561 (when (not verbatim) |
88155 | 1562 (mh-clean-msg-header start mh-invisible-header-fields-compiled nil) |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1563 (goto-char (point-max)) ;Needed for sc-cite-original |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1564 (push-mark) ;Needed for sc-cite-original |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1565 (goto-char (point-min)) ;Needed for sc-cite-original |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1566 (mh-insert-prefix-string mh-ins-buf-prefix))))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1567 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1568 (defun mh-extract-from-attribution () |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1569 "Extract phrase or comment from From header field." |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1570 (save-excursion |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1571 (if (not (mh-goto-header-field "From: ")) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1572 nil |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1573 (skip-chars-forward " ") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1574 (cond |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1575 ((looking-at "\"\\([^\"\n]+\\)\" \\(<.+>\\)") |
88155 | 1576 (format "%s %s " (match-string 1)(match-string 2))) |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1577 ((looking-at "\\([^<\n]+<.+>\\)$") |
88155 | 1578 (format "%s " (match-string 1))) |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1579 ((looking-at "\\([^ ]+@[^ ]+\\) +(\\(.+\\))$") |
88155 | 1580 (format "%s <%s> " (match-string 2)(match-string 1))) |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1581 ((looking-at " *\\(.+\\)$") |
88155 | 1582 (format "%s " (match-string 1))))))) |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1583 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1584 ;;;###mh-autoload |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1585 (defun mh-yank-cur-msg () |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1586 "Insert the current message into the draft buffer. |
88155 | 1587 |
1588 It is often useful to insert a snippet of text from a letter that | |
1589 someone mailed to provide some context for your reply. This | |
1590 command does this by adding an attribution, yanking a portion of | |
1591 text from the message to which you're replying, and inserting | |
1592 `mh-ins-buf-prefix' (`> ') before each line. | |
1593 | |
1594 The attribution consists of the sender's name and email address | |
1595 followed by the content of the option | |
1596 `mh-extract-from-attribution-verb'. | |
1597 | |
1598 You can also turn on the option | |
1599 `mh-delete-yanked-msg-window-flag' to delete the window | |
1600 containing the original message after yanking it to make more | |
1601 room on your screen for your reply. | |
1602 | |
1603 You can control how the message to which you are replying is | |
1604 yanked into your reply using `mh-yank-behavior'. | |
1605 | |
1606 If this isn't enough, you can gain full control over the | |
1607 appearance of the included text by setting `mail-citation-hook' | |
1608 to a function that modifies it. For example, if you set this hook | |
1609 to `trivial-cite' (which is NOT part of Emacs), set | |
1610 `mh-yank-behavior' to \"Body and Header\" (see URL | |
1611 `http://shasta.cs.uiuc.edu/~lrclause/tc.html'). | |
1612 | |
1613 Note that if `mail-citation-hook' is set, `mh-ins-buf-prefix' is | |
1614 not inserted. If the option `mh-yank-behavior' is set to one of | |
1615 the supercite flavors, the hook `mail-citation-hook' is ignored | |
1616 and `mh-ins-buf-prefix' is not inserted." | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1617 (interactive) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1618 (if (and mh-sent-from-folder |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1619 (save-excursion (set-buffer mh-sent-from-folder) mh-show-buffer) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1620 (save-excursion (set-buffer mh-sent-from-folder) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1621 (get-buffer mh-show-buffer)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1622 mh-sent-from-msg) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1623 (let ((to-point (point)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1624 (to-buffer (current-buffer))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1625 (set-buffer mh-sent-from-folder) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1626 (if mh-delete-yanked-msg-window-flag |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1627 (delete-windows-on mh-show-buffer)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1628 (set-buffer mh-show-buffer) ; Find displayed message |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1629 (let* ((from-attr (mh-extract-from-attribution)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1630 (yank-region (mh-mark-active-p nil)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1631 (mh-ins-str |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1632 (cond ((and yank-region |
88155 | 1633 (or (eq 'supercite mh-yank-behavior) |
1634 (eq 'autosupercite mh-yank-behavior) | |
1635 (eq t mh-yank-behavior))) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1636 ;; supercite needs the full header |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1637 (concat |
88155 | 1638 (buffer-substring (point-min) (mh-mail-header-end)) |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1639 "\n" |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1640 (buffer-substring (region-beginning) (region-end)))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1641 (yank-region |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1642 (buffer-substring (region-beginning) (region-end))) |
88155 | 1643 ((or (eq 'body mh-yank-behavior) |
1644 (eq 'attribution mh-yank-behavior) | |
1645 (eq 'autoattrib mh-yank-behavior)) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1646 (buffer-substring |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1647 (save-excursion |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1648 (goto-char (point-min)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1649 (mh-goto-header-end 1) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1650 (point)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1651 (point-max))) |
88155 | 1652 ((or (eq 'supercite mh-yank-behavior) |
1653 (eq 'autosupercite mh-yank-behavior) | |
1654 (eq t mh-yank-behavior)) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1655 (buffer-substring (point-min) (point-max))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1656 (t |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1657 (buffer-substring (point) (point-max)))))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1658 (set-buffer to-buffer) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1659 (save-restriction |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1660 (narrow-to-region to-point to-point) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1661 (insert (mh-filter-out-non-text mh-ins-str)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1662 (goto-char (point-max)) ;Needed for sc-cite-original |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1663 (push-mark) ;Needed for sc-cite-original |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1664 (goto-char (point-min)) ;Needed for sc-cite-original |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1665 (mh-insert-prefix-string mh-ins-buf-prefix) |
88155 | 1666 (when (or (eq 'attribution mh-yank-behavior) |
1667 (eq 'autoattrib mh-yank-behavior)) | |
1668 (insert from-attr) | |
1669 (mh-identity-insert-attribution-verb nil) | |
1670 (insert "\n\n")) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1671 ;; If the user has selected a region, he has already "edited" the |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1672 ;; text, so leave the cursor at the end of the yanked text. In |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1673 ;; either case, leave a mark at the opposite end of the included |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1674 ;; text to make it easy to jump or delete to the other end of the |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1675 ;; text. |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1676 (push-mark) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1677 (goto-char (point-max)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1678 (if (null yank-region) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1679 (mh-exchange-point-and-mark-preserving-active-mark))))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1680 (error "There is no current message"))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1681 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1682 (defun mh-filter-out-non-text (string) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1683 "Return STRING but without adornments such as MIME buttons and smileys." |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1684 (with-temp-buffer |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1685 ;; Insert the string to filter |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1686 (insert string) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1687 (goto-char (point-min)) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49578
diff
changeset
|
1688 |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1689 ;; Remove the MIME buttons |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1690 (let ((can-move-forward t) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1691 (in-button nil)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1692 (while can-move-forward |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1693 (cond ((and (not (get-text-property (point) 'mh-data)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1694 in-button) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1695 (delete-region (1- (point)) (point)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1696 (setq in-button nil)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1697 ((get-text-property (point) 'mh-data) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1698 (delete-region (point) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1699 (save-excursion (forward-line) (point))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1700 (setq in-button t)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1701 (t (setq can-move-forward (= (forward-line) 0)))))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1702 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1703 ;; Return the contents without properties... This gets rid of emphasis |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1704 ;; and smileys |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1705 (buffer-substring-no-properties (point-min) (point-max)))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1706 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1707 (defun mh-insert-prefix-string (mh-ins-string) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1708 "Insert prefix string before each line in buffer. |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1709 The inserted letter is cited using `sc-cite-original' if |
88155 | 1710 `mh-yank-behavior' is one of 'supercite or 'autosupercite. |
1711 Otherwise, simply insert MH-INS-STRING before each line." | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1712 (goto-char (point-min)) |
88155 | 1713 (cond ((or (eq mh-yank-behavior 'supercite) |
1714 (eq mh-yank-behavior 'autosupercite)) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1715 (sc-cite-original)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1716 (mail-citation-hook |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1717 (run-hooks 'mail-citation-hook)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1718 (mh-yank-hooks ;old hook name |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1719 (run-hooks 'mh-yank-hooks)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1720 (t |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1721 (or (bolp) (forward-line 1)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1722 (while (< (point) (point-max)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1723 (insert mh-ins-string) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1724 (forward-line 1)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1725 (goto-char (point-min))))) ;leave point like sc-cite-original |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1726 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1727 ;;;###mh-autoload |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1728 (defun mh-fully-kill-draft () |
88155 | 1729 "Quit editing and delete draft message. |
1730 | |
1731 If for some reason you are not happy with the draft, you can use | |
1732 this command to kill the draft buffer and delete the draft | |
1733 message. Use the command \\[kill-buffer] if you don't want to | |
1734 delete the draft message." | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1735 (interactive) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1736 (if (y-or-n-p "Kill draft message? ") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1737 (let ((config mh-previous-window-config)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1738 (if (file-exists-p buffer-file-name) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1739 (delete-file buffer-file-name)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1740 (set-buffer-modified-p nil) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1741 (kill-buffer (buffer-name)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1742 (message "") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1743 (if config |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1744 (set-window-configuration config))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1745 (error "Message not killed"))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1746 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1747 (defun mh-current-fill-prefix () |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1748 "Return the `fill-prefix' on the current line as a string." |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1749 (save-excursion |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1750 (beginning-of-line) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1751 ;; This assumes that the major-mode sets up adaptive-fill-regexp |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1752 ;; correctly such as mh-letter-mode or sendmail.el's mail-mode. But |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1753 ;; perhaps I should use the variable and simply inserts its value here, |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1754 ;; and set it locally in a let scope. --psg |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1755 (if (re-search-forward adaptive-fill-regexp nil t) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1756 (match-string 0) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1757 ""))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1758 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1759 ;;;###mh-autoload |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1760 (defun mh-open-line () |
88155 | 1761 "Insert a newline and leave point before it. |
1762 | |
1763 This command is similar to the command \\[open-line] in that it | |
1764 inserts a newline after point. It differs in that it also inserts | |
1765 the right number of quoting characters and spaces so that the | |
1766 next line begins in the same column as it was. This is useful | |
1767 when breaking up paragraphs in replies." | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1768 (interactive) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1769 (let ((column (current-column)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1770 (prefix (mh-current-fill-prefix))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1771 (if (> (length prefix) column) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1772 (message "Sorry, point seems to be within the line prefix") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1773 (newline 2) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1774 (insert prefix) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1775 (while (> column (current-column)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1776 (insert " ")) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1777 (forward-line -1)))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1778 |
88155 | 1779 (mh-do-in-xemacs (defvar mail-abbrevs)) |
1780 | |
1781 (defmacro mh-display-completion-list-compat (word choices) | |
1782 "Completes WORD from CHOICES using `display-completion-list'. | |
1783 Calls `display-completion-list' correctly in older environments. | |
1784 Versions of Emacs prior to version 22 lacked a COMMON-SUBSTRING | |
1785 argument which is used to highlight the next possible character you | |
1786 can enter in the current list of completions." | |
1787 (if (>= emacs-major-version 22) | |
1788 `(display-completion-list (all-completions ,word ,choices) ,word) | |
1789 `(display-completion-list (all-completions ,word ,choices)))) | |
1790 | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1791 ;;;###mh-autoload |
88155 | 1792 (defun mh-complete-word (word choices begin end) |
1793 "Complete WORD at from CHOICES. | |
1794 Any match found replaces the text from BEGIN to END." | |
1795 (let ((completion (try-completion word choices)) | |
1796 (completions-buffer "*Completions*")) | |
1797 (cond ((eq completion t) | |
1798 (ignore-errors | |
1799 (kill-buffer completions-buffer)) | |
1800 (message "Completed: %s" word)) | |
1801 ((null completion) | |
1802 (ignore-errors | |
1803 (kill-buffer completions-buffer)) | |
1804 (message "No completion for %s" word)) | |
1805 ((stringp completion) | |
1806 (if (equal word completion) | |
1807 (with-output-to-temp-buffer completions-buffer | |
1808 (mh-display-completion-list-compat word choices)) | |
1809 (ignore-errors | |
1810 (kill-buffer completions-buffer)) | |
1811 (delete-region begin end) | |
1812 (insert completion)))))) | |
1813 | |
1814 ;;;###mh-autoload | |
1815 (defun mh-beginning-of-word (&optional n) | |
1816 "Return position of the N th word backwards." | |
1817 (unless n (setq n 1)) | |
1818 (let ((syntax-table (syntax-table))) | |
1819 (unwind-protect | |
1820 (save-excursion | |
1821 (mh-mail-abbrev-make-syntax-table) | |
1822 (set-syntax-table mail-abbrev-syntax-table) | |
1823 (backward-word n) | |
1824 (point)) | |
1825 (set-syntax-table syntax-table)))) | |
1826 | |
1827 (defun mh-folder-expand-at-point () | |
1828 "Do folder name completion in Fcc header field." | |
1829 (let* ((end (point)) | |
1830 (beg (mh-beginning-of-word)) | |
1831 (folder (buffer-substring beg end)) | |
1832 (leading-plus (and (> (length folder) 0) (equal (aref folder 0) ?+))) | |
1833 (last-slash (mh-search-from-end ?/ folder)) | |
1834 (prefix (and last-slash (substring folder 0 last-slash))) | |
1835 (choices (mapcar #'(lambda (x) | |
1836 (list (cond (prefix (format "%s/%s" prefix x)) | |
1837 (leading-plus (format "+%s" x)) | |
1838 (t x)))) | |
1839 (mh-folder-completion-function folder nil t)))) | |
1840 (mh-complete-word folder choices beg end))) | |
1841 | |
1842 (defvar mh-letter-complete-function-alist | |
1843 '((bcc . mh-alias-letter-expand-alias) | |
1844 (cc . mh-alias-letter-expand-alias) | |
1845 (dcc . mh-alias-letter-expand-alias) | |
1846 (fcc . mh-folder-expand-at-point) | |
1847 (from . mh-alias-letter-expand-alias) | |
1848 (mail-followup-to . mh-alias-letter-expand-alias) | |
1849 (mail-reply-to . mh-alias-letter-expand-alias) | |
1850 (reply-to . mh-alias-letter-expand-alias) | |
1851 (to . mh-alias-letter-expand-alias)) | |
1852 "Alist of header fields and completion functions to use.") | |
1853 | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1854 (defun mh-letter-complete (arg) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1855 "Perform completion on header field or word preceding point. |
88155 | 1856 |
1857 If the field contains addresses (for example, \"To:\" or \"Cc:\") | |
1858 or folders (for example, \"Fcc:\") then this command will provide | |
1859 alias completion. In the body of the message, this command runs | |
1860 `mh-letter-complete-function' instead, which is set to | |
1861 `ispell-complete-word' by default. This command takes a prefix | |
1862 argument ARG that is passed to the | |
1863 `mh-letter-complete-function'." | |
1864 (interactive "P") | |
1865 (let ((func nil)) | |
1866 (cond ((not (mh-in-header-p)) | |
1867 (funcall mh-letter-complete-function arg)) | |
1868 ((setq func (cdr (assoc (mh-letter-header-field-at-point) | |
1869 mh-letter-complete-function-alist))) | |
1870 (funcall func)) | |
1871 (t (funcall mh-letter-complete-function arg))))) | |
1872 | |
1873 (defun mh-letter-complete-or-space (arg) | |
1874 "Perform completion or insert space. | |
1875 | |
1876 Turn on the option `mh-compose-space-does-completion-flag' to use | |
1877 this command to perform completion in the header. Otherwise, a | |
1878 space is inserted; use a prefix argument ARG to specify more than | |
1879 one space." | |
1880 (interactive "p") | |
1881 (let ((func nil) | |
1882 (end-of-prev (save-excursion | |
1883 (goto-char (mh-beginning-of-word)) | |
1884 (mh-beginning-of-word -1)))) | |
1885 (cond ((not mh-compose-space-does-completion-flag) | |
1886 (self-insert-command arg)) | |
1887 ((not (mh-in-header-p)) (self-insert-command arg)) | |
1888 ((> (point) end-of-prev) (self-insert-command arg)) | |
1889 ((setq func (cdr (assoc (mh-letter-header-field-at-point) | |
1890 mh-letter-complete-function-alist))) | |
1891 (funcall func)) | |
1892 (t (self-insert-command arg))))) | |
1893 | |
1894 (defun mh-letter-confirm-address () | |
1895 "Flash alias expansion. | |
1896 | |
1897 Addresses are separated by a comma\; when you press the comma, | |
1898 this command flashes the alias expansion in the minibuffer if | |
1899 `mh-alias-flash-on-comma' is turned on." | |
1900 (interactive) | |
1901 (cond ((not (mh-in-header-p)) (self-insert-command 1)) | |
1902 ((eq (cdr (assoc (mh-letter-header-field-at-point) | |
1903 mh-letter-complete-function-alist)) | |
1904 'mh-alias-letter-expand-alias) | |
1905 (mh-alias-reload-maybe) | |
1906 (mh-alias-minibuffer-confirm-address)) | |
1907 (t (self-insert-command 1)))) | |
1908 | |
1909 (defvar mh-letter-header-field-regexp "^\\([A-Za-z][A-Za-z0-9-]*\\):") | |
1910 | |
1911 (defun mh-letter-header-field-at-point () | |
1912 "Return the header field name at point. | |
1913 A symbol is returned whose name is the string obtained by | |
1914 downcasing the field name." | |
1915 (save-excursion | |
1916 (end-of-line) | |
1917 (and (re-search-backward mh-letter-header-field-regexp nil t) | |
1918 (intern (downcase (match-string 1)))))) | |
1919 | |
1920 ;;;###mh-autoload | |
1921 (defun mh-letter-next-header-field-or-indent (arg) | |
1922 "Cycle to next field. | |
1923 | |
1924 Within the header of the message, this command moves between | |
1925 fields that are highlighted with the face | |
1926 `mh-letter-header-field', skipping those fields listed in | |
1927 `mh-compose-skipped-header-fields'. After the last field, this | |
1928 command then moves point to the message body before cycling back | |
1929 to the first field. If point is already past the first line of | |
1930 the message body, then this command indents by calling | |
1931 `indent-relative' with the given prefix argument ARG." | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1932 (interactive "P") |
88155 | 1933 (let ((header-end (save-excursion |
1934 (goto-char (mh-mail-header-end)) | |
1935 (forward-line) | |
1936 (point)))) | |
1937 (if (> (point) header-end) | |
1938 (indent-relative arg) | |
1939 (mh-letter-next-header-field)))) | |
1940 | |
1941 (defun mh-letter-next-header-field () | |
1942 "Cycle to the next header field. | |
1943 If we are at the last header field go to the start of the message | |
1944 body." | |
1945 (let ((header-end (mh-mail-header-end))) | |
1946 (cond ((>= (point) header-end) (goto-char (point-min))) | |
1947 ((< (point) (progn | |
1948 (beginning-of-line) | |
1949 (re-search-forward mh-letter-header-field-regexp | |
1950 (line-end-position) t) | |
1951 (point))) | |
1952 (beginning-of-line)) | |
1953 (t (end-of-line))) | |
1954 (cond ((re-search-forward mh-letter-header-field-regexp header-end t) | |
1955 (if (mh-letter-skipped-header-field-p (match-string 1)) | |
1956 (mh-letter-next-header-field) | |
1957 (mh-letter-skip-leading-whitespace-in-header-field))) | |
1958 (t (goto-char header-end) | |
1959 (forward-line))))) | |
1960 | |
1961 ;;;###mh-autoload | |
1962 (defun mh-letter-previous-header-field () | |
1963 "Cycle to the previous header field. | |
1964 | |
1965 This command moves backwards between the fields and cycles to the | |
1966 body of the message after the first field. Unlike the command | |
1967 \\[mh-letter-next-header-field-or-indent], it will always take | |
1968 point to the last field from anywhere in the body." | |
1969 (interactive) | |
1970 (let ((header-end (mh-mail-header-end))) | |
1971 (if (>= (point) header-end) | |
1972 (goto-char header-end) | |
1973 (mh-header-field-beginning)) | |
1974 (cond ((re-search-backward mh-letter-header-field-regexp nil t) | |
1975 (if (mh-letter-skipped-header-field-p (match-string 1)) | |
1976 (mh-letter-previous-header-field) | |
1977 (goto-char (match-end 0)) | |
1978 (mh-letter-skip-leading-whitespace-in-header-field))) | |
1979 (t (goto-char header-end) | |
1980 (forward-line))))) | |
1981 | |
1982 (defun mh-letter-skipped-header-field-p (field) | |
1983 "Check if FIELD is to be skipped." | |
1984 (let ((field (downcase field))) | |
1985 (loop for x in mh-compose-skipped-header-fields | |
1986 when (equal (downcase x) field) return t | |
1987 finally return nil))) | |
1988 | |
1989 (defun mh-letter-skip-leading-whitespace-in-header-field () | |
1990 "Skip leading whitespace in a header field. | |
1991 If the header field doesn't have at least one space after the | |
1992 colon then a space character is added." | |
1993 (let ((need-space t)) | |
1994 (while (memq (char-after) '(?\t ?\ )) | |
1995 (forward-char) | |
1996 (setq need-space nil)) | |
1997 (when need-space (insert " ")))) | |
1998 | |
1999 (defvar mh-hidden-header-keymap | |
2000 (let ((map (make-sparse-keymap))) | |
2001 (mh-do-in-gnu-emacs | |
2002 (define-key map [mouse-2] 'mh-letter-toggle-header-field-display-button)) | |
2003 (mh-do-in-xemacs | |
2004 (define-key map '(button2) | |
2005 'mh-letter-toggle-header-field-display-button)) | |
2006 map)) | |
2007 | |
2008 (defun mh-letter-toggle-header-field-display-button (event) | |
2009 "Toggle header field display at location of EVENT. | |
2010 This function does the same thing as | |
2011 `mh-letter-toggle-header-field-display' except that it is | |
2012 callable from a mouse button." | |
2013 (interactive "e") | |
2014 (mh-do-at-event-location event | |
2015 (mh-letter-toggle-header-field-display nil))) | |
2016 | |
2017 (defun mh-letter-toggle-header-field-display (arg) | |
2018 "Toggle display of header field at point. | |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49578
diff
changeset
|
2019 |
88155 | 2020 Use this command to display truncated header fields. This command |
2021 is a toggle so entering it again will hide the field. This | |
2022 command takes a prefix argument ARG: if negative then the field | |
2023 is hidden, if positive then the field is displayed." | |
2024 (interactive (list nil)) | |
2025 (when (and (mh-in-header-p) | |
2026 (progn | |
2027 (end-of-line) | |
2028 (re-search-backward mh-letter-header-field-regexp nil t))) | |
2029 (let ((buffer-read-only nil) | |
2030 (modified-flag (buffer-modified-p)) | |
2031 (begin (point)) | |
2032 end) | |
2033 (end-of-line) | |
2034 (setq end (1- (if (re-search-forward "^[^ \t]" nil t) | |
2035 (match-beginning 0) | |
2036 (point-max)))) | |
2037 (goto-char begin) | |
2038 ;; Make it clickable... | |
2039 (add-text-properties begin end `(keymap ,mh-hidden-header-keymap | |
2040 mouse-face highlight)) | |
2041 (unwind-protect | |
2042 (cond ((or (and (not arg) | |
2043 (text-property-any begin end 'invisible 'vanish)) | |
2044 (and (numberp arg) (>= arg 0)) | |
2045 (and (eq arg 'long) (> (line-beginning-position 5) end))) | |
2046 (remove-text-properties begin end '(invisible nil)) | |
2047 (search-forward ":" (line-end-position) t) | |
2048 (mh-letter-skip-leading-whitespace-in-header-field)) | |
2049 ;; XXX Redesign to make usable by user. Perhaps use a positive | |
2050 ;; numeric prefix to make that many lines visible. | |
2051 ((eq arg 'long) | |
2052 (end-of-line 4) | |
2053 (mh-letter-truncate-header-field end) | |
2054 (beginning-of-line)) | |
2055 (t (end-of-line) | |
2056 (mh-letter-truncate-header-field end) | |
2057 (beginning-of-line))) | |
2058 (set-buffer-modified-p modified-flag))))) | |
2059 | |
2060 (defun mh-letter-truncate-header-field (end) | |
2061 "Replace text from current line till END with an ellipsis. | |
2062 If the current line is too long truncate a part of it as well." | |
2063 (let ((max-len (min (window-width) 62))) | |
2064 (when (> (+ (current-column) 4) max-len) | |
2065 (backward-char (- (+ (current-column) 5) max-len))) | |
2066 (when (> end (point)) | |
2067 (add-text-properties (point) end '(invisible vanish))))) | |
2068 | |
2069 (defun mh-letter-hide-all-skipped-fields () | |
2070 "Hide all skipped fields." | |
2071 (save-excursion | |
2072 (goto-char (point-min)) | |
2073 (save-restriction | |
2074 (narrow-to-region (point) (mh-mail-header-end)) | |
2075 (while (re-search-forward mh-letter-header-field-regexp nil t) | |
2076 (if (mh-letter-skipped-header-field-p (match-string 1)) | |
2077 (mh-letter-toggle-header-field-display -1) | |
2078 (mh-letter-toggle-header-field-display 'long)) | |
2079 (beginning-of-line 2))))) | |
2080 | |
2081 (defun mh-interactive-read-address (prompt) | |
2082 "Read an address. | |
2083 If `mh-compose-prompt-flag' is non-nil, then read an address with | |
2084 PROMPT. | |
2085 Otherwise return the empty string." | |
2086 (if mh-compose-prompt-flag (mh-read-address prompt) "")) | |
2087 | |
2088 (defun mh-interactive-read-string (prompt) | |
2089 "Read a string. | |
2090 If `mh-compose-prompt-flag' is non-nil, then read a string with | |
2091 PROMPT. | |
2092 Otherwise return the empty string." | |
2093 (if mh-compose-prompt-flag (read-string prompt) "")) | |
2094 | |
2095 (defun mh-letter-adjust-point () | |
2096 "Move cursor to first header field if are using the no prompt mode." | |
2097 (unless mh-compose-prompt-flag | |
2098 (goto-char (point-max)) | |
2099 (mh-letter-next-header-field))) | |
2100 | |
2101 | |
2102 | |
2103 ;;; Build mh-letter-mode keymap | |
2104 | |
2105 ;; If this changes, modify mh-letter-mode-help-messages accordingly, above. | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
2106 (gnus-define-keys mh-letter-mode-map |
88155 | 2107 " " mh-letter-complete-or-space |
2108 "," mh-letter-confirm-address | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
2109 "\C-c?" mh-help |
88155 | 2110 "\C-c\C-\\" mh-fully-kill-draft ;if no C-q |
2111 "\C-c\C-^" mh-insert-signature ;if no C-s | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
2112 "\C-c\C-c" mh-send-letter |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
2113 "\C-c\C-d" mh-insert-identity |
88155 | 2114 "\C-c\C-e" mh-mh-to-mime |
2115 "\C-c\C-f\C-a" mh-to-field | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
2116 "\C-c\C-f\C-b" mh-to-field |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
2117 "\C-c\C-f\C-c" mh-to-field |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
2118 "\C-c\C-f\C-d" mh-to-field |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
2119 "\C-c\C-f\C-f" mh-to-fcc |
88155 | 2120 "\C-c\C-f\C-l" mh-to-field |
2121 "\C-c\C-f\C-m" mh-to-field | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
2122 "\C-c\C-f\C-r" mh-to-field |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
2123 "\C-c\C-f\C-s" mh-to-field |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
2124 "\C-c\C-f\C-t" mh-to-field |
88155 | 2125 "\C-c\C-fa" mh-to-field |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
2126 "\C-c\C-fb" mh-to-field |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
2127 "\C-c\C-fc" mh-to-field |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
2128 "\C-c\C-fd" mh-to-field |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
2129 "\C-c\C-ff" mh-to-fcc |
88155 | 2130 "\C-c\C-fl" mh-to-field |
2131 "\C-c\C-fm" mh-to-field | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
2132 "\C-c\C-fr" mh-to-field |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
2133 "\C-c\C-fs" mh-to-field |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
2134 "\C-c\C-ft" mh-to-field |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
2135 "\C-c\C-i" mh-insert-letter |
88155 | 2136 "\C-c\C-m\C-e" mh-mml-secure-message-encrypt |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
2137 "\C-c\C-m\C-f" mh-compose-forward |
88155 | 2138 "\C-c\C-m\C-g" mh-mh-compose-anon-ftp |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
2139 "\C-c\C-m\C-i" mh-compose-insertion |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
2140 "\C-c\C-m\C-m" mh-mml-to-mime |
88155 | 2141 "\C-c\C-m\C-n" mh-mml-unsecure-message |
2142 "\C-c\C-m\C-s" mh-mml-secure-message-sign | |
2143 "\C-c\C-m\C-t" mh-mh-compose-external-compressed-tar | |
2144 "\C-c\C-m\C-u" mh-mh-to-mime-undo | |
2145 "\C-c\C-m\C-x" mh-mh-compose-external-type | |
2146 "\C-c\C-mee" mh-mml-secure-message-encrypt | |
2147 "\C-c\C-mes" mh-mml-secure-message-signencrypt | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
2148 "\C-c\C-mf" mh-compose-forward |
88155 | 2149 "\C-c\C-mg" mh-mh-compose-anon-ftp |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
2150 "\C-c\C-mi" mh-compose-insertion |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
2151 "\C-c\C-mm" mh-mml-to-mime |
88155 | 2152 "\C-c\C-mn" mh-mml-unsecure-message |
2153 "\C-c\C-mse" mh-mml-secure-message-signencrypt | |
2154 "\C-c\C-mss" mh-mml-secure-message-sign | |
2155 "\C-c\C-mt" mh-mh-compose-external-compressed-tar | |
2156 "\C-c\C-mu" mh-mh-to-mime-undo | |
2157 "\C-c\C-mx" mh-mh-compose-external-type | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
2158 "\C-c\C-o" mh-open-line |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
2159 "\C-c\C-q" mh-fully-kill-draft |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
2160 "\C-c\C-s" mh-insert-signature |
88155 | 2161 "\C-c\C-t" mh-letter-toggle-header-field-display |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
2162 "\C-c\C-w" mh-check-whom |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
2163 "\C-c\C-y" mh-yank-cur-msg |
88155 | 2164 "\C-c\M-d" mh-insert-auto-fields |
2165 "\M-\t" mh-letter-complete | |
2166 "\t" mh-letter-next-header-field-or-indent | |
2167 [backtab] mh-letter-previous-header-field) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
2168 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
2169 ;; "C-c /" prefix is used in mh-letter-mode by pgp.el and mailcrypt.el. |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
2170 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
2171 (provide 'mh-comp) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
2172 |
88155 | 2173 ;; Local Variables: |
2174 ;; indent-tabs-mode: nil | |
2175 ;; sentence-end-double-space: nil | |
2176 ;; End: | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
2177 |
88155 | 2178 ;; arch-tag: 62865511-e610-4923-b0b5-f45a8ab70a34 |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
2179 ;;; mh-comp.el ends here |