Mercurial > emacs
annotate lisp/mh-e/mh-comp.el @ 94733:67bcaf883753
(define-abbrev-table): Don't use `iff' in docstring.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Thu, 08 May 2008 03:35:38 +0000 |
parents | 90c9ebd43589 |
children | c12a32810ea6 |
rev | line source |
---|---|
68465 | 1 ;;; mh-comp.el --- MH-E functions for composing and sending messages |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
2 |
62847
aa8c2e12ee24
Upgraded to MH-E version 7.84.
Bill Wohler <wohler@newt.com>
parents:
62465
diff
changeset
|
3 ;; Copyright (C) 1993, 1995, 1997, |
79713 | 4 ;; 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 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 |
94663
90c9ebd43589
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
92126
diff
changeset
|
13 ;; GNU Emacs is free software: you can redistribute it and/or modify |
49459
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 |
94663
90c9ebd43589
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
92126
diff
changeset
|
15 ;; the Free Software Foundation, either version 3 of the License, or |
90c9ebd43589
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
92126
diff
changeset
|
16 ;; (at your option) any later version. |
49459
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 |
94663
90c9ebd43589
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
92126
diff
changeset
|
24 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
25 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
26 ;;; Commentary: |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
27 |
68465 | 28 ;; This file includes the functions in the MH-Folder maps that get us |
29 ;; into MH-Letter mode, as well the functions in the MH-Letter mode | |
30 ;; that are used to send the mail. Other that those, functions that | |
31 ;; are needed in mh-letter.el should be found there. | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
32 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
33 ;;; Change Log: |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
34 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
35 ;;; Code: |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
36 |
68096
57c4e7929f99
* mh-alias.el (mh-alias-gecos-name): Use replace-regexp-in-string
Bill Wohler <wohler@newt.com>
parents:
68013
diff
changeset
|
37 (require 'mh-e) |
68465 | 38 (require 'mh-gnus) ;needed because mh-gnus.el not compiled |
39 (require 'mh-scan) | |
68096
57c4e7929f99
* mh-alias.el (mh-alias-gecos-name): Use replace-regexp-in-string
Bill Wohler <wohler@newt.com>
parents:
68013
diff
changeset
|
40 |
68465 | 41 (require 'sendmail) |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
42 |
68465 | 43 (autoload 'easy-menu-add "easymenu") |
44 (autoload 'mml-insert-tag "mml") | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
45 |
67681 | 46 |
47 | |
68465 | 48 ;;; Site Customization |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
49 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
50 (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
|
51 "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
|
52 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
|
53 |
71352
3b4c4b0d5eef
(mh-send-uses-spost): New variable.
Bill Wohler <wohler@newt.com>
parents:
70062
diff
changeset
|
54 (defvar mh-send-uses-spost-flag nil |
3b4c4b0d5eef
(mh-send-uses-spost): New variable.
Bill Wohler <wohler@newt.com>
parents:
70062
diff
changeset
|
55 "Non-nil means \"send\" uses \"spost\" to submit messages. |
3b4c4b0d5eef
(mh-send-uses-spost): New variable.
Bill Wohler <wohler@newt.com>
parents:
70062
diff
changeset
|
56 |
3b4c4b0d5eef
(mh-send-uses-spost): New variable.
Bill Wohler <wohler@newt.com>
parents:
70062
diff
changeset
|
57 If the value of \"postproc:\" is \"spost\", you may need to set |
3b4c4b0d5eef
(mh-send-uses-spost): New variable.
Bill Wohler <wohler@newt.com>
parents:
70062
diff
changeset
|
58 this variable to t to tell MH-E to avoid using features of |
3b4c4b0d5eef
(mh-send-uses-spost): New variable.
Bill Wohler <wohler@newt.com>
parents:
70062
diff
changeset
|
59 \"post\" that are not supported by \"spost\". You'll know that |
3b4c4b0d5eef
(mh-send-uses-spost): New variable.
Bill Wohler <wohler@newt.com>
parents:
70062
diff
changeset
|
60 you'll need to do this if sending mail fails with an error of |
3b4c4b0d5eef
(mh-send-uses-spost): New variable.
Bill Wohler <wohler@newt.com>
parents:
70062
diff
changeset
|
61 \"spost: -msgid unknown\".") |
3b4c4b0d5eef
(mh-send-uses-spost): New variable.
Bill Wohler <wohler@newt.com>
parents:
70062
diff
changeset
|
62 |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
63 (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
|
64 "If non-nil redist will be done in background like send. |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
65 This allows transaction log to be visible if -watch, -verbose or |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
66 -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
|
67 |
67681 | 68 |
69 | |
68465 | 70 ;;; Variables |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
71 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
72 (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
|
73 "Name of file to be used as a skeleton for composing messages. |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
74 |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
75 Default is \"components\". |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
76 |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
77 If not an absolute file name, the file is searched for first in the |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
78 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
|
79 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
80 (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
|
81 "Name of file to be used as a skeleton for replying to messages. |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
82 |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
83 Default is \"replcomps\". |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
84 |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
85 If not an absolute file name, the file is searched for first in the |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
86 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
|
87 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
88 (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
|
89 "Name of file to be used as a skeleton for replying to messages. |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
90 |
56673
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
91 Default is \"replgroupcomps\". |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
92 |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
93 This file is used to form replies to the sender and all recipients of |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
94 a message. Only used if `(mh-variant-p 'nmh)' is non-nil. |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
95 If not an absolute file name, the file is searched for first in the |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
96 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
|
97 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
98 (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
|
99 (format "^%s$" |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
100 (regexp-opt |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
101 '("Content-Type: message/rfc822" ;MIME MDN |
56673
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
102 "------ This is a copy of the message, including all the headers. ------";from exim |
68465 | 103 "--- 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
|
104 " ----- 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
|
105 " --------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
|
106 " ----- 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
|
107 "------- 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
|
108 "---------- 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
|
109 " --- 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
|
110 " 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
|
111 "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
|
112 )))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
113 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
114 (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
|
115 "^Date:\\|^Received:\\|^Message-Id:\\|^From:\\|^Sender:\\|^Errors-To:\\|^Delivery-Date:\\|^Return-Path:" |
67760
9c3504ae6060
Follow MH-E Developers Guide conventions. Use `' quotes for Help
Bill Wohler <wohler@newt.com>
parents:
67759
diff
changeset
|
116 "Regexp of header lines to remove before offering a message as a new draft\\<mh-folder-mode-map>. |
9c3504ae6060
Follow MH-E Developers Guide conventions. Use `' quotes for Help
Bill Wohler <wohler@newt.com>
parents:
67759
diff
changeset
|
117 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
|
118 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
119 (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
|
120 "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
|
121 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
122 (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
|
123 () |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
124 (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
|
125 (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
|
126 (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
|
127 |
73129
6478736310c3
mh-comp.el (mh-send-args): Initialize to "" instead of nil
Stephen Gildea <gildea@stop.mail-abuse.org>
parents:
71352
diff
changeset
|
128 (defvar 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
|
129 "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
|
130 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
131 (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
|
132 "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
|
133 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
134 (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
|
135 "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
|
136 |
82839
af7dc7457402
add mh-annotate-msg-hook
Stephen Gildea <gildea@stop.mail-abuse.org>
parents:
82478
diff
changeset
|
137 (defvar mh-annotate-list nil |
af7dc7457402
add mh-annotate-msg-hook
Stephen Gildea <gildea@stop.mail-abuse.org>
parents:
82478
diff
changeset
|
138 "Messages annotated, either a sequence name or a list of message numbers. |
af7dc7457402
add mh-annotate-msg-hook
Stephen Gildea <gildea@stop.mail-abuse.org>
parents:
82478
diff
changeset
|
139 This variable can be used by `mh-annotate-msg-hook'.") |
af7dc7457402
add mh-annotate-msg-hook
Stephen Gildea <gildea@stop.mail-abuse.org>
parents:
82478
diff
changeset
|
140 |
56406
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
141 (defvar mh-insert-auto-fields-done-local nil |
56673
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
142 "Buffer-local variable set when `mh-insert-auto-fields' called successfully.") |
56406
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
143 (make-variable-buffer-local 'mh-insert-auto-fields-done-local) |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
144 |
68465 | 145 |
146 | |
147 ;;; MH-E Entry Points | |
148 | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
149 ;;;###autoload |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
150 (defun mh-smail () |
66626
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
151 "Compose a message with the MH mail system. |
56673
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
152 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
|
153 (interactive) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
154 (mh-find-path) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
155 (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
|
156 |
66626
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
157 ;;;###autoload |
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
158 (defun mh-smail-other-window () |
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
159 "Compose a message with the MH mail system in other window. |
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
160 See `mh-send' for more details on composing mail." |
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
161 (interactive) |
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
162 (mh-find-path) |
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
163 (call-interactively 'mh-send-other-window)) |
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
164 |
68465 | 165 (defun mh-send-other-window (to cc subject) |
166 "Compose a message in another window. | |
167 | |
168 See `mh-send' for more information and a description of how the | |
169 TO, CC, and SUBJECT arguments are used." | |
170 (interactive (list | |
171 (mh-interactive-read-address "To: ") | |
172 (mh-interactive-read-address "Cc: ") | |
173 (mh-interactive-read-string "Subject: "))) | |
174 (let ((pop-up-windows t)) | |
175 (mh-send-sub to cc subject (current-window-configuration)))) | |
176 | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
177 (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
|
178 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
179 ;;;###autoload |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
180 (defun mh-smail-batch (&optional to subject other-headers &rest ignored) |
66626
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
181 "Compose a message with the MH mail system. |
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
182 |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
183 This function does not prompt the user for any header fields, and |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
184 thus is suitable for use by programs that want to create a mail |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
185 buffer. Users should use \\[mh-smail] to compose mail. |
56673
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
186 |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
187 Optional arguments for setting certain fields include TO, |
67886
b98e23ab1402
* simple.el (mh-e-user-agent): Move to mh-e/mh-comp.el and autoload.
Bill Wohler <wohler@newt.com>
parents:
67760
diff
changeset
|
188 SUBJECT, and OTHER-HEADERS. Additional arguments are IGNORED. |
b98e23ab1402
* simple.el (mh-e-user-agent): Move to mh-e/mh-comp.el and autoload.
Bill Wohler <wohler@newt.com>
parents:
67760
diff
changeset
|
189 |
b98e23ab1402
* simple.el (mh-e-user-agent): Move to mh-e/mh-comp.el and autoload.
Bill Wohler <wohler@newt.com>
parents:
67760
diff
changeset
|
190 This function remains for Emacs 21 compatibility. New |
b98e23ab1402
* simple.el (mh-e-user-agent): Move to mh-e/mh-comp.el and autoload.
Bill Wohler <wohler@newt.com>
parents:
67760
diff
changeset
|
191 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
|
192 (mh-find-path) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
193 (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
|
194 (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
|
195 |
67886
b98e23ab1402
* simple.el (mh-e-user-agent): Move to mh-e/mh-comp.el and autoload.
Bill Wohler <wohler@newt.com>
parents:
67760
diff
changeset
|
196 ;;;###autoload |
b98e23ab1402
* simple.el (mh-e-user-agent): Move to mh-e/mh-comp.el and autoload.
Bill Wohler <wohler@newt.com>
parents:
67760
diff
changeset
|
197 (define-mail-user-agent 'mh-e-user-agent |
b98e23ab1402
* simple.el (mh-e-user-agent): Move to mh-e/mh-comp.el and autoload.
Bill Wohler <wohler@newt.com>
parents:
67760
diff
changeset
|
198 'mh-user-agent-compose 'mh-send-letter 'mh-fully-kill-draft |
b98e23ab1402
* simple.el (mh-e-user-agent): Move to mh-e/mh-comp.el and autoload.
Bill Wohler <wohler@newt.com>
parents:
67760
diff
changeset
|
199 'mh-before-send-letter-hook) |
b98e23ab1402
* simple.el (mh-e-user-agent): Move to mh-e/mh-comp.el and autoload.
Bill Wohler <wohler@newt.com>
parents:
67760
diff
changeset
|
200 |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
201 ;;;###autoload |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
202 (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
|
203 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
|
204 send-actions) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
205 "Set up mail composition draft with the MH mail system. |
67886
b98e23ab1402
* simple.el (mh-e-user-agent): Move to mh-e/mh-comp.el and autoload.
Bill Wohler <wohler@newt.com>
parents:
67760
diff
changeset
|
206 This is the `mail-user-agent' entry point to MH-E. This function |
b98e23ab1402
* simple.el (mh-e-user-agent): Move to mh-e/mh-comp.el and autoload.
Bill Wohler <wohler@newt.com>
parents:
67760
diff
changeset
|
207 conforms to the contract specified by `define-mail-user-agent' |
b98e23ab1402
* simple.el (mh-e-user-agent): Move to mh-e/mh-comp.el and autoload.
Bill Wohler <wohler@newt.com>
parents:
67760
diff
changeset
|
208 which means that this function should accept the same arguments |
b98e23ab1402
* simple.el (mh-e-user-agent): Move to mh-e/mh-comp.el and autoload.
Bill Wohler <wohler@newt.com>
parents:
67760
diff
changeset
|
209 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
|
210 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
211 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
|
212 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
|
213 |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
214 OTHER-HEADERS is an alist specifying additional header fields. |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
215 Elements look like (HEADER . VALUE) where both HEADER and VALUE |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
216 are strings. |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
217 |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
218 CONTINUE, SWITCH-FUNCTION, YANK-ACTION and SEND-ACTIONS are |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
219 ignored." |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
220 (mh-find-path) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
221 (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
|
222 (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
|
223 (while other-headers |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
224 (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
|
225 (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
|
226 (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
|
227 |
68465 | 228 ;; Shush compiler. |
70028
d81780942bb8
* mh-acros.el (struct, x, y): No need to wrap defvar with
Bill Wohler <wohler@newt.com>
parents:
69575
diff
changeset
|
229 (defvar sendmail-coding-system) ; XEmacs |
68465 | 230 |
231 ;;;###autoload | |
232 (defun mh-send-letter (&optional arg) | |
233 "Save draft and send message. | |
234 | |
235 When you are all through editing a message, you send it with this | |
236 command. You can give a prefix argument ARG to monitor the first stage | |
237 of the delivery\; this output can be found in a buffer called \"*MH-E | |
238 Mail Delivery*\". | |
239 | |
240 The hook `mh-before-send-letter-hook' is run at the beginning of | |
241 this command. For example, if you want to check your spelling in | |
242 your message before sending, add the function `ispell-message'. | |
243 | |
69272
cc66ebd3f3a4
(mh-send-letter, mh-insert-auto-fields): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents:
68529
diff
changeset
|
244 Unless `mh-insert-auto-fields' had previously been called |
cc66ebd3f3a4
(mh-send-letter, mh-insert-auto-fields): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents:
68529
diff
changeset
|
245 manually, the function `mh-insert-auto-fields' is called to |
cc66ebd3f3a4
(mh-send-letter, mh-insert-auto-fields): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents:
68529
diff
changeset
|
246 insert fields based upon the recipients. If fields are added, you |
cc66ebd3f3a4
(mh-send-letter, mh-insert-auto-fields): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents:
68529
diff
changeset
|
247 are given a chance to see and to confirm these fields before the |
cc66ebd3f3a4
(mh-send-letter, mh-insert-auto-fields): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents:
68529
diff
changeset
|
248 message is actually sent. You can do away with this confirmation |
cc66ebd3f3a4
(mh-send-letter, mh-insert-auto-fields): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents:
68529
diff
changeset
|
249 by turning off the option `mh-auto-fields-prompt-flag'. |
cc66ebd3f3a4
(mh-send-letter, mh-insert-auto-fields): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents:
68529
diff
changeset
|
250 |
68465 | 251 In case the MH \"send\" program is installed under a different name, |
252 use `mh-send-prog' to tell MH-E the name." | |
253 (interactive "P") | |
254 (run-hooks 'mh-before-send-letter-hook) | |
255 (if (and (mh-insert-auto-fields t) | |
256 mh-auto-fields-prompt-flag | |
257 (goto-char (point-min))) | |
258 (if (not (y-or-n-p "Auto fields inserted, send? ")) | |
259 (error "Send aborted"))) | |
260 (cond ((mh-mh-directive-present-p) | |
261 (mh-mh-to-mime)) | |
262 ((or (mh-mml-tag-present-p) (not (mh-ascii-buffer-p))) | |
263 (mh-mml-to-mime))) | |
264 (save-buffer) | |
265 (message "Sending...") | |
266 (let ((draft-buffer (current-buffer)) | |
267 (file-name buffer-file-name) | |
268 (config mh-previous-window-config) | |
269 (coding-system-for-write | |
270 (if (and (local-variable-p 'buffer-file-coding-system | |
271 (current-buffer)) ;XEmacs needs two args | |
272 ;; We're not sure why, but buffer-file-coding-system | |
273 ;; tends to get set to undecided-unix. | |
274 (not (memq buffer-file-coding-system | |
275 '(undecided undecided-unix undecided-dos)))) | |
276 buffer-file-coding-system | |
277 (or (and (boundp 'sendmail-coding-system) sendmail-coding-system) | |
278 (and (boundp 'default-buffer-file-coding-system ) | |
279 default-buffer-file-coding-system) | |
280 'iso-latin-1)))) | |
71352
3b4c4b0d5eef
(mh-send-uses-spost): New variable.
Bill Wohler <wohler@newt.com>
parents:
70062
diff
changeset
|
281 ;; Older versions of spost do not support -msgid and -mime. |
3b4c4b0d5eef
(mh-send-uses-spost): New variable.
Bill Wohler <wohler@newt.com>
parents:
70062
diff
changeset
|
282 (unless mh-send-uses-spost-flag |
3b4c4b0d5eef
(mh-send-uses-spost): New variable.
Bill Wohler <wohler@newt.com>
parents:
70062
diff
changeset
|
283 ;; Adding a Message-ID field looks good, makes it easier to search for |
3b4c4b0d5eef
(mh-send-uses-spost): New variable.
Bill Wohler <wohler@newt.com>
parents:
70062
diff
changeset
|
284 ;; message in your +outbox, and best of all doesn't break threading for |
3b4c4b0d5eef
(mh-send-uses-spost): New variable.
Bill Wohler <wohler@newt.com>
parents:
70062
diff
changeset
|
285 ;; the recipient if you reply to a message in your +outbox. |
3b4c4b0d5eef
(mh-send-uses-spost): New variable.
Bill Wohler <wohler@newt.com>
parents:
70062
diff
changeset
|
286 (setq mh-send-args (concat "-msgid " mh-send-args)) |
3b4c4b0d5eef
(mh-send-uses-spost): New variable.
Bill Wohler <wohler@newt.com>
parents:
70062
diff
changeset
|
287 ;; The default BCC encapsulation will make a MIME message unreadable. |
3b4c4b0d5eef
(mh-send-uses-spost): New variable.
Bill Wohler <wohler@newt.com>
parents:
70062
diff
changeset
|
288 ;; With nmh use the -mime arg to prevent this. |
3b4c4b0d5eef
(mh-send-uses-spost): New variable.
Bill Wohler <wohler@newt.com>
parents:
70062
diff
changeset
|
289 (if (and (mh-variant-p 'nmh) |
3b4c4b0d5eef
(mh-send-uses-spost): New variable.
Bill Wohler <wohler@newt.com>
parents:
70062
diff
changeset
|
290 (mh-goto-header-field "Bcc:") |
3b4c4b0d5eef
(mh-send-uses-spost): New variable.
Bill Wohler <wohler@newt.com>
parents:
70062
diff
changeset
|
291 (mh-goto-header-field "Content-Type:")) |
3b4c4b0d5eef
(mh-send-uses-spost): New variable.
Bill Wohler <wohler@newt.com>
parents:
70062
diff
changeset
|
292 (setq mh-send-args (concat "-mime " mh-send-args)))) |
68465 | 293 (cond (arg |
294 (pop-to-buffer mh-mail-delivery-buffer) | |
295 (erase-buffer) | |
92126
e4406f235887
(mh-send-letter): Call split-string on mh-send-args when sending
Bill Wohler <wohler@newt.com>
parents:
91945
diff
changeset
|
296 (mh-exec-cmd-output mh-send-prog t |
e4406f235887
(mh-send-letter): Call split-string on mh-send-args when sending
Bill Wohler <wohler@newt.com>
parents:
91945
diff
changeset
|
297 "-nodraftfolder" "-watch" "-nopush" |
e4406f235887
(mh-send-letter): Call split-string on mh-send-args when sending
Bill Wohler <wohler@newt.com>
parents:
91945
diff
changeset
|
298 (split-string mh-send-args) file-name) |
68465 | 299 (goto-char (point-max)) ; show the interesting part |
300 (recenter -1) | |
301 (set-buffer draft-buffer)) ; for annotation below | |
302 (t | |
92126
e4406f235887
(mh-send-letter): Call split-string on mh-send-args when sending
Bill Wohler <wohler@newt.com>
parents:
91945
diff
changeset
|
303 (mh-exec-cmd-daemon mh-send-prog nil |
e4406f235887
(mh-send-letter): Call split-string on mh-send-args when sending
Bill Wohler <wohler@newt.com>
parents:
91945
diff
changeset
|
304 "-nodraftfolder" "-noverbose" |
69520
67b5315387f4
(mh-send-letter): Use split-string to break up mh-send-args (closes SF
Bill Wohler <wohler@newt.com>
parents:
69272
diff
changeset
|
305 (split-string mh-send-args) file-name))) |
68465 | 306 (if mh-annotate-char |
307 (mh-annotate-msg mh-sent-from-msg | |
308 mh-sent-from-folder | |
309 mh-annotate-char | |
310 "-component" mh-annotate-field | |
311 "-text" (format "\"%s %s\"" | |
312 (mh-get-header-field "To:") | |
313 (mh-get-header-field "Cc:")))) | |
314 | |
315 (cond ((or (not arg) | |
316 (y-or-n-p "Kill draft buffer? ")) | |
317 (kill-buffer draft-buffer) | |
318 (if config | |
319 (set-window-configuration config)))) | |
320 (if arg | |
321 (message "Sending...done") | |
322 (message "Sending...backgrounded")))) | |
323 | |
324 ;;;###autoload | |
325 (defun mh-fully-kill-draft () | |
326 "Quit editing and delete draft message. | |
327 | |
328 If for some reason you are not happy with the draft, you can use | |
329 this command to kill the draft buffer and delete the draft | |
330 message. Use the command \\[kill-buffer] if you don't want to | |
331 delete the draft message." | |
332 (interactive) | |
333 (if (y-or-n-p "Kill draft message? ") | |
334 (let ((config mh-previous-window-config)) | |
335 (if (file-exists-p buffer-file-name) | |
336 (delete-file buffer-file-name)) | |
337 (set-buffer-modified-p nil) | |
338 (kill-buffer (buffer-name)) | |
339 (message "") | |
340 (if config | |
341 (set-window-configuration config))) | |
342 (error "Message not killed"))) | |
343 | |
344 | |
345 | |
346 ;;; MH-Folder Commands | |
347 | |
348 ;; Alphabetical. | |
349 | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
350 ;;;###mh-autoload |
66626
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
351 (defun mh-edit-again (message) |
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
352 "Edit a MESSAGE to send it again. |
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
353 |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
354 If you don't complete a draft for one reason or another, and if |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
355 the draft buffer is no longer available, you can pick your draft |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
356 up again with this command. If you don't use a draft folder, your |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
357 last \"draft\" file will be used. If you use draft folders, |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
358 you'll need to visit the draft folder with \"\\[mh-visit-folder] |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
359 drafts <RET>\", use \\[mh-next-undeleted-msg] to move to the |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
360 appropriate message, and then use \\[mh-edit-again] to prepare |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
361 the message for editing. |
66626
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
362 |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
363 This command can also be used to take messages that were sent to |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
364 you and to send them to more people. |
66626
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
365 |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
366 Don't use this command to re-edit a message from a Mailer-Daemon |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
367 who complained that your mail wasn't posted for some reason or |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
368 another (see `mh-extract-rejected-mail'). |
66626
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
369 |
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
370 The default message is the current message. |
56673
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
371 |
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
372 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
|
373 (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
|
374 (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
|
375 (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
|
376 (draft |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
377 (cond ((and mh-draft-folder (equal from-folder mh-draft-folder)) |
66626
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
378 (pop-to-buffer (find-file-noselect (mh-msg-filename message)) |
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
379 t) |
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
380 (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
|
381 ;; Make buffer writable... |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
382 (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
|
383 ;; 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
|
384 ;; from file... |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
385 (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
|
386 (erase-buffer) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
387 (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
|
388 (buffer-name)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
389 (t |
66626
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
390 (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
|
391 (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
|
392 (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
|
393 (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
|
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 (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
|
396 config) |
56406
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
397 (mh-letter-mode-message) |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
398 (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
|
399 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
400 ;;;###mh-autoload |
66626
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
401 (defun mh-extract-rejected-mail (message) |
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
402 "Edit a MESSAGE that was returned by the mail system. |
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
403 |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
404 This command prepares the message for editing by removing the |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
405 Mailer-Daemon envelope and unneeded header fields. Fix whatever |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
406 addressing problem you had, and send the message again with |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
407 \\[mh-send-letter]. |
66626
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
408 |
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
409 The default message is the current message. |
56673
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
410 |
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
411 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
|
412 (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
|
413 (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
|
414 (config (current-window-configuration)) |
66626
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
415 (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
|
416 (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
|
417 (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
|
418 (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
|
419 (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
|
420 (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
|
421 (t |
56673
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
422 (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
|
423 (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
|
424 (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
|
425 (save-buffer) |
66626
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
426 (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
|
427 (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
|
428 (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
|
429 (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
|
430 nil nil config) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
431 (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
|
432 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
433 ;;;###mh-autoload |
56406
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
434 (defun mh-forward (to cc &optional range) |
67313
2ae99b10dd40
* mh-comp.el (mh-forward): Went over all uses of the word "RANGE" in
Bill Wohler <wohler@newt.com>
parents:
67246
diff
changeset
|
435 "Forward message. |
66626
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
436 |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
437 You are prompted for the TO and CC recipients. You are given a |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
438 draft to edit that looks like it would if you had run the MH |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
439 command \"forw\". You can then add some text. |
56406
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
440 |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
441 You can forward several messages by using a RANGE. All of the |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
442 messages in the range are inserted into your draft. Check the |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
443 documentation of `mh-interactive-range' to see how RANGE is read |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
444 in interactive use. |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
445 |
67756
7ff92ad99326
* mh-alias.el (mh-alias-reload): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents:
67681
diff
changeset
|
446 The hook `mh-forward-hook' is called on the draft. |
7ff92ad99326
* mh-alias.el (mh-alias-reload): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents:
67681
diff
changeset
|
447 |
7ff92ad99326
* mh-alias.el (mh-alias-reload): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents:
67681
diff
changeset
|
448 See also `mh-compose-forward-as-mime-flag', |
7ff92ad99326
* mh-alias.el (mh-alias-reload): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents:
67681
diff
changeset
|
449 `mh-forward-subject-format', and `mh-send'." |
56406
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
450 (interactive (list (mh-interactive-read-address "To: ") |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
451 (mh-interactive-read-address "Cc: ") |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
452 (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
|
453 (let* ((folder mh-current-folder) |
56406
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
454 (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
|
455 (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
|
456 (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
|
457 ;; 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
|
458 (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
|
459 (draft (cond ((or (not (file-exists-p draft-name)) |
68133
fc48ac700159
(mh-forward): Cosmetics on prompt when draft exists.
Bill Wohler <wohler@newt.com>
parents:
68130
diff
changeset
|
460 (y-or-n-p "The file draft exists; discard it? ")) |
56673
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
461 (mh-exec-cmd "forw" "-build" |
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
462 (if (and (mh-variant-p 'nmh) |
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
463 mh-compose-forward-as-mime-flag) |
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
464 "-mime") |
50702
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
465 mh-current-folder |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
466 (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
|
467 (prog1 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
468 (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
|
469 (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
|
470 (save-buffer))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
471 (t |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
472 (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
|
473 (let (orig-from |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
474 orig-subject) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
475 (save-excursion |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
476 (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
|
477 (erase-buffer) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
478 (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
|
479 (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
|
480 (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
|
481 (let ((forw-subject |
50702
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
482 (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
|
483 (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
|
484 (goto-char (point-min)) |
66354
cf99ce27df54
* mh-comp.el (mh-letter-menu): Rename
Bill Wohler <wohler@newt.com>
parents:
66138
diff
changeset
|
485 ;; If using MML, translate MH-style directive |
cf99ce27df54
* mh-comp.el (mh-letter-menu): Rename
Bill Wohler <wohler@newt.com>
parents:
66138
diff
changeset
|
486 (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
|
487 (save-excursion |
56406
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
488 (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
|
489 (while |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
490 (re-search-forward |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
491 "^#forw \\[\\([^]]+\\)\\] \\(+\\S-+\\) \\(.*\\)$" |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
492 (point-max) t) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
493 (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
|
494 "forwarded messages") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
495 "forwarded message %d" |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
496 (match-string 1))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
497 (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
|
498 (i 0)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
499 (beginning-of-line) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
500 (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
|
501 (dolist (msg msgs) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
502 (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
|
503 (mh-mml-forward-message (format description i) |
82478
6cd0b704b471
(mh-forward): Address SF 1730393. When forwarding
Jeffrey C Honig <jch@bsdi.com>
parents:
78231
diff
changeset
|
504 folder msg) |
6cd0b704b471
(mh-forward): Address SF 1730393. When forwarding
Jeffrey C Honig <jch@bsdi.com>
parents:
78231
diff
changeset
|
505 ;; Was inserted before us, move to end of file to preserve order |
6cd0b704b471
(mh-forward): Address SF 1730393. When forwarding
Jeffrey C Honig <jch@bsdi.com>
parents:
78231
diff
changeset
|
506 (goto-char (point-max))))))) |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
507 ;; 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
|
508 (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
|
509 (forward-line -1) |
56406
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
510 (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
|
511 (forward-line 1)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
512 (delete-other-windows) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
513 (mh-add-msgs-to-seq msgs 'forwarded t) |
50702
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
514 (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
|
515 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
|
516 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
|
517 config) |
56406
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
518 (mh-letter-mode-message) |
56673
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
519 (mh-letter-adjust-point) |
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
520 (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
|
521 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
522 (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
|
523 "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
|
524 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
|
525 (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
|
526 (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
|
527 (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
|
528 ;; 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
|
529 (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
|
530 (comment |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
531 ;; 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
|
532 (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
|
533 (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
|
534 |
66626
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
535 ;;;###mh-autoload |
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
536 (defun mh-redistribute (to cc &optional message) |
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
537 "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
|
538 |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
539 This command is similar in function to forwarding mail, but it |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
540 does not allow you to edit the message, nor does it add your name |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
541 to the \"From\" header field. It appears to the recipient as if |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
542 the message had come from the original sender. When you run this |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
543 command, you are prompted for the TO and CC recipients. The |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
544 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
|
545 |
67988
7882fc7df359
* mh-alias.el (mh-alias-grab-from-field): Remove leading * from
Bill Wohler <wohler@newt.com>
parents:
67886
diff
changeset
|
546 Also investigate the command \\[mh-edit-again] for another way to |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
547 redistribute messages. |
66626
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
548 |
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
549 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
|
550 (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
|
551 (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
|
552 (mh-get-msg-num t))) |
66626
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
553 (or message |
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
554 (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
|
555 (save-window-excursion |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
556 (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
|
557 (draft (mh-read-draft "redistribution" |
66626
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
558 (if mh-redist-full-contents-flag |
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
559 (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
|
560 nil) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
561 nil))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
562 (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
|
563 (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
|
564 (if (not (equal cc "")) (insert "Resent-cc: " cc "\n")) |
50702
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
565 (mh-clean-msg-header |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
566 (point-min) |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
567 "^Message-Id:\\|^Received:\\|^Return-Path:\\|^Sender:\\|^Date:\\|^From:" |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
568 nil) |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
569 (save-buffer) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
570 (message "Redistributing...") |
50702
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
571 (let ((env "mhdist=1")) |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
572 ;; Setup environment... |
66626
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
573 (setq env (concat env " mhaltmsg=" |
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
574 (if mh-redist-full-contents-flag |
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
575 buffer-file-name |
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
576 (mh-msg-filename message folder)))) |
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
577 (unless mh-redist-full-contents-flag |
50702
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
578 (setq env (concat env " mhannotate=1"))) |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
579 ;; Redistribute... |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
580 (if mh-redist-background |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
581 (mh-exec-cmd-env-daemon env mh-send-prog nil buffer-file-name) |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
582 (mh-exec-cmd-error env mh-send-prog "-push" buffer-file-name)) |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
583 ;; Annotate... |
66626
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
584 (mh-annotate-msg message folder mh-note-dist |
50702
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
585 "-component" "Resent:" |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
586 "-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
|
587 (kill-buffer draft) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
588 (message "Redistributing...done")))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
589 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
590 ;;;###mh-autoload |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
591 (defun mh-reply (message &optional reply-to includep) |
66626
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
592 "Reply to a MESSAGE. |
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
593 |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
594 When you reply to a message, you are first prompted with \"Reply |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
595 to whom?\" (unless the optional argument REPLY-TO is provided). |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
596 You have several choices here. |
66626
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
597 |
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
598 Response Reply Goes To |
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
599 |
69575
87709ba6191e
(mh-reply): Sync docstring with manual.
Bill Wohler <wohler@newt.com>
parents:
69520
diff
changeset
|
600 from The person who sent the message. This is the |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
601 default, so <RET> is sufficient. |
66626
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
602 |
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
603 to Replies to the sender, plus all recipients in the |
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
604 \"To:\" header field. |
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
605 |
69575
87709ba6191e
(mh-reply): Sync docstring with manual.
Bill Wohler <wohler@newt.com>
parents:
69520
diff
changeset
|
606 all cc Forms a reply to the addresses in the |
87709ba6191e
(mh-reply): Sync docstring with manual.
Bill Wohler <wohler@newt.com>
parents:
69520
diff
changeset
|
607 \"Mail-Followup-To:\" header field if one |
87709ba6191e
(mh-reply): Sync docstring with manual.
Bill Wohler <wohler@newt.com>
parents:
69520
diff
changeset
|
608 exists; otherwise forms a reply to the sender, |
87709ba6191e
(mh-reply): Sync docstring with manual.
Bill Wohler <wohler@newt.com>
parents:
69520
diff
changeset
|
609 plus all recipients. |
56673
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
610 |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
611 Depending on your answer, \"repl\" is given a different argument |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
612 to form your reply. Specifically, a choice of \"from\" or none at |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
613 all runs \"repl -nocc all\", and a choice of \"to\" runs \"repl |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
614 -cc to\". Finally, either \"cc\" or \"all\" runs \"repl -cc all |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
615 -nocc me\". |
66626
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
616 |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
617 Two windows are then created. One window contains the message to |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
618 which you are replying in an MH-Show buffer. Your draft, in |
69575
87709ba6191e
(mh-reply): Sync docstring with manual.
Bill Wohler <wohler@newt.com>
parents:
69520
diff
changeset
|
619 MH-Letter mode (*note `mh-letter-mode'), is in the other window. |
87709ba6191e
(mh-reply): Sync docstring with manual.
Bill Wohler <wohler@newt.com>
parents:
69520
diff
changeset
|
620 If the reply draft was not one that you expected, check the |
87709ba6191e
(mh-reply): Sync docstring with manual.
Bill Wohler <wohler@newt.com>
parents:
69520
diff
changeset
|
621 things that affect the behavior of \"repl\" which include the |
87709ba6191e
(mh-reply): Sync docstring with manual.
Bill Wohler <wohler@newt.com>
parents:
69520
diff
changeset
|
622 \"repl:\" profile component and the \"replcomps\" and |
87709ba6191e
(mh-reply): Sync docstring with manual.
Bill Wohler <wohler@newt.com>
parents:
69520
diff
changeset
|
623 \"replgroupcomps\" files. |
66626
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
624 |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
625 If you supply a prefix argument INCLUDEP, the message you are |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
626 replying to is inserted in your reply after having first been run |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
627 through \"mhl\" with the format file \"mhl.reply\". |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
628 |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
629 Alternatively, you can customize the option `mh-yank-behavior' |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
630 and choose one of its \"Automatically\" variants to do the same |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
631 thing. If you do so, the prefix argument has no effect. |
66626
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
632 |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
633 Another way to include the message automatically in your draft is |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
634 to use \"repl: -filter repl.filter\" in your MH profile. |
66626
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
635 |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
636 If you wish to customize the header or other parts of the reply |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
637 draft, please see \"repl\" and \"mh-format\". |
66626
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
638 |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
639 See also `mh-reply-show-message-flag', |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
640 `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
|
641 (interactive (list |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
642 (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
|
643 (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
|
644 "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
|
645 (or mh-reply-default-reply-to |
68012
256cc87e0619
* mh-comp.el (mh-reply): Use standard default notation in prompts
Bill Wohler <wohler@newt.com>
parents:
67988
diff
changeset
|
646 (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
|
647 '(("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
|
648 nil |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
649 t))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
650 current-prefix-arg)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
651 (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
|
652 (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
|
653 (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
|
654 (group-reply (or (equal reply-to "cc") (equal reply-to "all"))) |
56673
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
655 (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
|
656 (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
|
657 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
|
658 ((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
|
659 (t nil)))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
660 (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
|
661 (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
|
662 (if form-file |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
663 (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
|
664 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
|
665 (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
|
666 '("-nocc" "all")) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
667 ((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
|
668 '("-cc" "to")) |
56673
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
669 (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
|
670 '("-group" "-nocc" "me") |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
671 '("-cc" "all" "-nocc" "me")))) |
66354
cf99ce27df54
* mh-comp.el (mh-letter-menu): Rename
Bill Wohler <wohler@newt.com>
parents:
66138
diff
changeset
|
672 (cond ((or (eq mh-yank-behavior 'autosupercite) |
cf99ce27df54
* mh-comp.el (mh-letter-menu): Rename
Bill Wohler <wohler@newt.com>
parents:
66138
diff
changeset
|
673 (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
|
674 '("-noformat")) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
675 (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
|
676 (t '()))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
677 (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
|
678 (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
|
679 t))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
680 (delete-other-windows) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
681 (save-buffer) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49578
diff
changeset
|
682 |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
683 (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
|
684 (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
|
685 (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
|
686 (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
|
687 (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
|
688 (or includep |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
689 (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
|
690 (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
|
691 (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
|
692 (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
|
693 (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
|
694 (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
|
695 mh-note-repl "Replied:" config)) |
66354
cf99ce27df54
* mh-comp.el (mh-letter-menu): Rename
Bill Wohler <wohler@newt.com>
parents:
66138
diff
changeset
|
696 (when (and (or (eq 'autosupercite mh-yank-behavior) |
cf99ce27df54
* mh-comp.el (mh-letter-menu): Rename
Bill Wohler <wohler@newt.com>
parents:
66138
diff
changeset
|
697 (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
|
698 (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
|
699 (undo-boundary) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
700 (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
|
701 (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
|
702 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
703 ;;;###mh-autoload |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
704 (defun mh-send (to cc subject) |
66626
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
705 "Compose a message. |
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
706 |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
707 Your letter appears in an Emacs buffer whose mode is |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
708 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
|
709 |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
710 The arguments TO, CC, and SUBJECT can be used to prefill the |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
711 draft fields or suppress the prompts if `mh-compose-prompt-flag' |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
712 is on. They are also passed to the function set in the option |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
713 `mh-compose-letter-function'. |
66626
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
714 |
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
715 See also `mh-insert-x-mailer-flag' and `mh-letter-mode-hook'. |
8d60d23ffa33
* mh-comp.el (mh-redist-full-contents) Convert defvar to defcustom.
Bill Wohler <wohler@newt.com>
parents:
66518
diff
changeset
|
716 |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
717 Outside of an MH-Folder buffer (`mh-folder-mode'), you must call |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
718 either \\[mh-smail] or \\[mh-smail-other-window] to compose a new |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
719 message." |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
720 (interactive (list |
56406
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
721 (mh-interactive-read-address "To: ") |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
722 (mh-interactive-read-address "Cc: ") |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
723 (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
|
724 (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
|
725 (delete-other-windows) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
726 (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
|
727 |
68465 | 728 |
729 | |
730 ;;; Support Routines | |
731 | |
732 (defun mh-interactive-read-address (prompt) | |
733 "Read an address. | |
734 If `mh-compose-prompt-flag' is non-nil, then read an address with | |
735 PROMPT. | |
736 Otherwise return the empty string." | |
737 (if mh-compose-prompt-flag (mh-read-address prompt) "")) | |
738 | |
739 (defun mh-interactive-read-string (prompt) | |
740 "Read a string. | |
741 If `mh-compose-prompt-flag' is non-nil, then read a string with | |
742 PROMPT. | |
743 Otherwise return the empty string." | |
744 (if mh-compose-prompt-flag (read-string prompt) "")) | |
745 | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
746 ;;;###mh-autoload |
68465 | 747 (defun mh-show-buffer-message-number (&optional buffer) |
748 "Message number of displayed message in corresponding show buffer. | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
749 |
68465 | 750 Return nil if show buffer not displayed. |
751 If in `mh-letter-mode', don't display the message number being replied | |
752 to, but rather the message number of the show buffer associated with | |
753 our originating folder buffer. | |
754 Optional argument BUFFER can be used to specify the buffer." | |
755 (save-excursion | |
756 (if buffer | |
757 (set-buffer buffer)) | |
758 (cond ((eq major-mode 'mh-show-mode) | |
759 (let ((number-start (mh-search-from-end ?/ buffer-file-name))) | |
760 (string-to-number (substring buffer-file-name | |
761 (1+ number-start))))) | |
762 ((and (eq major-mode 'mh-folder-mode) | |
763 mh-show-buffer | |
764 (get-buffer mh-show-buffer)) | |
765 (mh-show-buffer-message-number mh-show-buffer)) | |
766 ((and (eq major-mode 'mh-letter-mode) | |
767 mh-sent-from-folder | |
768 (get-buffer mh-sent-from-folder)) | |
769 (mh-show-buffer-message-number mh-sent-from-folder)) | |
770 (t | |
771 nil)))) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
772 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
773 (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
|
774 "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
|
775 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
|
776 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
|
777 (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
|
778 (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
|
779 (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
|
780 (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
|
781 "message" |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
782 (let (components) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
783 (cond |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
784 ((file-exists-p |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
785 (setq components |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
786 (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
|
787 components) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
788 ((file-exists-p |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
789 (setq components |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
790 (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
|
791 components) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
792 (t |
68528
bd5e46db392c
(mh-send-sub): Don't find components file in current directory--this
Bill Wohler <wohler@newt.com>
parents:
68483
diff
changeset
|
793 (error "Can't find %s in %s or %s" |
bd5e46db392c
(mh-send-sub): Don't find components file in current directory--this
Bill Wohler <wohler@newt.com>
parents:
68483
diff
changeset
|
794 mh-comp-formfile mh-user-path mh-lib)))) |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
795 nil))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
796 (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
|
797 (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
|
798 (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
|
799 to subject cc |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
800 nil nil config) |
56406
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
801 (mh-letter-mode-message) |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
802 (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
|
803 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
804 (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
|
805 "Read draft file into a draft buffer and make that buffer the current one. |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
806 |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
807 USE is a message used for prompting about the intended use of the |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
808 message. |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
809 INITIAL-CONTENTS is filename that is read into an empty buffer, or nil |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
810 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
|
811 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
|
812 Returns the draft folder's name. |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
813 If the draft folder facility is enabled in ~/.mh_profile, a new buffer |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
814 is used each time and saved in the draft folder. The draft file can |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
815 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
|
816 (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
|
817 (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
|
818 (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
|
819 (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
|
820 (format "draft-%s" |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
821 (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
|
822 (condition-case () |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
823 (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
|
824 (file-error)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
825 (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
|
826 (t |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
827 (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
|
828 (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
|
829 (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
|
830 (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
|
831 (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
|
832 (error "Draft preserved"))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
833 (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
|
834 (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
|
835 (unlock-buffer) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
836 (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
|
837 (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
|
838 (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
|
839 (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
|
840 (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
|
841 (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
|
842 (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
|
843 (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
|
844 (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
|
845 (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
|
846 t))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
847 (erase-buffer) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
848 (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
|
849 (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
|
850 (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
|
851 (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
|
852 (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
|
853 (buffer-name)) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
854 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
855 (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
|
856 "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
|
857 (save-excursion |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
858 (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
|
859 (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
|
860 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
861 (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
|
862 "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
|
863 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
|
864 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
|
865 (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
|
866 (while name-values |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
867 (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
|
868 (value (car (cdr name-values)))) |
56673
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
869 (if (not (string-match "^.*:$" field-name)) |
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
870 (setq field-name (concat field-name ":"))) |
68476
a58223a143bc
(mh-insert-fields): Handle nil values. Rmail, at least, will deliver
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
871 (cond ((or (null value) |
a58223a143bc
(mh-insert-fields): Handle nil values. Rmail, at least, will deliver
Bill Wohler <wohler@newt.com>
parents:
68465
diff
changeset
|
872 (equal value "")) |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
873 nil) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
874 ((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
|
875 (insert " " (or value ""))) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
876 (t |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
877 (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
|
878 (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
|
879 |
68465 | 880 (defun mh-compose-and-send-mail (draft send-args |
881 sent-from-folder sent-from-msg | |
882 to subject cc | |
883 annotate-char annotate-field | |
884 config) | |
885 "Edit and compose a draft message in buffer DRAFT and send or save it. | |
886 SEND-ARGS is the argument passed to the send command. | |
887 SENT-FROM-FOLDER is buffer containing scan listing of current folder, | |
888 or nil if none exists. | |
889 SENT-FROM-MSG is the message number or sequence name or nil. | |
890 The TO, SUBJECT, and CC fields are passed to the | |
891 `mh-compose-letter-function'. | |
892 If ANNOTATE-CHAR is non-null, it is used to notate the scan listing of | |
893 the message. In that case, the ANNOTATE-FIELD is used to build a | |
894 string for `mh-annotate-msg'. | |
895 CONFIG is the window configuration to restore after sending the | |
896 letter." | |
897 (pop-to-buffer draft) | |
898 (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
|
899 |
68465 | 900 ;; Insert identity. |
901 (mh-insert-identity mh-identity-default t) | |
902 (mh-identity-make-menu) | |
903 (mh-identity-add-menu) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
904 |
68465 | 905 ;; Insert extra fields. |
906 (mh-insert-x-mailer) | |
907 (mh-insert-x-face) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
908 |
68465 | 909 (mh-letter-hide-all-skipped-fields) |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
910 |
68465 | 911 (setq mh-sent-from-folder sent-from-folder) |
912 (setq mh-sent-from-msg sent-from-msg) | |
913 (setq mh-send-args send-args) | |
914 (setq mh-annotate-char annotate-char) | |
915 (setq mh-annotate-field annotate-field) | |
916 (setq mh-previous-window-config config) | |
917 (setq mode-line-buffer-identification (list " {%b}")) | |
918 (mh-logo-display) | |
919 (mh-make-local-hook 'kill-buffer-hook) | |
920 (add-hook 'kill-buffer-hook 'mh-tidy-draft-buffer nil t) | |
69520
67b5315387f4
(mh-send-letter): Use split-string to break up mh-send-args (closes SF
Bill Wohler <wohler@newt.com>
parents:
69272
diff
changeset
|
921 (run-hook-with-args 'mh-compose-letter-function to subject cc)) |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
922 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
923 (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
|
924 "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
|
925 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
|
926 ;; Lazily initialize mh-x-mailer-string. |
56406
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
927 (when (and mh-insert-x-mailer-flag (null mh-x-mailer-string)) |
56673
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
928 (setq mh-x-mailer-string |
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
929 (format "MH-E %s; %s; %sEmacs %s" |
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
930 mh-version mh-variant-in-use |
86202
794e428cd497
* eshell/esh-util.el (eshell-under-xemacs-p): Remove.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
82839
diff
changeset
|
931 (if (featurep 'xemacs) "X" "GNU ") |
794e428cd497
* eshell/esh-util.el (eshell-under-xemacs-p): Remove.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
82839
diff
changeset
|
932 (cond ((not (featurep 'xemacs)) |
70062
e4338fe2e331
(mh-insert-x-mailer): Strip build number from version in X-Mailer
Bill Wohler <wohler@newt.com>
parents:
70028
diff
changeset
|
933 (string-match "[0-9]+\\.[0-9]+\\(\\.[0-9]+\\)?" |
e4338fe2e331
(mh-insert-x-mailer): Strip build number from version in X-Mailer
Bill Wohler <wohler@newt.com>
parents:
70028
diff
changeset
|
934 emacs-version) |
e4338fe2e331
(mh-insert-x-mailer): Strip build number from version in X-Mailer
Bill Wohler <wohler@newt.com>
parents:
70028
diff
changeset
|
935 (match-string 0 emacs-version)) |
56673
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
936 ((string-match "[0-9.]*\\( +\([ a-z]+[0-9]+\)\\)?" |
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
937 emacs-version) |
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
938 (match-string 0 emacs-version)) |
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
939 (t (format "%s.%s" emacs-major-version |
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
940 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
|
941 ;; 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
|
942 (save-excursion |
56406
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
943 (when (and mh-insert-x-mailer-flag |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
944 (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
|
945 (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
|
946 |
68465 | 947 (defun mh-insert-x-face () |
948 "Append X-Face, Face or X-Image-URL field to header. | |
949 If the field already exists, this function does nothing." | |
950 (when (and (file-exists-p mh-x-face-file) | |
951 (file-readable-p mh-x-face-file)) | |
952 (save-excursion | |
953 (unless (or (mh-position-on-field "X-Face") | |
954 (mh-position-on-field "Face") | |
955 (mh-position-on-field "X-Image-URL")) | |
956 (save-excursion | |
957 (goto-char (+ (point) (cadr (insert-file-contents mh-x-face-file)))) | |
958 (if (not (looking-at "^")) | |
959 (insert "\n"))) | |
960 (unless (looking-at "\\(X-Face\\|Face\\|X-Image-URL\\): ") | |
961 (insert "X-Face: ")))))) | |
962 | |
963 (defun mh-tidy-draft-buffer () | |
964 "Run when a draft buffer is destroyed." | |
965 (let ((buffer (get-buffer mh-recipients-buffer))) | |
966 (if buffer | |
967 (kill-buffer buffer)))) | |
968 | |
969 (defun mh-letter-mode-message () | |
970 "Display a help message for users of `mh-letter-mode'. | |
971 This should be the last function called when composing the draft." | |
972 (message "%s" (substitute-command-keys | |
973 (concat "Type \\[mh-send-letter] to send message, " | |
974 "\\[mh-help] for help")))) | |
975 | |
976 (defun mh-letter-adjust-point () | |
977 "Move cursor to first header field if are using the no prompt mode." | |
978 (unless mh-compose-prompt-flag | |
979 (goto-char (point-max)) | |
980 (mh-letter-next-header-field))) | |
981 | |
82839
af7dc7457402
add mh-annotate-msg-hook
Stephen Gildea <gildea@stop.mail-abuse.org>
parents:
82478
diff
changeset
|
982 (defun mh-annotate-msg (msg folder note &rest args) |
af7dc7457402
add mh-annotate-msg-hook
Stephen Gildea <gildea@stop.mail-abuse.org>
parents:
82478
diff
changeset
|
983 "Mark MSG in FOLDER with character NOTE and annotate message with ARGS. |
91945
8f2ff5b7ee99
(mh-annotate-msg): Remove trailing whitespace.
Bill Wohler <wohler@newt.com>
parents:
87649
diff
changeset
|
984 MSG can be a message number, a list of message numbers, or a sequence. |
82839
af7dc7457402
add mh-annotate-msg-hook
Stephen Gildea <gildea@stop.mail-abuse.org>
parents:
82478
diff
changeset
|
985 The hook `mh-annotate-msg-hook' is run after annotating; see its |
af7dc7457402
add mh-annotate-msg-hook
Stephen Gildea <gildea@stop.mail-abuse.org>
parents:
82478
diff
changeset
|
986 documentation for variables it can use." |
af7dc7457402
add mh-annotate-msg-hook
Stephen Gildea <gildea@stop.mail-abuse.org>
parents:
82478
diff
changeset
|
987 (apply 'mh-exec-cmd "anno" folder |
68465 | 988 (if (listp msg) (append msg args) (cons msg args))) |
989 (save-excursion | |
82839
af7dc7457402
add mh-annotate-msg-hook
Stephen Gildea <gildea@stop.mail-abuse.org>
parents:
82478
diff
changeset
|
990 (cond ((get-buffer folder) ; Buffer may be deleted |
af7dc7457402
add mh-annotate-msg-hook
Stephen Gildea <gildea@stop.mail-abuse.org>
parents:
82478
diff
changeset
|
991 (set-buffer folder) |
68465 | 992 (mh-iterate-on-range nil msg |
993 (mh-notate nil note | |
82839
af7dc7457402
add mh-annotate-msg-hook
Stephen Gildea <gildea@stop.mail-abuse.org>
parents:
82478
diff
changeset
|
994 (+ mh-cmd-note mh-scan-field-destination-offset)))))) |
af7dc7457402
add mh-annotate-msg-hook
Stephen Gildea <gildea@stop.mail-abuse.org>
parents:
82478
diff
changeset
|
995 (let ((mh-current-folder folder) |
af7dc7457402
add mh-annotate-msg-hook
Stephen Gildea <gildea@stop.mail-abuse.org>
parents:
82478
diff
changeset
|
996 ;; mh-annotate-list is a sequence name or a list of message numbers |
af7dc7457402
add mh-annotate-msg-hook
Stephen Gildea <gildea@stop.mail-abuse.org>
parents:
82478
diff
changeset
|
997 (mh-annotate-list (if (numberp msg) (list msg) msg))) |
af7dc7457402
add mh-annotate-msg-hook
Stephen Gildea <gildea@stop.mail-abuse.org>
parents:
82478
diff
changeset
|
998 (run-hooks 'mh-annotate-msg-hook))) |
68465 | 999 |
1000 (defun mh-insert-header-separator () | |
1001 "Insert `mh-mail-header-separator', if absent." | |
1002 (save-excursion | |
1003 (goto-char (point-min)) | |
1004 (rfc822-goto-eoh) | |
1005 (if (looking-at "$") | |
1006 (insert mh-mail-header-separator)))) | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1007 |
56406
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
1008 ;;;###mh-autoload |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
1009 (defun mh-insert-auto-fields (&optional non-interactive) |
66476
ea959f21cde8
(mh-insert-signature, mh-insert-auto-fields): Checkdoc fixes.
Bill Wohler <wohler@newt.com>
parents:
66356
diff
changeset
|
1010 "Insert custom fields if recipient is found in `mh-auto-fields-list'. |
56406
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
1011 |
69272
cc66ebd3f3a4
(mh-send-letter, mh-insert-auto-fields): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents:
68529
diff
changeset
|
1012 Once the header contains one or more recipients, you may run this |
cc66ebd3f3a4
(mh-send-letter, mh-insert-auto-fields): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents:
68529
diff
changeset
|
1013 command to insert these fields manually. However, if you use this |
cc66ebd3f3a4
(mh-send-letter, mh-insert-auto-fields): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents:
68529
diff
changeset
|
1014 command, the automatic insertion when the message is sent is |
cc66ebd3f3a4
(mh-send-letter, mh-insert-auto-fields): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents:
68529
diff
changeset
|
1015 disabled. |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
1016 |
69272
cc66ebd3f3a4
(mh-send-letter, mh-insert-auto-fields): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents:
68529
diff
changeset
|
1017 In a program, set buffer-local `mh-insert-auto-fields-done-local' |
cc66ebd3f3a4
(mh-send-letter, mh-insert-auto-fields): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents:
68529
diff
changeset
|
1018 if header fields were added. If NON-INTERACTIVE is non-nil, |
cc66ebd3f3a4
(mh-send-letter, mh-insert-auto-fields): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents:
68529
diff
changeset
|
1019 perform actions quietly and only if |
cc66ebd3f3a4
(mh-send-letter, mh-insert-auto-fields): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents:
68529
diff
changeset
|
1020 `mh-insert-auto-fields-done-local' is nil. Return t if fields |
cc66ebd3f3a4
(mh-send-letter, mh-insert-auto-fields): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents:
68529
diff
changeset
|
1021 added; otherwise return nil." |
56406
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
1022 (interactive) |
56673
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
1023 (when (or (not non-interactive) |
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
1024 (not mh-insert-auto-fields-done-local)) |
56406
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
1025 (save-excursion |
56673
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
1026 (when (and (or (mh-goto-header-field "To:") |
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
1027 (mh-goto-header-field "cc:"))) |
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
1028 (let ((list mh-auto-fields-list) |
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
1029 (fields-inserted nil)) |
56406
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
1030 (while list |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
1031 (let ((regexp (nth 0 (car list))) |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
1032 (entries (nth 1 (car list)))) |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
1033 (when (mh-regexp-in-field-p regexp "To:" "cc:") |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
1034 (setq mh-insert-auto-fields-done-local t) |
56673
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
1035 (setq fields-inserted t) |
56406
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
1036 (if (not non-interactive) |
56673
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
1037 (message "Fields for %s added" regexp)) |
56406
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
1038 (let ((entry-list entries)) |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
1039 (while entry-list |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
1040 (let ((field (caar entry-list)) |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
1041 (value (cdar entry-list))) |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
1042 (cond |
56673
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
1043 ((equal ":identity" field) |
68465 | 1044 (when |
1045 ;;(and (not mh-identity-local) | |
65980
4520ae2624f2
* mh-init.el (mh-image-load-path): New function that adds the path to
Bill Wohler <wohler@newt.com>
parents:
65681
diff
changeset
|
1046 ;; Bug 1204506. But do we need to be able |
68465 | 1047 ;; to set an identity manually that won't be |
1048 ;; overridden by mh-insert-auto-fields? | |
1049 (assoc value mh-identity-list) | |
1050 ;;) | |
56406
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
1051 (mh-insert-identity value))) |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
1052 (t |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
1053 (mh-modify-header-field field value |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
1054 (equal field "From"))))) |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
1055 (setq entry-list (cdr entry-list)))))) |
56673
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
1056 (setq list (cdr list))) |
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
1057 fields-inserted))))) |
50702
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
1058 |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
1059 (defun mh-modify-header-field (field value &optional overwrite-flag) |
7dd3d5eae9c7
Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents:
49598
diff
changeset
|
1060 "To header FIELD add VALUE. |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
1061 If OVERWRITE-FLAG is non-nil then the old value, if present, is |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
1062 discarded." |
56406
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
1063 (cond ((and overwrite-flag |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
1064 (mh-goto-header-field (concat field ":"))) |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
1065 (insert " " value) |
68529
7daec5f4a289
* mh-alias.el (mh-alias-gecos-name): Use mh-replace-regexp-in-string
Bill Wohler <wohler@newt.com>
parents:
68528
diff
changeset
|
1066 (delete-region (point) (mh-line-end-position))) |
56406
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
1067 ((and (not overwrite-flag) |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
1068 (mh-regexp-in-field-p (concat "\\b" value "\\b") field)) |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
1069 ;; Already there, do nothing. |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
1070 ) |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
1071 ((and (not overwrite-flag) |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
1072 (mh-goto-header-field (concat field ":"))) |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
1073 (insert " " value ",")) |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
1074 (t |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
1075 (mh-goto-header-end 0) |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
1076 (insert field ": " value "\n")))) |
d36b00b98db0
Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
1077 |
68465 | 1078 (defun mh-regexp-in-field-p (regexp &rest fields) |
1079 "Non-nil means REGEXP was found in FIELDS." | |
1080 (save-excursion | |
1081 (let ((search-result nil) | |
1082 (field)) | |
1083 (while fields | |
1084 (setq field (car fields)) | |
1085 (if (and (mh-goto-header-field field) | |
1086 (re-search-forward | |
1087 regexp (save-excursion (mh-header-field-end)(point)) t)) | |
1088 (setq fields nil | |
1089 search-result t) | |
1090 (setq fields (cdr fields)))) | |
1091 search-result))) | |
56673
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
1092 |
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
1093 (defun mh-ascii-buffer-p () |
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
1094 "Check if current buffer is entirely composed of ASCII. |
67758
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
1095 The function doesn't work for XEmacs since `find-charset-region' |
6b063593fdad
Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents:
67756
diff
changeset
|
1096 doesn't exist there." |
56673
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
1097 (loop for charset in (mh-funcall-if-exists |
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
1098 find-charset-region (point-min) (point-max)) |
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
1099 unless (eq charset 'ascii) return nil |
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
56406
diff
changeset
|
1100 finally return t)) |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1101 |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1102 (provide 'mh-comp) |
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1103 |
67681 | 1104 ;; Local Variables: |
1105 ;; indent-tabs-mode: nil | |
1106 ;; sentence-end-double-space: nil | |
1107 ;; End: | |
49459
06b77df47802
* mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
1108 |
67681 | 1109 ;; 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
|
1110 ;;; mh-comp.el ends here |