annotate lisp/gnus/message.el @ 111168:d1079095427d

Merge changes made in Gnus trunk. message.el (message-default-headers): Fix type. nnimap.el (nnimap-request-head, nnimap-request-move-article): Make internal nnimap moving slightly faster. nnimap.el (nnimap-transform-headers): Don't bug out on bodiless articles. nnimap.el (nnimap-send-command): Have no outstanding messages if the IMAP server doesn't support streaming. nnimap.el (nnimap-transform-headers): Fold {quoted} strings more sloppily.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Sun, 24 Oct 2010 22:32:38 +0000
parents 9d01a8aadec3
children 43d891f84e91
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1 ;;; message.el --- composing mail and news messages
64754
fafd692d1e40 Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 64735
diff changeset
2
fafd692d1e40 Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 64735
diff changeset
3 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
106815
1d1d5d9bd884 Add 2010 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 106746
diff changeset
4 ;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7 ;; Keywords: mail, news
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9 ;; This file is part of GNU Emacs.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10
94662
f42ef85caf91 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94209
diff changeset
11 ;; GNU Emacs is free software: you can redistribute it and/or modify
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12 ;; it under the terms of the GNU General Public License as published by
94662
f42ef85caf91 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94209
diff changeset
13 ;; the Free Software Foundation, either version 3 of the License, or
f42ef85caf91 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94209
diff changeset
14 ;; (at your option) any later version.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16 ;; GNU Emacs is distributed in the hope that it will be useful,
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
94662
f42ef85caf91 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94209
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
19 ;; GNU General Public License for more details.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
20
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
21 ;; You should have received a copy of the GNU General Public License
94662
f42ef85caf91 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94209
diff changeset
22 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
23
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
24 ;;; Commentary:
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
25
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
26 ;; This mode provides mail-sending facilities from within Emacs. It
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
27 ;; consists mainly of large chunks of code from the sendmail.el,
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
28 ;; gnus-msg.el and rnewspost.el files.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
29
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
30 ;;; Code:
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
31
110918
236342431786 nnimap.el (gnutls-negotiate): Silence the byte compiler.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110790
diff changeset
32 ;; For Emacs <22.2 and XEmacs.
87191
066a2efbc9c8 (declare-function): Add compatibility declaration.
Glenn Morris <rgm@gnu.org>
parents: 87097
diff changeset
33 (eval-and-compile
066a2efbc9c8 (declare-function): Add compatibility declaration.
Glenn Morris <rgm@gnu.org>
parents: 87097
diff changeset
34 (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
35 (eval-when-compile
86154
1cdfc94602cb * smime.el (from):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85974
diff changeset
36 (require 'cl))
87191
066a2efbc9c8 (declare-function): Add compatibility declaration.
Glenn Morris <rgm@gnu.org>
parents: 87097
diff changeset
37
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
38 (require 'mailheader)
70051
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
39 (require 'gmm-utils)
107427
ecbe0edc4f69 Stop message.el from loading about 40 libraries it doesn't always need.
Glenn Morris <rgm@gnu.org>
parents: 107235
diff changeset
40 (require 'mail-utils)
ecbe0edc4f69 Stop message.el from loading about 40 libraries it doesn't always need.
Glenn Morris <rgm@gnu.org>
parents: 107235
diff changeset
41 ;; Only for the trivial macros mail-header-from, mail-header-date
ecbe0edc4f69 Stop message.el from loading about 40 libraries it doesn't always need.
Glenn Morris <rgm@gnu.org>
parents: 107235
diff changeset
42 ;; mail-header-references, mail-header-subject, mail-header-id
ecbe0edc4f69 Stop message.el from loading about 40 libraries it doesn't always need.
Glenn Morris <rgm@gnu.org>
parents: 107235
diff changeset
43 (eval-when-compile (require 'nnheader))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
44 ;; This is apparently necessary even though things are autoloaded.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
45 ;; Because we dynamically bind mail-abbrev-mode-regexp, we'd better
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
46 ;; require mailabbrev here.
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
47 (if (featurep 'xemacs)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
48 (require 'mail-abbrevs)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
49 (require 'mailabbrev))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
50 (require 'mail-parse)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
51 (require 'mml)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
52 (require 'rfc822)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
53
86254
0d061e2dce73 (message-send-mail-function): New function.
Reiner Steib <Reiner.Steib@gmx.de>
parents: 86154
diff changeset
54 (autoload 'mailclient-send-it "mailclient") ;; Emacs 22 or contrib/
0d061e2dce73 (message-send-mail-function): New function.
Reiner Steib <Reiner.Steib@gmx.de>
parents: 86154
diff changeset
55
86154
1cdfc94602cb * smime.el (from):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85974
diff changeset
56 (defvar gnus-message-group-art)
1cdfc94602cb * smime.el (from):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85974
diff changeset
57 (defvar gnus-list-identifiers) ; gnus-sum is required where necessary
1cdfc94602cb * smime.el (from):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85974
diff changeset
58 (defvar rmail-enable-mime-composing)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
59
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
60 (defgroup message '((user-mail-address custom-variable)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
61 (user-full-name custom-variable))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
62 "Mail and news message composing."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
63 :link '(custom-manual "(message)Top")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
64 :group 'mail
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
65 :group 'news)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
66
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
67 (put 'user-mail-address 'custom-type 'string)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
68 (put 'user-full-name 'custom-type 'string)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
69
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
70 (defgroup message-various nil
63977
093115a435b2 (message-various, message-buffers, message-sending, message-interface,
Juanma Barranquero <lekktu@gmail.com>
parents: 63480
diff changeset
71 "Various Message Variables."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
72 :link '(custom-manual "(message)Various Message Variables")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
73 :group 'message)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
74
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
75 (defgroup message-buffers nil
63977
093115a435b2 (message-various, message-buffers, message-sending, message-interface,
Juanma Barranquero <lekktu@gmail.com>
parents: 63480
diff changeset
76 "Message Buffers."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
77 :link '(custom-manual "(message)Message Buffers")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
78 :group 'message)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
79
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
80 (defgroup message-sending nil
63977
093115a435b2 (message-various, message-buffers, message-sending, message-interface,
Juanma Barranquero <lekktu@gmail.com>
parents: 63480
diff changeset
81 "Message Sending."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
82 :link '(custom-manual "(message)Sending Variables")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
83 :group 'message)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
84
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
85 (defgroup message-interface nil
63977
093115a435b2 (message-various, message-buffers, message-sending, message-interface,
Juanma Barranquero <lekktu@gmail.com>
parents: 63480
diff changeset
86 "Message Interface."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
87 :link '(custom-manual "(message)Interface")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
88 :group 'message)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
89
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
90 (defgroup message-forwarding nil
63977
093115a435b2 (message-various, message-buffers, message-sending, message-interface,
Juanma Barranquero <lekktu@gmail.com>
parents: 63480
diff changeset
91 "Message Forwarding."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
92 :link '(custom-manual "(message)Forwarding")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
93 :group 'message-interface)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
94
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
95 (defgroup message-insertion nil
63977
093115a435b2 (message-various, message-buffers, message-sending, message-interface,
Juanma Barranquero <lekktu@gmail.com>
parents: 63480
diff changeset
96 "Message Insertion."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
97 :link '(custom-manual "(message)Insertion")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
98 :group 'message)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
99
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
100 (defgroup message-headers nil
63977
093115a435b2 (message-various, message-buffers, message-sending, message-interface,
Juanma Barranquero <lekktu@gmail.com>
parents: 63480
diff changeset
101 "Message Headers."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
102 :link '(custom-manual "(message)Message Headers")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
103 :group 'message)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
104
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
105 (defgroup message-news nil
63977
093115a435b2 (message-various, message-buffers, message-sending, message-interface,
Juanma Barranquero <lekktu@gmail.com>
parents: 63480
diff changeset
106 "Composing News Messages."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
107 :group 'message)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
108
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
109 (defgroup message-mail nil
63977
093115a435b2 (message-various, message-buffers, message-sending, message-interface,
Juanma Barranquero <lekktu@gmail.com>
parents: 63480
diff changeset
110 "Composing Mail Messages."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
111 :group 'message)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
112
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
113 (defgroup message-faces nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
114 "Faces used for message composing."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
115 :group 'message
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
116 :group 'faces)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
117
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
118 (defcustom message-directory "~/Mail/"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
119 "*Directory from which all other mail file variables are derived."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
120 :group 'message-various
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
121 :type 'directory)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
122
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
123 (defcustom message-max-buffers 10
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
124 "*How many buffers to keep before starting to kill them off."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
125 :group 'message-buffers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
126 :type 'integer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
127
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
128 (defcustom message-send-rename-function nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
129 "Function called to rename the buffer after sending it."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
130 :group 'message-buffers
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
131 :type '(choice function (const nil)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
132
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
133 (defcustom message-fcc-handler-function 'message-output
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
134 "*A function called to save outgoing articles.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
135 This function will be called with the name of the file to store the
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
136 article in. The default function is `message-output' which saves in Unix
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
137 mailbox format."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
138 :type '(radio (function-item message-output)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
139 (function :tag "Other"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
140 :group 'message-sending)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
141
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
142 (defcustom message-fcc-externalize-attachments nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
143 "If non-nil, attachments are included as external parts in Fcc copies."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59756
diff changeset
144 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
145 :type 'boolean
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
146 :group 'message-sending)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
147
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
148 (defcustom message-courtesy-message
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
149 "The following message is a courtesy copy of an article\nthat has been posted to %s as well.\n\n"
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
150 "*This is inserted at the start of a mailed copy of a posted message.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
151 If the string contains the format spec \"%s\", the Newsgroups
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
152 the article has been posted to will be inserted there.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
153 If this variable is nil, no such courtesy message will be added."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
154 :group 'message-sending
58835
9bdd97960431 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents: 57856
diff changeset
155 :type '(radio string (const nil)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
156
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
157 (defcustom message-ignored-bounced-headers
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
158 "^\\(Received\\|Return-Path\\|Delivered-To\\):"
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
159 "*Regexp that matches headers to be removed in resent bounced mail."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
160 :group 'message-interface
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
161 :type 'regexp)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
162
106218
8ccde493b34d (message-from-style, message-interactive, message-signature): Always set
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 106152
diff changeset
163 (defcustom message-from-style mail-from-style
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
164 "*Specifies how \"From\" headers look.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
165
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
166 If nil, they contain just the return address like:
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
167 king@grassland.com
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
168 If `parens', they look like:
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
169 king@grassland.com (Elvis Parsley)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
170 If `angles', they look like:
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
171 Elvis Parsley <king@grassland.com>
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
172
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
173 Otherwise, most addresses look like `angles', but they look like
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
174 `parens' if `angles' would need quoting and `parens' would not."
106218
8ccde493b34d (message-from-style, message-interactive, message-signature): Always set
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 106152
diff changeset
175 :version "23.2"
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
176 :type '(choice (const :tag "simple" nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
177 (const parens)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
178 (const angles)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
179 (const default))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
180 :group 'message-headers)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
181
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
182 (defcustom message-insert-canlock t
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
183 "Whether to insert a Cancel-Lock header in news postings."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59756
diff changeset
184 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
185 :group 'message-headers
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
186 :type 'boolean)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
187
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
188 (defcustom message-syntax-checks
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
189 (if message-insert-canlock '((sender . disabled)) nil)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
190 ;; Guess this one shouldn't be easy to customize...
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
191 "*Controls what syntax checks should not be performed on outgoing posts.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
192 To disable checking of long signatures, for instance, add
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
193 `(signature . disabled)' to this list.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
194
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
195 Don't touch this variable unless you really know what you're doing.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
196
85809
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
197 Checks include `approved', `bogus-recipient', `continuation-headers',
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
198 `control-chars', `empty', `existing-newsgroups', `from', `illegible-text',
71379
cb6e677b13d4 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70245
diff changeset
199 `invisible-text', `long-header-lines', `long-lines', `message-id',
cb6e677b13d4 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70245
diff changeset
200 `multiple-headers', `new-text', `newsgroups', `quoting-style',
71398
6ee457a7e830 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 71379
diff changeset
201 `repeated-newsgroups', `reply-to', `sender', `sendsys', `shoot',
71379
cb6e677b13d4 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70245
diff changeset
202 `shorten-followup-to', `signature', `size', `subject', `subject-cmsg'
cb6e677b13d4 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70245
diff changeset
203 and `valid-newsgroups'."
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
204 :group 'message-news
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
205 :type '(repeat sexp)) ; Fixme: improve this
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
206
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
207 (defcustom message-required-headers '((optional . References)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
208 From)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
209 "*Headers to be generated or prompted for when sending a message.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
210 Also see `message-required-news-headers' and
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
211 `message-required-mail-headers'."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59756
diff changeset
212 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
213 :group 'message-news
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
214 :group 'message-headers
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
215 :link '(custom-manual "(message)Message Headers")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
216 :type '(repeat sexp))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
217
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
218 (defcustom message-draft-headers '(References From Date)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
219 "*Headers to be generated when saving a draft message."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59756
diff changeset
220 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
221 :group 'message-news
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
222 :group 'message-headers
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
223 :link '(custom-manual "(message)Message Headers")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
224 :type '(repeat sexp))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
225
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
226 (defcustom message-required-news-headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
227 '(From Newsgroups Subject Date Message-ID
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
228 (optional . Organization)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
229 (optional . User-Agent))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
230 "*Headers to be generated or prompted for when posting an article.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
231 RFC977 and RFC1036 require From, Date, Newsgroups, Subject,
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
232 Message-ID. Organization, Lines, In-Reply-To, Expires, and
76650
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
233 User-Agent are optional. If you don't want message to insert some
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
234 header, remove it from this list."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
235 :group 'message-news
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
236 :group 'message-headers
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
237 :link '(custom-manual "(message)Message Headers")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
238 :type '(repeat sexp))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
239
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
240 (defcustom message-required-mail-headers
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
241 '(From Subject Date (optional . In-Reply-To) Message-ID
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
242 (optional . User-Agent))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
243 "*Headers to be generated or prompted for when mailing a message.
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
244 It is recommended that From, Date, To, Subject and Message-ID be
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
245 included. Organization and User-Agent are optional."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
246 :group 'message-mail
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
247 :group 'message-headers
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
248 :link '(custom-manual "(message)Message Headers")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
249 :type '(repeat sexp))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
250
110073
38805092633e gnus-ems.el: Provide compatibility functions for gnus-set-process-plist by Katsumi Yamaoka <yamaoka@jpl.org>; gnus-html.el: Use gnus-process-plist and friends for compatibility; gnus-cite.el: New function to guess whether a long line is natural text or not; message.el: Implement message-prune-recipient-rules; by Lars Magne Ingebrigtsen <larsi@gnus.org>.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110064
diff changeset
251 (defcustom message-prune-recipient-rules nil
38805092633e gnus-ems.el: Provide compatibility functions for gnus-set-process-plist by Katsumi Yamaoka <yamaoka@jpl.org>; gnus-html.el: Use gnus-process-plist and friends for compatibility; gnus-cite.el: New function to guess whether a long line is natural text or not; message.el: Implement message-prune-recipient-rules; by Lars Magne Ingebrigtsen <larsi@gnus.org>.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110064
diff changeset
252 "Rules for how to prune the list of recipients when doing wide replies.
38805092633e gnus-ems.el: Provide compatibility functions for gnus-set-process-plist by Katsumi Yamaoka <yamaoka@jpl.org>; gnus-html.el: Use gnus-process-plist and friends for compatibility; gnus-cite.el: New function to guess whether a long line is natural text or not; message.el: Implement message-prune-recipient-rules; by Lars Magne Ingebrigtsen <larsi@gnus.org>.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110064
diff changeset
253 This is a list of regexps and regexp matches."
110084
320a820be8d8 gnus-html.el, message.el: Add custom version to new variables; gnus-sum.el: Bump custom version of gnus-auto-expirable-marks.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110073
diff changeset
254 :version "24.1"
110073
38805092633e gnus-ems.el: Provide compatibility functions for gnus-set-process-plist by Katsumi Yamaoka <yamaoka@jpl.org>; gnus-html.el: Use gnus-process-plist and friends for compatibility; gnus-cite.el: New function to guess whether a long line is natural text or not; message.el: Implement message-prune-recipient-rules; by Lars Magne Ingebrigtsen <larsi@gnus.org>.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110064
diff changeset
255 :group 'message-mail
38805092633e gnus-ems.el: Provide compatibility functions for gnus-set-process-plist by Katsumi Yamaoka <yamaoka@jpl.org>; gnus-html.el: Use gnus-process-plist and friends for compatibility; gnus-cite.el: New function to guess whether a long line is natural text or not; message.el: Implement message-prune-recipient-rules; by Lars Magne Ingebrigtsen <larsi@gnus.org>.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110064
diff changeset
256 :group 'message-headers
38805092633e gnus-ems.el: Provide compatibility functions for gnus-set-process-plist by Katsumi Yamaoka <yamaoka@jpl.org>; gnus-html.el: Use gnus-process-plist and friends for compatibility; gnus-cite.el: New function to guess whether a long line is natural text or not; message.el: Implement message-prune-recipient-rules; by Lars Magne Ingebrigtsen <larsi@gnus.org>.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110064
diff changeset
257 :link '(custom-manual "(message)Wide Reply")
38805092633e gnus-ems.el: Provide compatibility functions for gnus-set-process-plist by Katsumi Yamaoka <yamaoka@jpl.org>; gnus-html.el: Use gnus-process-plist and friends for compatibility; gnus-cite.el: New function to guess whether a long line is natural text or not; message.el: Implement message-prune-recipient-rules; by Lars Magne Ingebrigtsen <larsi@gnus.org>.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110064
diff changeset
258 :type '(repeat regexp))
38805092633e gnus-ems.el: Provide compatibility functions for gnus-set-process-plist by Katsumi Yamaoka <yamaoka@jpl.org>; gnus-html.el: Use gnus-process-plist and friends for compatibility; gnus-cite.el: New function to guess whether a long line is natural text or not; message.el: Implement message-prune-recipient-rules; by Lars Magne Ingebrigtsen <larsi@gnus.org>.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110064
diff changeset
259
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
260 (defcustom message-deletable-headers '(Message-ID Date Lines)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
261 "Headers to be deleted if they already exist and were generated by message previously."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
262 :group 'message-headers
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
263 :link '(custom-manual "(message)Message Headers")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
264 :type 'sexp)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
265
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
266 (defcustom message-ignored-news-headers
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
267 "^NNTP-Posting-Host:\\|^Xref:\\|^[BGF]cc:\\|^Resent-Fcc:\\|^X-Draft-From:\\|^X-Gnus-Agent-Meta-Information:"
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
268 "*Regexp of headers to be removed unconditionally before posting."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
269 :group 'message-news
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
270 :group 'message-headers
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
271 :link '(custom-manual "(message)Message Headers")
57561
505c55fe8dc9 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-621
Miles Bader <miles@gnu.org>
parents: 57489
diff changeset
272 :type '(repeat :value-to-internal (lambda (widget value)
505c55fe8dc9 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-621
Miles Bader <miles@gnu.org>
parents: 57489
diff changeset
273 (custom-split-regexp-maybe value))
505c55fe8dc9 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-621
Miles Bader <miles@gnu.org>
parents: 57489
diff changeset
274 :match (lambda (widget value)
505c55fe8dc9 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-621
Miles Bader <miles@gnu.org>
parents: 57489
diff changeset
275 (or (stringp value)
505c55fe8dc9 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-621
Miles Bader <miles@gnu.org>
parents: 57489
diff changeset
276 (widget-editable-list-match widget value)))
505c55fe8dc9 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-621
Miles Bader <miles@gnu.org>
parents: 57489
diff changeset
277 regexp))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
278
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
279 (defcustom message-ignored-mail-headers
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
280 "^[GF]cc:\\|^Resent-Fcc:\\|^Xref:\\|^X-Draft-From:\\|^X-Gnus-Agent-Meta-Information:"
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
281 "*Regexp of headers to be removed unconditionally before mailing."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
282 :group 'message-mail
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
283 :group 'message-headers
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
284 :link '(custom-manual "(message)Mail Headers")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
285 :type 'regexp)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
286
110666
3b9bd3888ee9 nnimap.el (nnimap-request-accept-article): Get the Message-ID without the \r.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110635
diff changeset
287 (defcustom message-ignored-supersedes-headers "^Path:\\|^Date\\|^NNTP-Posting-Host:\\|^Xref:\\|^Lines:\\|^Received:\\|^X-From-Line:\\|^X-Trace:\\|^X-ID:\\|^X-Complaints-To:\\|Return-Path:\\|^Supersedes:\\|^NNTP-Posting-Date:\\|^X-Trace:\\|^X-Complaints-To:\\|^Cancel-Lock:\\|^Cancel-Key:\\|^X-Hashcash:\\|^X-Payment:\\|^Approved:\\|^Injection-Date:\\|^Injection-Info:"
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
288 "*Header lines matching this regexp will be deleted before posting.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
289 It's best to delete old Path and Date headers before posting to avoid
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
290 any confusion."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
291 :group 'message-interface
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
292 :link '(custom-manual "(message)Superseding")
57561
505c55fe8dc9 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-621
Miles Bader <miles@gnu.org>
parents: 57489
diff changeset
293 :type '(repeat :value-to-internal (lambda (widget value)
505c55fe8dc9 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-621
Miles Bader <miles@gnu.org>
parents: 57489
diff changeset
294 (custom-split-regexp-maybe value))
505c55fe8dc9 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-621
Miles Bader <miles@gnu.org>
parents: 57489
diff changeset
295 :match (lambda (widget value)
505c55fe8dc9 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-621
Miles Bader <miles@gnu.org>
parents: 57489
diff changeset
296 (or (stringp value)
505c55fe8dc9 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-621
Miles Bader <miles@gnu.org>
parents: 57489
diff changeset
297 (widget-editable-list-match widget value)))
505c55fe8dc9 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-621
Miles Bader <miles@gnu.org>
parents: 57489
diff changeset
298 regexp))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
299
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
300 (defcustom message-subject-re-regexp
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
301 "^[ \t]*\\([Rr][Ee]\\(\\[[0-9]*\\]\\)*:[ \t]*\\)*[ \t]*"
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
302 "*Regexp matching \"Re: \" in the subject line."
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
303 :group 'message-various
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
304 :link '(custom-manual "(message)Message Headers")
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
305 :type 'regexp)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
306
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
307 ;;; Start of variables adopted from `message-utils.el'.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
308
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
309 (defcustom message-subject-trailing-was-query 'ask
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
310 "*What to do with trailing \"(was: <old subject>)\" in subject lines.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
311 If nil, leave the subject unchanged. If it is the symbol `ask', query
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
312 the user what do do. In this case, the subject is matched against
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
313 `message-subject-trailing-was-ask-regexp'. If
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
314 `message-subject-trailing-was-query' is t, always strip the trailing
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
315 old subject. In this case, `message-subject-trailing-was-regexp' is
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
316 used."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59756
diff changeset
317 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
318 :type '(choice (const :tag "never" nil)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
319 (const :tag "always strip" t)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
320 (const ask))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
321 :link '(custom-manual "(message)Message Headers")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
322 :group 'message-various)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
323
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
324 (defcustom message-subject-trailing-was-ask-regexp
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
325 "[ \t]*\\([[(]+[Ww][Aa][Ss][ \t]*.*[\])]+\\)"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
326 "*Regexp matching \"(was: <old subject>)\" in the subject line.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
327
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
328 The function `message-strip-subject-trailing-was' uses this regexp if
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
329 `message-subject-trailing-was-query' is set to the symbol `ask'. If
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
330 the variable is t instead of `ask', use
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
331 `message-subject-trailing-was-regexp' instead.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
332
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
333 It is okay to create some false positives here, as the user is asked."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59756
diff changeset
334 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
335 :group 'message-various
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
336 :link '(custom-manual "(message)Message Headers")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
337 :type 'regexp)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
338
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
339 (defcustom message-subject-trailing-was-regexp
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
340 "[ \t]*\\((*[Ww][Aa][Ss]:[ \t]*.*)\\)"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
341 "*Regexp matching \"(was: <old subject>)\" in the subject line.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
342
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
343 If `message-subject-trailing-was-query' is set to t, the subject is
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
344 matched against `message-subject-trailing-was-regexp' in
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
345 `message-strip-subject-trailing-was'. You should use a regexp creating very
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
346 few false positives here."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59756
diff changeset
347 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
348 :group 'message-various
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
349 :link '(custom-manual "(message)Message Headers")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
350 :type 'regexp)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
351
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
352 ;;; marking inserted text
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
353
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
354 (defcustom message-mark-insert-begin
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
355 "--8<---------------cut here---------------start------------->8---\n"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
356 "How to mark the beginning of some inserted text."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59756
diff changeset
357 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
358 :type 'string
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
359 :link '(custom-manual "(message)Insertion Variables")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
360 :group 'message-various)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
361
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
362 (defcustom message-mark-insert-end
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
363 "--8<---------------cut here---------------end--------------->8---\n"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
364 "How to mark the end of some inserted text."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59756
diff changeset
365 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
366 :type 'string
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
367 :link '(custom-manual "(message)Insertion Variables")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
368 :group 'message-various)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
369
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
370 (defcustom message-archive-header "X-No-Archive: Yes\n"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
371 "Header to insert when you don't want your article to be archived.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
372 Archives \(such as groups.google.com\) respect this header."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59756
diff changeset
373 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
374 :type 'string
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
375 :link '(custom-manual "(message)Header Commands")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
376 :group 'message-various)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
377
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
378 (defcustom message-archive-note
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
379 "X-No-Archive: Yes - save http://groups.google.com/"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
380 "Note to insert why you wouldn't want this posting archived.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
381 If nil, don't insert any text in the body."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59756
diff changeset
382 :version "22.1"
58835
9bdd97960431 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents: 57856
diff changeset
383 :type '(radio string (const nil))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
384 :link '(custom-manual "(message)Header Commands")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
385 :group 'message-various)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
386
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
387 ;;; Crossposts and Followups
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
388 ;; inspired by JoH-followup-to by Jochem Huhman <joh at gmx.de>
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
389 ;; new suggestions by R. Weikusat <rw at another.de>
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
390
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
391 (defvar message-cross-post-old-target nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
392 "Old target for cross-posts or follow-ups.")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
393 (make-variable-buffer-local 'message-cross-post-old-target)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
394
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
395 (defcustom message-cross-post-default t
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
396 "When non-nil `message-cross-post-followup-to' will perform a crosspost.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
397 If nil, `message-cross-post-followup-to' will only do a followup. Note that
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
398 you can explicitly override this setting by calling
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
399 `message-cross-post-followup-to' with a prefix."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59756
diff changeset
400 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
401 :type 'boolean
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
402 :group 'message-various)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
403
60390
d8ddb2b48062 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-155
Miles Bader <miles@gnu.org>
parents: 60356
diff changeset
404 (defcustom message-cross-post-note "Crosspost & Followup-To: "
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
405 "Note to insert before signature to notify of cross-post and follow-up."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59756
diff changeset
406 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
407 :type 'string
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
408 :group 'message-various)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
409
60390
d8ddb2b48062 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-155
Miles Bader <miles@gnu.org>
parents: 60356
diff changeset
410 (defcustom message-followup-to-note "Followup-To: "
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
411 "Note to insert before signature to notify of follow-up only."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59756
diff changeset
412 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
413 :type 'string
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
414 :group 'message-various)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
415
60390
d8ddb2b48062 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-155
Miles Bader <miles@gnu.org>
parents: 60356
diff changeset
416 (defcustom message-cross-post-note-function 'message-cross-post-insert-note
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
417 "Function to use to insert note about Crosspost or Followup-To.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
418 The function will be called with four arguments. The function should not only
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
419 insert a note, but also ensure old notes are deleted. See the documentation
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
420 for `message-cross-post-insert-note'."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59756
diff changeset
421 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
422 :type 'function
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
423 :group 'message-various)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
424
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
425 ;;; End of variables adopted from `message-utils.el'.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
426
93386
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
427 (defcustom message-signature-separator "^-- $"
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
428 "Regexp matching the signature separator.
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
429 This variable is used to strip off the signature from quoted text
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
430 when `message-cite-function' is
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
431 `message-cite-original-without-signature'. Most useful values
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
432 are \"^-- $\" (strict) and \"^-- *$\" (loose; allow missing
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
433 whitespace)."
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
434 :type '(choice (const :tag "strict" "^-- $")
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
435 (const :tag "loose" "^-- *$")
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
436 regexp)
94209
0ffd6dd0f75d Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 93451
diff changeset
437 :version "22.3" ;; Gnus 5.10.12 (changed default)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
438 :link '(custom-manual "(message)Various Message Variables")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
439 :group 'message-various)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
440
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
441 (defcustom message-elide-ellipsis "\n[...]\n\n"
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
442 "*The string which is inserted for elided text."
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
443 :type 'string
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
444 :link '(custom-manual "(message)Various Commands")
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
445 :group 'message-various)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
446
106218
8ccde493b34d (message-from-style, message-interactive, message-signature): Always set
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 106152
diff changeset
447 (defcustom message-interactive mail-interactive
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
448 "Non-nil means when sending a message wait for and display errors.
107515
9317d81f8c81 Fix typos in Gnus.
Juanma Barranquero <lekktu@gmail.com>
parents: 107235
diff changeset
449 A value of nil means let mailer mail back a message to report errors."
106218
8ccde493b34d (message-from-style, message-interactive, message-signature): Always set
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 106152
diff changeset
450 :version "23.2"
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
451 :group 'message-sending
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
452 :group 'message-mail
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
453 :link '(custom-manual "(message)Sending Variables")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
454 :type 'boolean)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
455
97972
0f2f9b7e7d8e Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97142
diff changeset
456 (defcustom message-confirm-send nil
98345
952d664ebd93 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 98344
diff changeset
457 "When non-nil, ask for confirmation when sending a message."
97972
0f2f9b7e7d8e Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97142
diff changeset
458 :group 'message-sending
0f2f9b7e7d8e Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97142
diff changeset
459 :group 'message-mail
98398
39408ed11da9 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 98345
diff changeset
460 :version "23.1" ;; No Gnus
97972
0f2f9b7e7d8e Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97142
diff changeset
461 :link '(custom-manual "(message)Sending Variables")
0f2f9b7e7d8e Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97142
diff changeset
462 :type 'boolean)
0f2f9b7e7d8e Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97142
diff changeset
463
110139
53415017c4cc message.el (message-generate-new-buffers): Change default to `unsent'; gnus-sum.el (gnus-summary-goto-unread, gnus-single-article-buffer): Change default to nil.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110111
diff changeset
464 (defcustom message-generate-new-buffers 'unsent
76650
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
465 "*Say whether to create a new message buffer to compose a message.
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
466 Valid values include:
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
467
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
468 nil
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
469 Generate the buffer name in the Message way (e.g., *mail*, *news*,
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
470 *mail to whom*, *news on group*, etc.) and continue editing in the
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
471 existing buffer of that name. If there is no such buffer, it will
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
472 be newly created.
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
473
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
474 `unique' or t
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
475 Create the new buffer with the name generated in the Message way.
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
476
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
477 `unsent'
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
478 Similar to `unique' but the buffer name begins with \"*unsent \".
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
479
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
480 `standard'
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
481 Similar to nil but the buffer name is simpler like *mail message*.
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
482
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
483 function
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
484 If this is a function, call that function with three parameters:
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
485 The type, the To address and the group name (any of these may be nil).
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
486 The function should return the new buffer name."
110139
53415017c4cc message.el (message-generate-new-buffers): Change default to `unsent'; gnus-sum.el (gnus-summary-goto-unread, gnus-single-article-buffer): Change default to nil.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110111
diff changeset
487 :version "24.1"
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
488 :group 'message-buffers
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
489 :link '(custom-manual "(message)Message Buffers")
76650
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
490 :type '(choice (const nil)
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
491 (sexp :tag "unique" :format "unique\n" :value unique
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
492 :match (lambda (widget value) (memq value '(unique t))))
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
493 (const unsent)
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
494 (const standard)
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
495 (function :format "\n %{%t%}: %v")))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
496
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
497 (defcustom message-kill-buffer-on-exit nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
498 "*Non-nil means that the message buffer will be killed after sending a message."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
499 :group 'message-buffers
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
500 :link '(custom-manual "(message)Message Buffers")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
501 :type 'boolean)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
502
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
503 (defcustom message-kill-buffer-query t
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
504 "*Non-nil means that killing a modified message buffer has to be confirmed.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
505 This is used by `message-kill-buffer'."
92336
5f827896103e Change defcustom :version from 23.0 to 23.1.
Glenn Morris <rgm@gnu.org>
parents: 92147
diff changeset
506 :version "23.1" ;; No Gnus
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
507 :group 'message-buffers
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
508 :type 'boolean)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
509
86154
1cdfc94602cb * smime.el (from):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85974
diff changeset
510 (defvar gnus-local-organization)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
511 (defcustom message-user-organization
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
512 (or (and (boundp 'gnus-local-organization)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
513 (stringp gnus-local-organization)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
514 gnus-local-organization)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
515 (getenv "ORGANIZATION")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
516 t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
517 "*String to be used as an Organization header.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
518 If t, use `message-user-organization-file'."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
519 :group 'message-headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
520 :type '(choice string
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
521 (const :tag "consult file" t)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
522
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
523 (defcustom message-user-organization-file
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
524 (let (orgfile)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
525 (dolist (f (list "/etc/organization"
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
526 "/etc/news/organization"
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
527 "/usr/lib/news/organization"))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
528 (when (file-readable-p f)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
529 (setq orgfile f)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
530 orgfile)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
531 "*Local news organization file."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
532 :type 'file
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
533 :link '(custom-manual "(message)News Headers")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
534 :group 'message-headers)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
535
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
536 (defcustom message-make-forward-subject-function
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
537 #'message-forward-subject-name-subject
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
538 "*List of functions called to generate subject headers for forwarded messages.
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
539 The subject generated by the previous function is passed into each
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
540 successive function.
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
541
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
542 The provided functions are:
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
543
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
544 * `message-forward-subject-author-subject' Source of article (author or
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
545 newsgroup), in brackets followed by the subject
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
546 * `message-forward-subject-name-subject' Source of article (name of author
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
547 or newsgroup), in brackets followed by the subject
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
548 * `message-forward-subject-fwd' Subject of article with 'Fwd:' prepended
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
549 to it."
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
550 :group 'message-forwarding
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
551 :link '(custom-manual "(message)Forwarding")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
552 :type '(radio (function-item message-forward-subject-author-subject)
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
553 (function-item message-forward-subject-fwd)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
554 (function-item message-forward-subject-name-subject)
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
555 (repeat :tag "List of functions" function)))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
556
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
557 (defcustom message-forward-as-mime t
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
558 "*Non-nil means forward messages as an inline/rfc822 MIME section.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
559 Otherwise, directly inline the old message in the forwarded message."
33400
42c1ba3caf9c (message-forward-as-mime, message-forward-ignored-headers)
Dave Love <fx@gnu.org>
parents: 33375
diff changeset
560 :version "21.1"
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
561 :group 'message-forwarding
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
562 :link '(custom-manual "(message)Forwarding")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
563 :type 'boolean)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
564
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
565 (defcustom message-forward-show-mml 'best
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
566 "*Non-nil means show forwarded messages as MML (decoded from MIME).
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
567 Otherwise, forwarded messages are unchanged.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
568 Can also be the symbol `best' to indicate that MML should be
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
569 used, except when it is a bad idea to use MML. One example where
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
570 it is a bad idea is when forwarding a signed or encrypted
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
571 message, because converting MIME to MML would invalidate the
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
572 digital signature."
34797
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
573 :version "21.1"
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
574 :group 'message-forwarding
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
575 :type '(choice (const :tag "use MML" t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
576 (const :tag "don't use MML " nil)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
577 (const :tag "use MML when appropriate" best)))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
578
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
579 (defcustom message-forward-before-signature t
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
580 "*Non-nil means put forwarded message before signature, else after."
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
581 :group 'message-forwarding
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
582 :type 'boolean)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
583
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
584 (defcustom message-wash-forwarded-subjects nil
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
585 "*Non-nil means try to remove as much cruft as possible from the subject.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
586 Done before generating the new subject of a forward."
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
587 :group 'message-forwarding
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
588 :link '(custom-manual "(message)Forwarding")
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
589 :type 'boolean)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
590
92754
6984a176570c (message-ignored-resent-headers): Add "Delivered-To".
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 92694
diff changeset
591 (defcustom message-ignored-resent-headers
6984a176570c (message-ignored-resent-headers): Add "Delivered-To".
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 92694
diff changeset
592 ;; `Delivered-To' needs to be removed because some mailers use it to
6984a176570c (message-ignored-resent-headers): Add "Delivered-To".
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 92694
diff changeset
593 ;; detect loops, so if you resend a message to an address that ultimately
6984a176570c (message-ignored-resent-headers): Add "Delivered-To".
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 92694
diff changeset
594 ;; comes back to you (e.g. a mailing-list to which you subscribe, in which
6984a176570c (message-ignored-resent-headers): Add "Delivered-To".
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 92694
diff changeset
595 ;; case you may be removed from the list on the grounds that mail to you
6984a176570c (message-ignored-resent-headers): Add "Delivered-To".
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 92694
diff changeset
596 ;; bounced with a "mailing loop" error).
6984a176570c (message-ignored-resent-headers): Add "Delivered-To".
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 92694
diff changeset
597 "^Return-receipt\\|^X-Gnus\\|^Gnus-Warning:\\|^>?From \\|^Delivered-To:"
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
598 "*All headers that match this regexp will be deleted when resending a message."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
599 :group 'message-interface
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
600 :link '(custom-manual "(message)Resending")
57561
505c55fe8dc9 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-621
Miles Bader <miles@gnu.org>
parents: 57489
diff changeset
601 :type '(repeat :value-to-internal (lambda (widget value)
505c55fe8dc9 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-621
Miles Bader <miles@gnu.org>
parents: 57489
diff changeset
602 (custom-split-regexp-maybe value))
505c55fe8dc9 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-621
Miles Bader <miles@gnu.org>
parents: 57489
diff changeset
603 :match (lambda (widget value)
505c55fe8dc9 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-621
Miles Bader <miles@gnu.org>
parents: 57489
diff changeset
604 (or (stringp value)
505c55fe8dc9 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-621
Miles Bader <miles@gnu.org>
parents: 57489
diff changeset
605 (widget-editable-list-match widget value)))
505c55fe8dc9 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-621
Miles Bader <miles@gnu.org>
parents: 57489
diff changeset
606 regexp))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
607
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
608 (defcustom message-forward-ignored-headers "^Content-Transfer-Encoding:\\|^X-Gnus"
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
609 "*All headers that match this regexp will be deleted when forwarding a message."
33400
42c1ba3caf9c (message-forward-as-mime, message-forward-ignored-headers)
Dave Love <fx@gnu.org>
parents: 33375
diff changeset
610 :version "21.1"
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
611 :group 'message-forwarding
57561
505c55fe8dc9 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-621
Miles Bader <miles@gnu.org>
parents: 57489
diff changeset
612 :type '(repeat :value-to-internal (lambda (widget value)
505c55fe8dc9 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-621
Miles Bader <miles@gnu.org>
parents: 57489
diff changeset
613 (custom-split-regexp-maybe value))
505c55fe8dc9 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-621
Miles Bader <miles@gnu.org>
parents: 57489
diff changeset
614 :match (lambda (widget value)
505c55fe8dc9 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-621
Miles Bader <miles@gnu.org>
parents: 57489
diff changeset
615 (or (stringp value)
505c55fe8dc9 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-621
Miles Bader <miles@gnu.org>
parents: 57489
diff changeset
616 (widget-editable-list-match widget value)))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
617 regexp))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
618
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
619 (defcustom message-ignored-cited-headers "."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
620 "*Delete these headers from the messages you yank."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
621 :group 'message-insertion
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
622 :link '(custom-manual "(message)Insertion Variables")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
623 :type 'regexp)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
624
110629
531fc2a3b1cc Fix message-* user options that differ from Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110587
diff changeset
625 (defcustom message-cite-prefix-regexp mail-citation-prefix-regexp
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
626 "*Regexp matching the longest possible citation prefix on a line."
110587
e474d7d76259 Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110533
diff changeset
627 :version "24.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
628 :group 'message-insertion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
629 :link '(custom-manual "(message)Insertion Variables")
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
630 :type 'regexp
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
631 :set (lambda (symbol value)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
632 (prog1
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
633 (custom-set-default symbol value)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
634 (if (boundp 'gnus-message-cite-prefix-regexp)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
635 (setq gnus-message-cite-prefix-regexp
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
636 (concat "^\\(?:" value "\\)"))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
637
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
638 (defcustom message-cancel-message "I am canceling my own article.\n"
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
639 "Message to be inserted in the cancel message."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
640 :group 'message-interface
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
641 :link '(custom-manual "(message)Canceling News")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
642 :type 'string)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
643
86254
0d061e2dce73 (message-send-mail-function): New function.
Reiner Steib <Reiner.Steib@gmx.de>
parents: 86154
diff changeset
644 (defun message-send-mail-function ()
0d061e2dce73 (message-send-mail-function): New function.
Reiner Steib <Reiner.Steib@gmx.de>
parents: 86154
diff changeset
645 "Return suitable value for the variable `message-send-mail-function'."
86276
b284b075c181 (message-send-mail-function): Require sendmail.
Reiner Steib <Reiner.Steib@gmx.de>
parents: 86257
diff changeset
646 (cond ((and (require 'sendmail)
b284b075c181 (message-send-mail-function): Require sendmail.
Reiner Steib <Reiner.Steib@gmx.de>
parents: 86257
diff changeset
647 (boundp 'sendmail-program)
b284b075c181 (message-send-mail-function): Require sendmail.
Reiner Steib <Reiner.Steib@gmx.de>
parents: 86257
diff changeset
648 sendmail-program
86256
b53cbc241b6f (message-send-mail-function): Check for smtpmail too.
Reiner Steib <Reiner.Steib@gmx.de>
parents: 86254
diff changeset
649 (executable-find sendmail-program))
86254
0d061e2dce73 (message-send-mail-function): New function.
Reiner Steib <Reiner.Steib@gmx.de>
parents: 86154
diff changeset
650 'message-send-mail-with-sendmail)
86256
b53cbc241b6f (message-send-mail-function): Check for smtpmail too.
Reiner Steib <Reiner.Steib@gmx.de>
parents: 86254
diff changeset
651 ((and (locate-library "smtpmail")
107427
ecbe0edc4f69 Stop message.el from loading about 40 libraries it doesn't always need.
Glenn Morris <rgm@gnu.org>
parents: 107235
diff changeset
652 (boundp 'smtpmail-default-smtp-server)
86256
b53cbc241b6f (message-send-mail-function): Check for smtpmail too.
Reiner Steib <Reiner.Steib@gmx.de>
parents: 86254
diff changeset
653 smtpmail-default-smtp-server)
b53cbc241b6f (message-send-mail-function): Check for smtpmail too.
Reiner Steib <Reiner.Steib@gmx.de>
parents: 86254
diff changeset
654 'message-smtpmail-send-it)
b53cbc241b6f (message-send-mail-function): Check for smtpmail too.
Reiner Steib <Reiner.Steib@gmx.de>
parents: 86254
diff changeset
655 ((locate-library "mailclient")
86254
0d061e2dce73 (message-send-mail-function): New function.
Reiner Steib <Reiner.Steib@gmx.de>
parents: 86154
diff changeset
656 'message-send-mail-with-mailclient)
0d061e2dce73 (message-send-mail-function): New function.
Reiner Steib <Reiner.Steib@gmx.de>
parents: 86154
diff changeset
657 (t
107427
ecbe0edc4f69 Stop message.el from loading about 40 libraries it doesn't always need.
Glenn Morris <rgm@gnu.org>
parents: 107235
diff changeset
658 (error "Don't know how to send mail. Please customize `message-send-mail-function'"))))
86254
0d061e2dce73 (message-send-mail-function): New function.
Reiner Steib <Reiner.Steib@gmx.de>
parents: 86154
diff changeset
659
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
660 ;; Useful to set in site-init.el
107235
a3c102291ce1 Close bug#5643.
Glenn Morris <rgm@gnu.org>
parents: 107211
diff changeset
661 (defcustom message-send-mail-function
a3c102291ce1 Close bug#5643.
Glenn Morris <rgm@gnu.org>
parents: 107211
diff changeset
662 (cond ((eq send-mail-function 'smtpmail-send-it) 'message-smtpmail-send-it)
a3c102291ce1 Close bug#5643.
Glenn Morris <rgm@gnu.org>
parents: 107211
diff changeset
663 ((eq send-mail-function 'feedmail-send-it) 'feedmail-send-it)
a3c102291ce1 Close bug#5643.
Glenn Morris <rgm@gnu.org>
parents: 107211
diff changeset
664 ((eq send-mail-function 'mailclient-send-it)
a3c102291ce1 Close bug#5643.
Glenn Morris <rgm@gnu.org>
parents: 107211
diff changeset
665 'message-send-mail-with-mailclient)
a3c102291ce1 Close bug#5643.
Glenn Morris <rgm@gnu.org>
parents: 107211
diff changeset
666 (t (message-send-mail-function)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
667 "Function to call to send the current buffer as mail.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
668 The headers should be delimited by a line whose contents match the
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
669 variable `mail-header-separator'.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
670
86254
0d061e2dce73 (message-send-mail-function): New function.
Reiner Steib <Reiner.Steib@gmx.de>
parents: 86154
diff changeset
671 Valid values include `message-send-mail-with-sendmail'
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
672 `message-send-mail-with-mh', `message-send-mail-with-qmail',
86254
0d061e2dce73 (message-send-mail-function): New function.
Reiner Steib <Reiner.Steib@gmx.de>
parents: 86154
diff changeset
673 `message-smtpmail-send-it', `smtpmail-send-it',
0d061e2dce73 (message-send-mail-function): New function.
Reiner Steib <Reiner.Steib@gmx.de>
parents: 86154
diff changeset
674 `feedmail-send-it' and `message-send-mail-with-mailclient'. The
92694
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
675 default is system dependent and determined by the function
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
676 `message-send-mail-function'.
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
677
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
678 See also `send-mail-function'."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
679 :type '(radio (function-item message-send-mail-with-sendmail)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
680 (function-item message-send-mail-with-mh)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
681 (function-item message-send-mail-with-qmail)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
682 (function-item message-smtpmail-send-it)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
683 (function-item smtpmail-send-it)
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
684 (function-item feedmail-send-it)
86254
0d061e2dce73 (message-send-mail-function): New function.
Reiner Steib <Reiner.Steib@gmx.de>
parents: 86154
diff changeset
685 (function-item message-send-mail-with-mailclient
0d061e2dce73 (message-send-mail-function): New function.
Reiner Steib <Reiner.Steib@gmx.de>
parents: 86154
diff changeset
686 :tag "Use Mailclient package")
0d061e2dce73 (message-send-mail-function): New function.
Reiner Steib <Reiner.Steib@gmx.de>
parents: 86154
diff changeset
687 (function :tag "Other"))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
688 :group 'message-sending
107235
a3c102291ce1 Close bug#5643.
Glenn Morris <rgm@gnu.org>
parents: 107211
diff changeset
689 :version "23.2"
86254
0d061e2dce73 (message-send-mail-function): New function.
Reiner Steib <Reiner.Steib@gmx.de>
parents: 86154
diff changeset
690 :initialize 'custom-initialize-default
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
691 :link '(custom-manual "(message)Mail Variables")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
692 :group 'message-mail)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
693
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
694 (defcustom message-send-news-function 'message-send-news
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
695 "Function to call to send the current buffer as news.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
696 The headers should be delimited by a line whose contents match the
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
697 variable `mail-header-separator'."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
698 :group 'message-sending
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
699 :group 'message-news
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
700 :link '(custom-manual "(message)News Variables")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
701 :type 'function)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
702
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
703 (defcustom message-reply-to-function nil
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
704 "If non-nil, function that should return a list of headers.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
705 This function should pick out addresses from the To, Cc, and From headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
706 and respond with new To and Cc headers."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
707 :group 'message-interface
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
708 :link '(custom-manual "(message)Reply")
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
709 :type '(choice function (const nil)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
710
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
711 (defcustom message-wide-reply-to-function nil
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
712 "If non-nil, function that should return a list of headers.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
713 This function should pick out addresses from the To, Cc, and From headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
714 and respond with new To and Cc headers."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
715 :group 'message-interface
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
716 :link '(custom-manual "(message)Wide Reply")
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
717 :type '(choice function (const nil)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
718
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
719 (defcustom message-followup-to-function nil
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
720 "If non-nil, function that should return a list of headers.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
721 This function should pick out addresses from the To, Cc, and From headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
722 and respond with new To and Cc headers."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
723 :group 'message-interface
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
724 :link '(custom-manual "(message)Followup")
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
725 :type '(choice function (const nil)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
726
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
727 (defcustom message-extra-wide-headers nil
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
728 "If non-nil, a list of additional address headers.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
729 These are used when composing a wide reply."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
730 :group 'message-sending
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
731 :type '(repeat string))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
732
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
733 (defcustom message-use-followup-to 'ask
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
734 "*Specifies what to do with Followup-To header.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
735 If nil, always ignore the header. If it is t, use its value, but
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
736 query before using the \"poster\" value. If it is the symbol `ask',
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
737 always query the user whether to use the value. If it is the symbol
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
738 `use', always use the value."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
739 :group 'message-interface
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
740 :link '(custom-manual "(message)Followup")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
741 :type '(choice (const :tag "ignore" nil)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
742 (const :tag "use & query" t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
743 (const use)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
744 (const ask)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
745
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
746 (defcustom message-use-mail-followup-to 'use
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
747 "*Specifies what to do with Mail-Followup-To header.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
748 If nil, always ignore the header. If it is the symbol `ask', always
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
749 query the user whether to use the value. If it is the symbol `use',
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
750 always use the value."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59756
diff changeset
751 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
752 :group 'message-interface
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
753 :link '(custom-manual "(message)Mailing Lists")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
754 :type '(choice (const :tag "ignore" nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
755 (const use)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
756 (const ask)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
757
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
758 (defcustom message-subscribed-address-functions nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
759 "*Specifies functions for determining list subscription.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
760 If nil, do not attempt to determine list subscription with functions.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
761 If non-nil, this variable contains a list of functions which return
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
762 regular expressions to match lists. These functions can be used in
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
763 conjunction with `message-subscribed-regexps' and
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
764 `message-subscribed-addresses'."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59756
diff changeset
765 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
766 :group 'message-interface
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
767 :link '(custom-manual "(message)Mailing Lists")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
768 :type '(repeat sexp))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
769
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
770 (defcustom message-subscribed-address-file nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
771 "*A file containing addresses the user is subscribed to.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
772 If nil, do not look at any files to determine list subscriptions. If
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
773 non-nil, each line of this file should be a mailing list address."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59756
diff changeset
774 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
775 :group 'message-interface
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
776 :link '(custom-manual "(message)Mailing Lists")
58835
9bdd97960431 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents: 57856
diff changeset
777 :type '(radio file (const nil)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
778
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
779 (defcustom message-subscribed-addresses nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
780 "*Specifies a list of addresses the user is subscribed to.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
781 If nil, do not use any predefined list subscriptions. This list of
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
782 addresses can be used in conjunction with
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
783 `message-subscribed-address-functions' and `message-subscribed-regexps'."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59756
diff changeset
784 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
785 :group 'message-interface
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
786 :link '(custom-manual "(message)Mailing Lists")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
787 :type '(repeat string))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
788
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
789 (defcustom message-subscribed-regexps nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
790 "*Specifies a list of addresses the user is subscribed to.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
791 If nil, do not use any predefined list subscriptions. This list of
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
792 regular expressions can be used in conjunction with
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
793 `message-subscribed-address-functions' and `message-subscribed-addresses'."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59756
diff changeset
794 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
795 :group 'message-interface
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
796 :link '(custom-manual "(message)Mailing Lists")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
797 :type '(repeat regexp))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
798
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
799 (defcustom message-allow-no-recipients 'ask
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
800 "Specifies what to do when there are no recipients other than Gcc/Fcc.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
801 If it is the symbol `always', the posting is allowed. If it is the
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
802 symbol `never', the posting is not allowed. If it is the symbol
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
803 `ask', you are prompted."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59756
diff changeset
804 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
805 :group 'message-interface
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
806 :link '(custom-manual "(message)Message Headers")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
807 :type '(choice (const always)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
808 (const never)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
809 (const ask)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
810
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
811 (defcustom message-sendmail-f-is-evil nil
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
812 "*Non-nil means don't add \"-f username\" to the sendmail command line.
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
813 Doing so would be even more evil than leaving it out."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
814 :group 'message-sending
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
815 :link '(custom-manual "(message)Mail Variables")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
816 :type 'boolean)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
817
106118
8542a4738a96 * message.el (message-from-style, message-interactive)
Chong Yidong <cyd@stupidchicken.com>
parents: 105167
diff changeset
818 (defcustom message-sendmail-envelope-from
110629
531fc2a3b1cc Fix message-* user options that differ from Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110587
diff changeset
819 ;; `mail-envelope-from' is unavailable unless sendmail.el is loaded.
106218
8ccde493b34d (message-from-style, message-interactive, message-signature): Always set
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 106152
diff changeset
820 (if (boundp 'mail-envelope-from) mail-envelope-from)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
821 "*Envelope-from when sending mail with sendmail.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
822 If this is nil, use `user-mail-address'. If it is the symbol
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
823 `header', use the From: header of the message."
106218
8ccde493b34d (message-from-style, message-interactive, message-signature): Always set
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 106152
diff changeset
824 :version "23.2"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
825 :type '(choice (string :tag "From name")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
826 (const :tag "Use From: header from message" header)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
827 (const :tag "Use `user-mail-address'" nil))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
828 :link '(custom-manual "(message)Mail Variables")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
829 :group 'message-sending)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
830
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
831 (defcustom message-sendmail-extra-arguments nil
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
832 "Additional arguments to `sendmail-program'."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
833 ;; E.g. '("-a" "account") for msmtp
92336
5f827896103e Change defcustom :version from 23.0 to 23.1.
Glenn Morris <rgm@gnu.org>
parents: 92147
diff changeset
834 :version "23.1" ;; No Gnus
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
835 :type '(repeat string)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
836 ;; :link '(custom-manual "(message)Mail Variables")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
837 :group 'message-sending)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
838
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
839 ;; qmail-related stuff
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
840 (defcustom message-qmail-inject-program "/var/qmail/bin/qmail-inject"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
841 "Location of the qmail-inject program."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
842 :group 'message-sending
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
843 :link '(custom-manual "(message)Mail Variables")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
844 :type 'file)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
845
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
846 (defcustom message-qmail-inject-args nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
847 "Arguments passed to qmail-inject programs.
107515
9317d81f8c81 Fix typos in Gnus.
Juanma Barranquero <lekktu@gmail.com>
parents: 107235
diff changeset
848 This should be a list of strings, one string for each argument.
9317d81f8c81 Fix typos in Gnus.
Juanma Barranquero <lekktu@gmail.com>
parents: 107235
diff changeset
849 It may also be a function.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
850
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
851 For e.g., if you wish to set the envelope sender address so that bounces
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
852 go to the right place or to deal with listserv's usage of that address, you
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
853 might set this variable to '(\"-f\" \"you@some.where\")."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
854 :group 'message-sending
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
855 :link '(custom-manual "(message)Mail Variables")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
856 :type '(choice (function)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
857 (repeat string)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
858
86154
1cdfc94602cb * smime.el (from):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85974
diff changeset
859 (defvar gnus-post-method)
1cdfc94602cb * smime.el (from):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85974
diff changeset
860 (defvar gnus-select-method)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
861 (defcustom message-post-method
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
862 (cond ((and (boundp 'gnus-post-method)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
863 (listp gnus-post-method)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
864 gnus-post-method)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
865 gnus-post-method)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
866 ((boundp 'gnus-select-method)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
867 gnus-select-method)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
868 (t '(nnspool "")))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
869 "*Method used to post news.
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
870 Note that when posting from inside Gnus, for instance, this
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
871 variable isn't used."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
872 :group 'message-news
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
873 :group 'message-sending
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
874 ;; This should be the `gnus-select-method' widget, but that might
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
875 ;; create a dependence to `gnus.el'.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
876 :type 'sexp)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
877
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
878 ;; FIXME: This should be a temporary workaround until someone implements a
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
879 ;; proper solution. If a crash happens while replying, the auto-save file
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
880 ;; will *not* have a `References:' header if `message-generate-headers-first'
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
881 ;; is nil. See: http://article.gmane.org/gmane.emacs.gnus.general/51138
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
882 (defcustom message-generate-headers-first '(references)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
883 "Which headers should be generated before starting to compose a message.
59756
b53453586872 (message-beginning-of-line): Change the behavior when
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 58835
diff changeset
884 If t, generate all required headers. This can also be a list of headers to
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
885 generate. The variables `message-required-news-headers' and
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
886 `message-required-mail-headers' specify which headers to generate.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
887
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
888 Note that the variable `message-deletable-headers' specifies headers which
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
889 are to be deleted and then re-generated before sending, so this variable
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
890 will not have a visible effect for those headers."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
891 :group 'message-headers
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
892 :link '(custom-manual "(message)Message Headers")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
893 :type '(choice (const :tag "None" nil)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
894 (const :tag "References" '(references))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
895 (const :tag "All" t)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
896 (repeat (sexp :tag "Header"))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
897
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
898 (defcustom message-fill-column 72
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
899 "Column beyond which automatic line-wrapping should happen.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
900 Local value for message buffers. If non-nil, also turn on
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
901 auto-fill in message buffers."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
902 :group 'message-various
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
903 ;; :link '(custom-manual "(message)Message Headers")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
904 :type '(choice (const :tag "Don't turn on auto fill" nil)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
905 (integer)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
906
106358
8acd940e483a * message.el: Revert last change.
Chong Yidong <cyd@stupidchicken.com>
parents: 106353
diff changeset
907 (defcustom message-setup-hook nil
8acd940e483a * message.el: Revert last change.
Chong Yidong <cyd@stupidchicken.com>
parents: 106353
diff changeset
908 "Normal hook, run each time a new outgoing message is initialized.
8acd940e483a * message.el: Revert last change.
Chong Yidong <cyd@stupidchicken.com>
parents: 106353
diff changeset
909 The function `message-setup' runs this hook."
8acd940e483a * message.el: Revert last change.
Chong Yidong <cyd@stupidchicken.com>
parents: 106353
diff changeset
910 :group 'message-various
8acd940e483a * message.el: Revert last change.
Chong Yidong <cyd@stupidchicken.com>
parents: 106353
diff changeset
911 :link '(custom-manual "(message)Various Message Variables")
8acd940e483a * message.el: Revert last change.
Chong Yidong <cyd@stupidchicken.com>
parents: 106353
diff changeset
912 :type 'hook)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
913
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
914 (defcustom message-cancel-hook nil
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
915 "Hook run when cancelling articles."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
916 :group 'message-various
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
917 :link '(custom-manual "(message)Various Message Variables")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
918 :type 'hook)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
919
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
920 (defcustom message-signature-setup-hook nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
921 "Normal hook, run each time a new outgoing message is initialized.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
922 It is run after the headers have been inserted and before
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
923 the signature is inserted."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
924 :group 'message-various
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
925 :link '(custom-manual "(message)Various Message Variables")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
926 :type 'hook)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
927
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
928 (defcustom message-mode-hook nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
929 "Hook run in message mode buffers."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
930 :group 'message-various
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
931 :type 'hook)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
932
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
933 (defcustom message-header-hook nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
934 "Hook run in a message mode buffer narrowed to the headers."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
935 :group 'message-various
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
936 :type 'hook)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
937
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
938 (defcustom message-header-setup-hook nil
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
939 "Hook called narrowed to the headers when setting up a message buffer."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
940 :group 'message-various
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
941 :link '(custom-manual "(message)Various Message Variables")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
942 :type 'hook)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
943
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
944 (defcustom message-minibuffer-local-map
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
945 (let ((map (make-sparse-keymap 'message-minibuffer-local-map)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
946 (set-keymap-parent map minibuffer-local-map)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
947 map)
57856
df80d19d7a2e Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-660
Miles Bader <miles@gnu.org>
parents: 57581
diff changeset
948 "Keymap for `message-read-from-minibuffer'."
62755
0d1a48b1ca68 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents: 61462
diff changeset
949 :version "22.1"
0d1a48b1ca68 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents: 61462
diff changeset
950 :group 'message-various)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
951
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
952 (defcustom message-citation-line-function 'message-insert-citation-line
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
953 "*Function called to insert the \"Whomever writes:\" line.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
954
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
955 Predefined functions include `message-insert-citation-line' and
85974
403aa95593fa Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85888
diff changeset
956 `message-insert-formatted-citation-line' (see the variable
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
957 `message-citation-line-format').
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
958
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
959 Note that Gnus provides a feature where the reader can click on
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
960 `writes:' to hide the cited text. If you change this line too much,
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
961 people who read your message will have to change their Gnus
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
962 configuration. See the variable `gnus-cite-attribution-suffix'."
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
963 :type '(choice
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
964 (function-item :tag "plain" message-insert-citation-line)
85974
403aa95593fa Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85888
diff changeset
965 (function-item :tag "formatted" message-insert-formatted-citation-line)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
966 (function :tag "Other"))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
967 :link '(custom-manual "(message)Insertion Variables")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
968 :group 'message-insertion)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
969
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
970 (defcustom message-citation-line-format "On %a, %b %d %Y, %N wrote:\n"
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
971 "Format of the \"Whomever writes:\" line.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
972
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
973 The string is formatted using `format-spec'. The following
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
974 constructs are replaced:
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
975
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
976 %f The full From, e.g. \"John Doe <john.doe@example.invalid>\".
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
977 %n The mail address, e.g. \"john.doe@example.invalid\".
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
978 %N The real name if present, e.g.: \"John Doe\", else fall
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
979 back to the mail address.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
980 %F The first name if present, e.g.: \"John\".
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
981 %L The last name if present, e.g.: \"Doe\".
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
982
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
983 All other format specifiers are passed to `format-time-string'
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
984 which is called using the date from the article your replying to.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
985 Extracting the first (%F) and last name (%L) is done
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
986 heuristically, so you should always check it yourself.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
987
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
988 Please also read the note in the documentation of
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
989 `message-citation-line-function'."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
990 :type '(choice (const :tag "Plain" "%f writes:")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
991 (const :tag "Include date" "On %a, %b %d %Y, %n wrote:")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
992 string)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
993 :link '(custom-manual "(message)Insertion Variables")
92336
5f827896103e Change defcustom :version from 23.0 to 23.1.
Glenn Morris <rgm@gnu.org>
parents: 92147
diff changeset
994 :version "23.1" ;; No Gnus
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
995 :group 'message-insertion)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
996
110629
531fc2a3b1cc Fix message-* user options that differ from Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110587
diff changeset
997 (defcustom message-yank-prefix mail-yank-prefix
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
998 "*Prefix inserted on the lines of yanked messages.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
999 Fix `message-cite-prefix-regexp' if it is set to an abnormal value.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1000 See also `message-yank-cited-prefix' and `message-yank-empty-prefix'."
106218
8ccde493b34d (message-from-style, message-interactive, message-signature): Always set
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 106152
diff changeset
1001 :version "23.2"
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1002 :type 'string
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1003 :link '(custom-manual "(message)Insertion Variables")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1004 :group 'message-insertion)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1005
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1006 (defcustom message-yank-cited-prefix ">"
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1007 "*Prefix inserted on cited lines of yanked messages.
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1008 Fix `message-cite-prefix-regexp' if it is set to an abnormal value.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1009 See also `message-yank-prefix' and `message-yank-empty-prefix'."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1010 :version "22.1"
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1011 :type 'string
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1012 :link '(custom-manual "(message)Insertion Variables")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1013 :group 'message-insertion)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1014
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1015 (defcustom message-yank-empty-prefix ">"
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1016 "*Prefix inserted on empty lines of yanked messages.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1017 See also `message-yank-prefix' and `message-yank-cited-prefix'."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59756
diff changeset
1018 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1019 :type 'string
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1020 :link '(custom-manual "(message)Insertion Variables")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1021 :group 'message-insertion)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1022
110629
531fc2a3b1cc Fix message-* user options that differ from Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110587
diff changeset
1023 (defcustom message-indentation-spaces mail-indentation-spaces
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1024 "*Number of spaces to insert at the beginning of each cited line.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1025 Used by `message-yank-original' via `message-yank-cite'."
106218
8ccde493b34d (message-from-style, message-interactive, message-signature): Always set
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 106152
diff changeset
1026 :version "23.2"
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1027 :group 'message-insertion
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1028 :link '(custom-manual "(message)Insertion Variables")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1029 :type 'integer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1030
93386
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
1031 (defcustom message-cite-function 'message-cite-original-without-signature
22656
e3dc0aa099e5 (message-cite-original): If mail-citation-hook
Richard M. Stallman <rms@gnu.org>
parents: 22378
diff changeset
1032 "*Function for citing an original message.
e3dc0aa099e5 (message-cite-original): If mail-citation-hook
Richard M. Stallman <rms@gnu.org>
parents: 22378
diff changeset
1033 Predefined functions include `message-cite-original' and
e3dc0aa099e5 (message-cite-original): If mail-citation-hook
Richard M. Stallman <rms@gnu.org>
parents: 22378
diff changeset
1034 `message-cite-original-without-signature'.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1035 Note that these functions use `mail-citation-hook' if that is non-nil."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1036 :type '(radio (function-item message-cite-original)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1037 (function-item message-cite-original-without-signature)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1038 (function-item sc-cite-original)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1039 (function :tag "Other"))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1040 :link '(custom-manual "(message)Insertion Variables")
94209
0ffd6dd0f75d Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 93451
diff changeset
1041 :version "22.3" ;; Gnus 5.10.12 (changed default)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1042 :group 'message-insertion)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1043
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1044 (defcustom message-indent-citation-function 'message-indent-citation
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1045 "*Function for modifying a citation just inserted in the mail buffer.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1046 This can also be a list of functions. Each function can find the
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1047 citation between (point) and (mark t). And each function should leave
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1048 point and mark around the citation text as modified."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1049 :type 'function
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1050 :link '(custom-manual "(message)Insertion Variables")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1051 :group 'message-insertion)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1052
106218
8ccde493b34d (message-from-style, message-interactive, message-signature): Always set
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 106152
diff changeset
1053 (defcustom message-signature mail-signature
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1054 "*String to be inserted at the end of the message buffer.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1055 If t, the `message-signature-file' file will be inserted instead.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1056 If a function, the result from the function will be used instead.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1057 If a form, the result from the form will be used instead."
106218
8ccde493b34d (message-from-style, message-interactive, message-signature): Always set
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 106152
diff changeset
1058 :version "23.2"
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1059 :type 'sexp
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1060 :link '(custom-manual "(message)Insertion Variables")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1061 :group 'message-insertion)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1062
110629
531fc2a3b1cc Fix message-* user options that differ from Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110587
diff changeset
1063 (defcustom message-signature-file mail-signature-file
36036
dcbe0206da25 (message-signature-file): Fix doc, :type.
Dave Love <fx@gnu.org>
parents: 35957
diff changeset
1064 "*Name of file containing the text inserted at end of message buffer.
dcbe0206da25 (message-signature-file): Fix doc, :type.
Dave Love <fx@gnu.org>
parents: 35957
diff changeset
1065 Ignored if the named file doesn't exist.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1066 If nil, don't insert a signature.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1067 If a path is specified, the value of `message-signature-directory' is ignored,
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1068 even if set."
106218
8ccde493b34d (message-from-style, message-interactive, message-signature): Always set
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 106152
diff changeset
1069 :version "23.2"
36036
dcbe0206da25 (message-signature-file): Fix doc, :type.
Dave Love <fx@gnu.org>
parents: 35957
diff changeset
1070 :type '(choice file (const :tags "None" nil))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1071 :link '(custom-manual "(message)Insertion Variables")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1072 :group 'message-insertion)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1073
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1074 (defcustom message-signature-directory nil
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1075 "*Name of directory containing signature files.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1076 Comes in handy if you have many such files, handled via posting styles for
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1077 instance.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1078 If nil, `message-signature-file' is expected to specify the directory if
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1079 needed."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1080 :type '(choice string (const :tags "None" nil))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1081 :link '(custom-manual "(message)Insertion Variables")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1082 :group 'message-insertion)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1083
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1084 (defcustom message-signature-insert-empty-line t
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1085 "*If non-nil, insert an empty line before the signature separator."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59756
diff changeset
1086 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1087 :type 'boolean
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1088 :link '(custom-manual "(message)Insertion Variables")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1089 :group 'message-insertion)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1090
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1091 (defcustom message-distribution-function nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1092 "*Function called to return a Distribution header."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1093 :group 'message-news
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1094 :group 'message-headers
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1095 :link '(custom-manual "(message)News Headers")
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
1096 :type '(choice function (const nil)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1097
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1098 (defcustom message-expires 14
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1099 "Number of days before your article expires."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1100 :group 'message-news
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1101 :group 'message-headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1102 :link '(custom-manual "(message)News Headers")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1103 :type 'integer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1104
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1105 (defcustom message-user-path nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1106 "If nil, use the NNTP server name in the Path header.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1107 If stringp, use this; if non-nil, use no host name (user name only)."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1108 :group 'message-news
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1109 :group 'message-headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1110 :link '(custom-manual "(message)News Headers")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1111 :type '(choice (const :tag "nntp" nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1112 (string :tag "name")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1113 (sexp :tag "none" :format "%t" t)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1114
106890
2ed4eab78ca3 * message.el (message-mail): Just pass yank-action on to message-setup.
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
1115 ;; This can be the name of a buffer, or a cons cell (FUNCTION . ARGS)
2ed4eab78ca3 * message.el (message-mail): Just pass yank-action on to message-setup.
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
1116 ;; for yanking the original buffer.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1117 (defvar message-reply-buffer nil)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1118 (defvar message-reply-headers nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1119 "The headers of the current replied article.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1120 It is a vector of the following headers:
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1121 \[number subject from date id references chars lines xref extra].")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1122 (defvar message-newsreader nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1123 (defvar message-mailer nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1124 (defvar message-sent-message-via nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1125 (defvar message-checksum nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1126 (defvar message-send-actions nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1127 "A list of actions to be performed upon successful sending of a message.")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1128 (defvar message-exit-actions nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1129 "A list of actions to be performed upon exiting after sending a message.")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1130 (defvar message-kill-actions nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1131 "A list of actions to be performed before killing a message buffer.")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1132 (defvar message-postpone-actions nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1133 "A list of actions to be performed after postponing a message.")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1134
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1135 (define-widget 'message-header-lines 'text
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1136 "All header lines must be LFD terminated."
33982
ff339ba39162 (message-header-lines): Fontify tag.
Miles Bader <miles@gnu.org>
parents: 33768
diff changeset
1137 :format "%{%t%}:%n%v"
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1138 :valid-regexp "^\\'"
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1139 :error "All header lines must be newline terminated")
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1140
107686
94ab0ee8d0c8 Fix mail-default-headers handling in Message mode.
Chong Yidong <cyd@stupidchicken.com>
parents: 107515
diff changeset
1141 (defcustom message-default-headers ""
111168
d1079095427d Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 111082
diff changeset
1142 "Header lines to be inserted in outgoing messages.
d1079095427d Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 111082
diff changeset
1143 This can be set to a string containing or a function returning
d1079095427d Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 111082
diff changeset
1144 header lines to be inserted before you edit the message, so you
d1079095427d Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 111082
diff changeset
1145 can edit or delete these lines. If set to a function, it is
d1079095427d Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 111082
diff changeset
1146 called and its result is inserted."
106218
8ccde493b34d (message-from-style, message-interactive, message-signature): Always set
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 106152
diff changeset
1147 :version "23.2"
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1148 :group 'message-headers
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1149 :link '(custom-manual "(message)Message Headers")
111168
d1079095427d Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 111082
diff changeset
1150 :type '(choice
d1079095427d Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 111082
diff changeset
1151 (message-header-lines :tag "String")
d1079095427d Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 111082
diff changeset
1152 (function :tag "Function")))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1153
107157
6a11e3b311d8 Change a custom default to ease the mail->message transition.
Glenn Morris <rgm@gnu.org>
parents: 106892
diff changeset
1154 (defcustom message-default-mail-headers
6a11e3b311d8 Change a custom default to ease the mail->message transition.
Glenn Morris <rgm@gnu.org>
parents: 106892
diff changeset
1155 ;; Ease the transition from mail-mode to message-mode. See bugs#4431, 5555.
6a11e3b311d8 Change a custom default to ease the mail->message transition.
Glenn Morris <rgm@gnu.org>
parents: 106892
diff changeset
1156 (concat (if (and (boundp 'mail-default-reply-to)
6a11e3b311d8 Change a custom default to ease the mail->message transition.
Glenn Morris <rgm@gnu.org>
parents: 106892
diff changeset
1157 (stringp mail-default-reply-to))
107686
94ab0ee8d0c8 Fix mail-default-headers handling in Message mode.
Chong Yidong <cyd@stupidchicken.com>
parents: 107515
diff changeset
1158 (format "Reply-to: %s\n" mail-default-reply-to))
107157
6a11e3b311d8 Change a custom default to ease the mail->message transition.
Glenn Morris <rgm@gnu.org>
parents: 106892
diff changeset
1159 (if (and (boundp 'mail-self-blind)
6a11e3b311d8 Change a custom default to ease the mail->message transition.
Glenn Morris <rgm@gnu.org>
parents: 106892
diff changeset
1160 mail-self-blind)
107686
94ab0ee8d0c8 Fix mail-default-headers handling in Message mode.
Chong Yidong <cyd@stupidchicken.com>
parents: 107515
diff changeset
1161 (format "BCC: %s\n" user-mail-address))
107157
6a11e3b311d8 Change a custom default to ease the mail->message transition.
Glenn Morris <rgm@gnu.org>
parents: 106892
diff changeset
1162 (if (and (boundp 'mail-archive-file-name)
6a11e3b311d8 Change a custom default to ease the mail->message transition.
Glenn Morris <rgm@gnu.org>
parents: 106892
diff changeset
1163 (stringp mail-archive-file-name))
107686
94ab0ee8d0c8 Fix mail-default-headers handling in Message mode.
Chong Yidong <cyd@stupidchicken.com>
parents: 107515
diff changeset
1164 (format "FCC: %s\n" mail-archive-file-name))
94ab0ee8d0c8 Fix mail-default-headers handling in Message mode.
Chong Yidong <cyd@stupidchicken.com>
parents: 107515
diff changeset
1165 ;; Use the value of `mail-default-headers' if available.
110635
6c6f3972c99c Fix comments; remove Emacs 21 stuff.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110629
diff changeset
1166 ;; Note: as for XEmacs 21.4 and 21.5, it is unavailable
6c6f3972c99c Fix comments; remove Emacs 21 stuff.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110629
diff changeset
1167 ;; unless sendmail.el is loaded.
107686
94ab0ee8d0c8 Fix mail-default-headers handling in Message mode.
Chong Yidong <cyd@stupidchicken.com>
parents: 107515
diff changeset
1168 (if (boundp 'mail-default-headers)
94ab0ee8d0c8 Fix mail-default-headers handling in Message mode.
Chong Yidong <cyd@stupidchicken.com>
parents: 107515
diff changeset
1169 mail-default-headers))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1170 "*A string of header lines to be inserted in outgoing mails."
107157
6a11e3b311d8 Change a custom default to ease the mail->message transition.
Glenn Morris <rgm@gnu.org>
parents: 106892
diff changeset
1171 :version "23.2"
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1172 :group 'message-headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1173 :group 'message-mail
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1174 :link '(custom-manual "(message)Mail Headers")
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1175 :type 'message-header-lines)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1176
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1177 (defcustom message-default-news-headers ""
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1178 "*A string of header lines to be inserted in outgoing news articles."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1179 :group 'message-headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1180 :group 'message-news
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1181 :link '(custom-manual "(message)News Headers")
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1182 :type 'message-header-lines)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1183
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1184 ;; Note: could use /usr/ucb/mail instead of sendmail;
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1185 ;; options -t, and -v if not interactive.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1186 (defcustom message-mailer-swallows-blank-line
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1187 (if (and (string-match "sparc-sun-sunos\\(\\'\\|[^5]\\)"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1188 system-configuration)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1189 (file-readable-p "/etc/sendmail.cf")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1190 (let ((buffer (get-buffer-create " *temp*")))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1191 (unwind-protect
86339
6f4793ab0756 (message-send-mail-function): Fix error convention.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 86276
diff changeset
1192 (with-current-buffer buffer
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1193 (insert-file-contents "/etc/sendmail.cf")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1194 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1195 (let ((case-fold-search nil))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1196 (re-search-forward "^OR\\>" nil t)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1197 (kill-buffer buffer))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1198 ;; According to RFC822, "The field-name must be composed of printable
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1199 ;; ASCII characters (i. e., characters that have decimal values between
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1200 ;; 33 and 126, except colon)", i. e., any chars except ctl chars,
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1201 ;; space, or colon.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1202 '(looking-at "[ \t]\\|[][!\"#$%&'()*+,-./0-9;<=>?@A-Z\\\\^_`a-z{|}~]+:"))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1203 "*Set this non-nil if the system's mailer runs the header and body together.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1204 \(This problem exists on Sunos 4 when sendmail is run in remote mode.)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1205 The value should be an expression to test whether the problem will
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1206 actually occur."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1207 :group 'message-sending
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1208 :link '(custom-manual "(message)Mail Variables")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1209 :type 'sexp)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1210
19481
4d492290e085 (message-user-agent): Add autoload cookie.
Richard M. Stallman <rms@gnu.org>
parents: 17493
diff changeset
1211 ;;;###autoload
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1212 (define-mail-user-agent 'message-user-agent
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1213 'message-mail 'message-send-and-exit
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1214 'message-kill-buffer 'message-send-hook)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1215
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1216 (defvar message-mh-deletable-headers '(Message-ID Date Lines Sender)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1217 "If non-nil, delete the deletable headers before feeding to mh.")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1218
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
1219 (defvar message-send-method-alist
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
1220 '((news message-news-p message-send-via-news)
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
1221 (mail message-mail-p message-send-via-mail))
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
1222 "Alist of ways to send outgoing messages.
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
1223 Each element has the form
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
1224
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
1225 \(TYPE PREDICATE FUNCTION)
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
1226
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
1227 where TYPE is a symbol that names the method; PREDICATE is a function
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
1228 called without any parameters to determine whether the message is
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
1229 a message of type TYPE; and FUNCTION is a function to be called if
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
1230 PREDICATE returns non-nil. FUNCTION is called with one parameter --
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
1231 the prefix.")
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
1232
34058
9f5e2364ef2b (message-mail-alias-type): Customize.
Dave Love <fx@gnu.org>
parents: 34057
diff changeset
1233 (defcustom message-mail-alias-type 'abbrev
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
1234 "*What alias expansion type to use in Message buffers.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1235 The default is `abbrev', which uses mailabbrev. `ecomplete' uses
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1236 an electric completion mode. nil switches mail aliases off.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1237 This can also be a list of values."
34058
9f5e2364ef2b (message-mail-alias-type): Customize.
Dave Love <fx@gnu.org>
parents: 34057
diff changeset
1238 :group 'message
9f5e2364ef2b (message-mail-alias-type): Customize.
Dave Love <fx@gnu.org>
parents: 34057
diff changeset
1239 :link '(custom-manual "(message)Mail Aliases")
9f5e2364ef2b (message-mail-alias-type): Customize.
Dave Love <fx@gnu.org>
parents: 34057
diff changeset
1240 :type '(choice (const :tag "Use Mailabbrev" abbrev)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1241 (const :tag "Use ecomplete" ecomplete)
34058
9f5e2364ef2b (message-mail-alias-type): Customize.
Dave Love <fx@gnu.org>
parents: 34057
diff changeset
1242 (const :tag "No expansion" nil)))
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
1243
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1244 (defcustom message-self-insert-commands '(self-insert-command)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1245 "List of `self-insert-command's used to trigger ecomplete.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1246 When one of those commands is invoked to enter a character in To or Cc
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1247 header, ecomplete will suggest the candidates of recipients (see also
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1248 `message-mail-alias-type'). If you use some tool to enter non-ASCII
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1249 text and it replaces `self-insert-command' with the other command, e.g.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1250 `egg-self-insert-command', you may want to add it to this list."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1251 :group 'message-various
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1252 :type '(repeat function))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1253
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1254 (defcustom message-auto-save-directory
107427
ecbe0edc4f69 Stop message.el from loading about 40 libraries it doesn't always need.
Glenn Morris <rgm@gnu.org>
parents: 107235
diff changeset
1255 (file-name-as-directory (expand-file-name "drafts" message-directory))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1256 "*Directory where Message auto-saves buffers if Gnus isn't running.
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1257 If nil, Message won't auto-save."
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1258 :group 'message-buffers
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1259 :link '(custom-manual "(message)Various Message Variables")
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
1260 :type '(choice directory (const :tag "Don't auto-save" nil)))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1261
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
1262 (defcustom message-default-charset
32967
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
1263 (and (not (mm-multibyte-p)) 'iso-8859-1)
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
1264 "Default charset used in non-MULE Emacsen.
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
1265 If nil, you might be asked to input the charset."
33400
42c1ba3caf9c (message-forward-as-mime, message-forward-ignored-headers)
Dave Love <fx@gnu.org>
parents: 33375
diff changeset
1266 :version "21.1"
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1267 :group 'message
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1268 :link '(custom-manual "(message)Various Message Variables")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1269 :type 'symbol)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1270
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
1271 (defcustom message-dont-reply-to-names
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1272 (and (boundp 'rmail-dont-reply-to-names) rmail-dont-reply-to-names)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1273 "*Addresses to prune when doing wide replies.
86339
6f4793ab0756 (message-send-mail-function): Fix error convention.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 86276
diff changeset
1274 This can be a regexp or a list of regexps. Also, a value of nil means
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1275 exclude your own user name only."
33400
42c1ba3caf9c (message-forward-as-mime, message-forward-ignored-headers)
Dave Love <fx@gnu.org>
parents: 33375
diff changeset
1276 :version "21.1"
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1277 :group 'message
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1278 :link '(custom-manual "(message)Wide Reply")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1279 :type '(choice (const :tag "Yourself" nil)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1280 regexp
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1281 (repeat :tag "Regexp List" regexp)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1282
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1283 (defsubst message-dont-reply-to-names ()
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1284 (gmm-regexp-concat message-dont-reply-to-names))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1285
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1286 (defvar message-shoot-gnksa-feet nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1287 "*A list of GNKSA feet you are allowed to shoot.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1288 Gnus gives you all the opportunity you could possibly want for
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1289 shooting yourself in the foot. Also, Gnus allows you to shoot the
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1290 feet of Good Net-Keeping Seal of Approval. The following are foot
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1291 candidates:
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1292 `empty-article' Allow you to post an empty article;
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1293 `quoted-text-only' Allow you to post quoted text only;
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1294 `multiple-copies' Allow you to post multiple copies;
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1295 `cancel-messages' Allow you to cancel or supersede messages from
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1296 your other email addresses.")
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1297
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1298 (defsubst message-gnksa-enable-p (feature)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1299 (or (not (listp message-shoot-gnksa-feet))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1300 (memq feature message-shoot-gnksa-feet)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1301
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1302 (defcustom message-hidden-headers '("^References:" "^Face:" "^X-Face:"
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1303 "^X-Draft-From:")
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1304 "Regexp of headers to be hidden when composing new messages.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1305 This can also be a list of regexps to match headers. Or a list
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1306 starting with `not' and followed by regexps."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59756
diff changeset
1307 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1308 :group 'message
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1309 :link '(custom-manual "(message)Message Headers")
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1310 :type '(choice
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1311 :format "%{%t%}: %[Value Type%] %v"
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1312 (regexp :menu-tag "regexp" :format "regexp\n%t: %v")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1313 (repeat :menu-tag "(regexp ...)" :format "(regexp ...)\n%v%i"
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1314 (regexp :format "%t: %v"))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1315 (cons :menu-tag "(not regexp ...)" :format "(not regexp ...)\n%v"
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1316 (const not)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1317 (repeat :format "%v%i"
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1318 (regexp :format "%t: %v")))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1319
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1320 (defcustom message-cite-articles-with-x-no-archive t
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1321 "If non-nil, cite text from articles that has X-No-Archive set."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1322 :group 'message
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1323 :type 'boolean)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1324
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1325 ;;; Internal variables.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1326 ;;; Well, not really internal.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1327
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1328 (defvar message-mode-syntax-table
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1329 (let ((table (copy-syntax-table text-mode-syntax-table)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1330 (modify-syntax-entry ?% ". " table)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1331 (modify-syntax-entry ?> ". " table)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1332 (modify-syntax-entry ?< ". " table)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1333 table)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1334 "Syntax table used while in Message mode.")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1335
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1336 (defface message-header-to
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1337 '((((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1338 (background dark))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1339 (:foreground "DarkOliveGreen1" :bold t))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1340 (((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1341 (background light))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1342 (:foreground "MidnightBlue" :bold t))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1343 (t
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1344 (:bold t :italic t)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1345 "Face used for displaying From headers."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1346 :group 'message-faces)
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1347 ;; backward-compatibility alias
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1348 (put 'message-header-to-face 'face-alias 'message-header-to)
104789
aa91debbb2f2 Mark face aliases with "-face" in the name as obsolete.
Glenn Morris <rgm@gnu.org>
parents: 102061
diff changeset
1349 (put 'message-header-to-face 'obsolete-face "22.1")
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1350
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1351 (defface message-header-cc
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1352 '((((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1353 (background dark))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1354 (:foreground "chartreuse1" :bold t))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1355 (((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1356 (background light))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1357 (:foreground "MidnightBlue"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1358 (t
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1359 (:bold t)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1360 "Face used for displaying Cc headers."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1361 :group 'message-faces)
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1362 ;; backward-compatibility alias
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1363 (put 'message-header-cc-face 'face-alias 'message-header-cc)
104789
aa91debbb2f2 Mark face aliases with "-face" in the name as obsolete.
Glenn Morris <rgm@gnu.org>
parents: 102061
diff changeset
1364 (put 'message-header-cc-face 'obsolete-face "22.1")
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1365
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1366 (defface message-header-subject
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1367 '((((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1368 (background dark))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1369 (:foreground "OliveDrab1"))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1370 (((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1371 (background light))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1372 (:foreground "navy blue" :bold t))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1373 (t
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1374 (:bold t)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1375 "Face used for displaying subject headers."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1376 :group 'message-faces)
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1377 ;; backward-compatibility alias
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1378 (put 'message-header-subject-face 'face-alias 'message-header-subject)
104789
aa91debbb2f2 Mark face aliases with "-face" in the name as obsolete.
Glenn Morris <rgm@gnu.org>
parents: 102061
diff changeset
1379 (put 'message-header-subject-face 'obsolete-face "22.1")
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1380
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1381 (defface message-header-newsgroups
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1382 '((((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1383 (background dark))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1384 (:foreground "yellow" :bold t :italic t))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1385 (((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1386 (background light))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1387 (:foreground "blue4" :bold t :italic t))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1388 (t
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1389 (:bold t :italic t)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1390 "Face used for displaying newsgroups headers."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1391 :group 'message-faces)
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1392 ;; backward-compatibility alias
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1393 (put 'message-header-newsgroups-face 'face-alias 'message-header-newsgroups)
104789
aa91debbb2f2 Mark face aliases with "-face" in the name as obsolete.
Glenn Morris <rgm@gnu.org>
parents: 102061
diff changeset
1394 (put 'message-header-newsgroups-face 'obsolete-face "22.1")
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1395
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1396 (defface message-header-other
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1397 '((((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1398 (background dark))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1399 (:foreground "VioletRed1"))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1400 (((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1401 (background light))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1402 (:foreground "steel blue"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1403 (t
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1404 (:bold t :italic t)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1405 "Face used for displaying newsgroups headers."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1406 :group 'message-faces)
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1407 ;; backward-compatibility alias
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1408 (put 'message-header-other-face 'face-alias 'message-header-other)
104789
aa91debbb2f2 Mark face aliases with "-face" in the name as obsolete.
Glenn Morris <rgm@gnu.org>
parents: 102061
diff changeset
1409 (put 'message-header-other-face 'obsolete-face "22.1")
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1410
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1411 (defface message-header-name
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1412 '((((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1413 (background dark))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1414 (:foreground "green"))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1415 (((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1416 (background light))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1417 (:foreground "cornflower blue"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1418 (t
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1419 (:bold t)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1420 "Face used for displaying header names."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1421 :group 'message-faces)
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1422 ;; backward-compatibility alias
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1423 (put 'message-header-name-face 'face-alias 'message-header-name)
104789
aa91debbb2f2 Mark face aliases with "-face" in the name as obsolete.
Glenn Morris <rgm@gnu.org>
parents: 102061
diff changeset
1424 (put 'message-header-name-face 'obsolete-face "22.1")
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1425
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1426 (defface message-header-xheader
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1427 '((((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1428 (background dark))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1429 (:foreground "DeepSkyBlue1"))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1430 (((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1431 (background light))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1432 (:foreground "blue"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1433 (t
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1434 (:bold t)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1435 "Face used for displaying X-Header headers."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1436 :group 'message-faces)
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1437 ;; backward-compatibility alias
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1438 (put 'message-header-xheader-face 'face-alias 'message-header-xheader)
104789
aa91debbb2f2 Mark face aliases with "-face" in the name as obsolete.
Glenn Morris <rgm@gnu.org>
parents: 102061
diff changeset
1439 (put 'message-header-xheader-face 'obsolete-face "22.1")
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1440
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1441 (defface message-separator
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1442 '((((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1443 (background dark))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1444 (:foreground "LightSkyBlue1"))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1445 (((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1446 (background light))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1447 (:foreground "brown"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1448 (t
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1449 (:bold t)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1450 "Face used for displaying the separator."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1451 :group 'message-faces)
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1452 ;; backward-compatibility alias
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1453 (put 'message-separator-face 'face-alias 'message-separator)
104789
aa91debbb2f2 Mark face aliases with "-face" in the name as obsolete.
Glenn Morris <rgm@gnu.org>
parents: 102061
diff changeset
1454 (put 'message-separator-face 'obsolete-face "22.1")
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1455
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1456 (defface message-cited-text
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1457 '((((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1458 (background dark))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1459 (:foreground "LightPink1"))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1460 (((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1461 (background light))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1462 (:foreground "red"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1463 (t
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1464 (:bold t)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1465 "Face used for displaying cited text names."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1466 :group 'message-faces)
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1467 ;; backward-compatibility alias
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1468 (put 'message-cited-text-face 'face-alias 'message-cited-text)
104789
aa91debbb2f2 Mark face aliases with "-face" in the name as obsolete.
Glenn Morris <rgm@gnu.org>
parents: 102061
diff changeset
1469 (put 'message-cited-text-face 'obsolete-face "22.1")
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1470
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1471 (defface message-mml
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1472 '((((class color)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1473 (background dark))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1474 (:foreground "MediumSpringGreen"))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1475 (((class color)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1476 (background light))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1477 (:foreground "ForestGreen"))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1478 (t
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1479 (:bold t)))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1480 "Face used for displaying MML."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1481 :group 'message-faces)
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1482 ;; backward-compatibility alias
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1483 (put 'message-mml-face 'face-alias 'message-mml)
104789
aa91debbb2f2 Mark face aliases with "-face" in the name as obsolete.
Glenn Morris <rgm@gnu.org>
parents: 102061
diff changeset
1484 (put 'message-mml-face 'obsolete-face "22.1")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1485
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1486 (defun message-font-lock-make-header-matcher (regexp)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1487 (let ((form
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1488 `(lambda (limit)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1489 (let ((start (point)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1490 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1491 (widen)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1492 (goto-char (point-min))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1493 (if (re-search-forward
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1494 (concat "^" (regexp-quote mail-header-separator) "$")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1495 nil t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1496 (setq limit (min limit (match-beginning 0))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1497 (goto-char start))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1498 (and (< start limit)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1499 (re-search-forward ,regexp limit t))))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1500 (if (featurep 'bytecomp)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1501 (byte-compile form)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1502 form)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1503
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1504 (defvar message-font-lock-keywords
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1505 (let ((content "[ \t]*\\(.+\\(\n[ \t].*\\)*\\)\n?"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1506 `((,(message-font-lock-make-header-matcher
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1507 (concat "^\\([Tt]o:\\)" content))
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1508 (1 'message-header-name)
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1509 (2 'message-header-to nil t))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1510 (,(message-font-lock-make-header-matcher
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1511 (concat "^\\(^[GBF]?[Cc][Cc]:\\|^[Rr]eply-[Tt]o:\\)" content))
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1512 (1 'message-header-name)
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1513 (2 'message-header-cc nil t))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1514 (,(message-font-lock-make-header-matcher
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1515 (concat "^\\([Ss]ubject:\\)" content))
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1516 (1 'message-header-name)
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1517 (2 'message-header-subject nil t))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1518 (,(message-font-lock-make-header-matcher
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1519 (concat "^\\([Nn]ewsgroups:\\|Followup-[Tt]o:\\)" content))
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1520 (1 'message-header-name)
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1521 (2 'message-header-newsgroups nil t))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1522 (,(message-font-lock-make-header-matcher
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1523 (concat "^\\(X-[A-Za-z0-9-]+:\\|In-Reply-To:\\)" content))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1524 (1 'message-header-name)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1525 (2 'message-header-xheader))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1526 (,(message-font-lock-make-header-matcher
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1527 (concat "^\\([A-Z][^: \n\t]+:\\)" content))
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1528 (1 'message-header-name)
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1529 (2 'message-header-other nil t))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1530 ,@(if (and mail-header-separator
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1531 (not (equal mail-header-separator "")))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1532 `((,(concat "^\\(" (regexp-quote mail-header-separator) "\\)$")
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1533 1 'message-separator))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1534 nil)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1535 ((lambda (limit)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1536 (re-search-forward (concat "^\\("
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1537 message-cite-prefix-regexp
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1538 "\\).*")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1539 limit t))
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1540 (0 'message-cited-text))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1541 ("<#/?\\(multipart\\|part\\|external\\|mml\\|secure\\)[^>]*>"
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1542 (0 'message-mml))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1543 "Additional expressions to highlight in Message mode.")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1544
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1545
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1546 ;; XEmacs does it like this. For Emacs, we have to set the
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1547 ;; `font-lock-defaults' buffer-local variable.
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1548 (put 'message-mode 'font-lock-defaults '(message-font-lock-keywords t))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1549
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1550 (defvar message-face-alist
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1551 '((bold . message-bold-region)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1552 (underline . underline-region)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1553 (default . (lambda (b e)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1554 (message-unbold-region b e)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1555 (ununderline-region b e))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1556 "Alist of mail and news faces for facemenu.
48588
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 48376
diff changeset
1557 The cdr of each entry is a function for applying the face to a region.")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1558
106358
8acd940e483a * message.el: Revert last change.
Chong Yidong <cyd@stupidchicken.com>
parents: 106353
diff changeset
1559 (defcustom message-send-hook nil
8acd940e483a * message.el: Revert last change.
Chong Yidong <cyd@stupidchicken.com>
parents: 106353
diff changeset
1560 "Hook run before sending messages.
8acd940e483a * message.el: Revert last change.
Chong Yidong <cyd@stupidchicken.com>
parents: 106353
diff changeset
1561 This hook is run quite early when sending."
8acd940e483a * message.el: Revert last change.
Chong Yidong <cyd@stupidchicken.com>
parents: 106353
diff changeset
1562 :group 'message-various
8acd940e483a * message.el: Revert last change.
Chong Yidong <cyd@stupidchicken.com>
parents: 106353
diff changeset
1563 :options '(ispell-message)
8acd940e483a * message.el: Revert last change.
Chong Yidong <cyd@stupidchicken.com>
parents: 106353
diff changeset
1564 :link '(custom-manual "(message)Various Message Variables")
8acd940e483a * message.el: Revert last change.
Chong Yidong <cyd@stupidchicken.com>
parents: 106353
diff changeset
1565 :type 'hook)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1566
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1567 (defcustom message-send-mail-hook nil
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1568 "Hook run before sending mail messages.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1569 This hook is run very late -- just before the message is sent as
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1570 mail."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1571 :group 'message-various
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1572 :link '(custom-manual "(message)Various Message Variables")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1573 :type 'hook)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1574
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1575 (defcustom message-send-news-hook nil
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1576 "Hook run before sending news messages.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1577 This hook is run very late -- just before the message is sent as
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1578 news."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1579 :group 'message-various
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1580 :link '(custom-manual "(message)Various Message Variables")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1581 :type 'hook)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1582
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1583 (defcustom message-sent-hook nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1584 "Hook run after sending messages."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1585 :group 'message-various
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1586 :type 'hook)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1587
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1588 (defvar message-send-coding-system 'binary
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1589 "Coding system to encode outgoing mail.")
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1590
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1591 (defvar message-draft-coding-system
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1592 mm-auto-save-coding-system
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1593 "*Coding system to compose mail.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1594 If you'd like to make it possible to share draft files between XEmacs
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1595 and Emacs, you may use `iso-2022-7bit' for this value at your own risk.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1596 Note that the coding-system `iso-2022-7bit' isn't suitable to all data.")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1597
110027
9604de1a8d28 Misc Gnus fixes by Lars Magne Ingebrigtsen <larsi@gnus.org>.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110023
diff changeset
1598 (defcustom message-send-mail-partially-limit nil
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1599 "The limitation of messages sent as message/partial.
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
1600 The lower bound of message size in characters, beyond which the message
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
1601 should be sent in several parts. If it is nil, the size is unlimited."
110064
07b5be82cf7a Bump custom version of some user options of which the default values changed.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110039
diff changeset
1602 :version "24.1"
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1603 :group 'message-buffers
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1604 :link '(custom-manual "(message)Mail Variables")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1605 :type '(choice (const :tag "unlimited" nil)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1606 (integer 1000000)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1607
32967
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
1608 (defcustom message-alternative-emails nil
68521
04c2548593f7 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-33
Miles Bader <miles@gnu.org>
parents: 68230
diff changeset
1609 "*Regexp matching alternative email addresses.
04c2548593f7 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-33
Miles Bader <miles@gnu.org>
parents: 68230
diff changeset
1610 The first address in the To, Cc or From headers of the original
04c2548593f7 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-33
Miles Bader <miles@gnu.org>
parents: 68230
diff changeset
1611 article matching this variable is used as the From field of
04c2548593f7 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-33
Miles Bader <miles@gnu.org>
parents: 68230
diff changeset
1612 outgoing messages.
04c2548593f7 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-33
Miles Bader <miles@gnu.org>
parents: 68230
diff changeset
1613
04c2548593f7 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-33
Miles Bader <miles@gnu.org>
parents: 68230
diff changeset
1614 This variable has precedence over posting styles and anything that runs
04c2548593f7 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-33
Miles Bader <miles@gnu.org>
parents: 68230
diff changeset
1615 off `message-setup-hook'."
32967
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
1616 :group 'message-headers
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1617 :link '(custom-manual "(message)Message Headers")
32967
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
1618 :type '(choice (const :tag "Always use primary" nil)
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
1619 regexp))
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
1620
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1621 (defcustom message-hierarchical-addresses nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1622 "A list of hierarchical mail address definitions.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1623
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1624 Inside each entry, the first address is the \"top\" address, and
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1625 subsequent addresses are subaddresses; this is used to indicate that
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1626 mail sent to the first address will automatically be delivered to the
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1627 subaddresses. So if the first address appears in the recipient list
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1628 for a message, the subaddresses will be removed (if present) before
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1629 the mail is sent. All addresses in this structure should be
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1630 downcased."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59756
diff changeset
1631 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1632 :group 'message-headers
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1633 :type '(repeat (repeat string)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1634
34797
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
1635 (defcustom message-mail-user-agent nil
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
1636 "Like `mail-user-agent'.
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
1637 Except if it is nil, use Gnus native MUA; if it is t, use
34797
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
1638 `mail-user-agent'."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59756
diff changeset
1639 :version "22.1"
34797
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
1640 :type '(radio (const :tag "Gnus native"
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
1641 :format "%t\n"
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
1642 nil)
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
1643 (const :tag "`mail-user-agent'"
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
1644 :format "%t\n"
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
1645 t)
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
1646 (function-item :tag "Default Emacs mail"
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
1647 :format "%t\n"
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
1648 sendmail-user-agent)
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
1649 (function-item :tag "Emacs interface to MH"
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
1650 :format "%t\n"
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
1651 mh-e-user-agent)
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
1652 (function :tag "Other"))
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
1653 :version "21.1"
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
1654 :group 'message)
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
1655
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1656 (defcustom message-wide-reply-confirm-recipients nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1657 "Whether to confirm a wide reply to multiple email recipients.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1658 If this variable is nil, don't ask whether to reply to all recipients.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1659 If this variable is non-nil, pose the question \"Reply to all
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1660 recipients?\" before a wide reply to multiple recipients. If the user
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1661 answers yes, reply to all recipients as usual. If the user answers
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1662 no, only reply back to the author."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59756
diff changeset
1663 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1664 :group 'message-headers
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1665 :link '(custom-manual "(message)Wide Reply")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1666 :type 'boolean)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1667
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1668 (defcustom message-user-fqdn nil
64780
4def766e2c3f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-515
Miles Bader <miles@gnu.org>
parents: 64754
diff changeset
1669 "*Domain part of Message-Ids."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59756
diff changeset
1670 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1671 :group 'message-headers
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1672 :link '(custom-manual "(message)News Headers")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1673 :type '(radio (const :format "%v " nil)
58835
9bdd97960431 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents: 57856
diff changeset
1674 (string :format "FQDN: %v")))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1675
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1676 (defcustom message-use-idna (and (condition-case nil (require 'idna)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1677 (file-error))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1678 (mm-coding-system-p 'utf-8)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1679 (executable-find idna-program)
65742
8e46fef0174c Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-566
Miles Bader <miles@gnu.org>
parents: 65719
diff changeset
1680 (string= (idna-to-ascii "räksmörgås")
8e46fef0174c Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-566
Miles Bader <miles@gnu.org>
parents: 65719
diff changeset
1681 "xn--rksmrgs-5wao1o")
8e46fef0174c Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-566
Miles Bader <miles@gnu.org>
parents: 65719
diff changeset
1682 t)
8e46fef0174c Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-566
Miles Bader <miles@gnu.org>
parents: 65719
diff changeset
1683 "Whether to encode non-ASCII in domain names into ASCII according to IDNA.
8e46fef0174c Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-566
Miles Bader <miles@gnu.org>
parents: 65719
diff changeset
1684 GNU Libidn, and in particular the elisp package \"idna.el\" and
8e46fef0174c Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-566
Miles Bader <miles@gnu.org>
parents: 65719
diff changeset
1685 the external program \"idn\", must be installed for this
8e46fef0174c Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-566
Miles Bader <miles@gnu.org>
parents: 65719
diff changeset
1686 functionality to work."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59756
diff changeset
1687 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1688 :group 'message-headers
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1689 :link '(custom-manual "(message)IDNA")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1690 :type '(choice (const :tag "Ask" ask)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1691 (const :tag "Never" nil)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1692 (const :tag "Always" t)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1693
110156
a2439ed30c52 message.el (message-generate-hashcash): Change default to 'opportunistic if hashcash is installed; gnus-html.el (gnus-html-put-image): Only call image-size once, since it's somewhat time-consuming on remote X servers.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110139
diff changeset
1694 (defcustom message-generate-hashcash (if (executable-find "hashcash") 'opportunistic)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1695 "*Whether to generate X-Hashcash: headers.
86339
6f4793ab0756 (message-send-mail-function): Fix error convention.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 86276
diff changeset
1696 If t, always generate hashcash headers. If `opportunistic',
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1697 only generate hashcash headers if it can be done without the user
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1698 waiting (i.e., only asynchronously).
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1699
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1700 You must have the \"hashcash\" binary installed, see `hashcash-path'."
110156
a2439ed30c52 message.el (message-generate-hashcash): Change default to 'opportunistic if hashcash is installed; gnus-html.el (gnus-html-put-image): Only call image-size once, since it's somewhat time-consuming on remote X servers.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110139
diff changeset
1701 :version "24.1"
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1702 :group 'message-headers
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1703 :link '(custom-manual "(message)Mail Headers")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1704 :type '(choice (const :tag "Always" t)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1705 (const :tag "Never" nil)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1706 (const :tag "Opportunistic" opportunistic)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1707
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1708 ;;; Internal variables.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1709
32967
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
1710 (defvar message-sending-message "Sending...")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1711 (defvar message-buffer-list nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1712 (defvar message-this-is-news nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1713 (defvar message-this-is-mail nil)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1714 (defvar message-draft-article nil)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1715 (defvar message-mime-part nil)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1716 (defvar message-posting-charset nil)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1717 (defvar message-inserted-headers nil)
110023
fa10effce8f8 Misc Gnus fixes by Lars Magne Ingebrigtsen <larsi@gnus.org>.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108513
diff changeset
1718 (defvar message-inhibit-ecomplete nil)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1719
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1720 ;; Byte-compiler warning
86154
1cdfc94602cb * smime.el (from):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85974
diff changeset
1721 (defvar gnus-active-hashtb)
1cdfc94602cb * smime.el (from):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85974
diff changeset
1722 (defvar gnus-read-active-file)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1723
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1724 ;;; Regexp matching the delimiter of messages in UNIX mail format
19762
f6ca32374b0b (message-unix-mail-delimiter): Initialize
Richard M. Stallman <rms@gnu.org>
parents: 19525
diff changeset
1725 ;;; (UNIX From lines), minus the initial ^. It should be a copy
f6ca32374b0b (message-unix-mail-delimiter): Initialize
Richard M. Stallman <rms@gnu.org>
parents: 19525
diff changeset
1726 ;;; of rmail.el's rmail-unix-mail-delimiter.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1727 (defvar message-unix-mail-delimiter
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1728 (let ((time-zone-regexp
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1729 (concat "\\([A-Z]?[A-Z]?[A-Z][A-Z]\\( DST\\)?"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1730 "\\|[-+]?[0-9][0-9][0-9][0-9]"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1731 "\\|"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1732 "\\) *")))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1733 (concat
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1734 "From "
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1735
19762
f6ca32374b0b (message-unix-mail-delimiter): Initialize
Richard M. Stallman <rms@gnu.org>
parents: 19525
diff changeset
1736 ;; Many things can happen to an RFC 822 mailbox before it is put into
f6ca32374b0b (message-unix-mail-delimiter): Initialize
Richard M. Stallman <rms@gnu.org>
parents: 19525
diff changeset
1737 ;; a `From' line. The leading phrase can be stripped, e.g.
f6ca32374b0b (message-unix-mail-delimiter): Initialize
Richard M. Stallman <rms@gnu.org>
parents: 19525
diff changeset
1738 ;; `Joe <@w.x:joe@y.z>' -> `<@w.x:joe@y.z>'. The <> can be stripped, e.g.
f6ca32374b0b (message-unix-mail-delimiter): Initialize
Richard M. Stallman <rms@gnu.org>
parents: 19525
diff changeset
1739 ;; `<@x.y:joe@y.z>' -> `@x.y:joe@y.z'. Everything starting with a CRLF
f6ca32374b0b (message-unix-mail-delimiter): Initialize
Richard M. Stallman <rms@gnu.org>
parents: 19525
diff changeset
1740 ;; can be removed, e.g.
f6ca32374b0b (message-unix-mail-delimiter): Initialize
Richard M. Stallman <rms@gnu.org>
parents: 19525
diff changeset
1741 ;; From: joe@y.z (Joe K
f6ca32374b0b (message-unix-mail-delimiter): Initialize
Richard M. Stallman <rms@gnu.org>
parents: 19525
diff changeset
1742 ;; User)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1743 ;; can yield `From joe@y.z (Joe K Fri Mar 22 08:11:15 1996', and
19762
f6ca32374b0b (message-unix-mail-delimiter): Initialize
Richard M. Stallman <rms@gnu.org>
parents: 19525
diff changeset
1744 ;; From: Joe User
f6ca32374b0b (message-unix-mail-delimiter): Initialize
Richard M. Stallman <rms@gnu.org>
parents: 19525
diff changeset
1745 ;; <joe@y.z>
f6ca32374b0b (message-unix-mail-delimiter): Initialize
Richard M. Stallman <rms@gnu.org>
parents: 19525
diff changeset
1746 ;; can yield `From Joe User Fri Mar 22 08:11:15 1996'.
f6ca32374b0b (message-unix-mail-delimiter): Initialize
Richard M. Stallman <rms@gnu.org>
parents: 19525
diff changeset
1747 ;; The mailbox can be removed or be replaced by white space, e.g.
f6ca32374b0b (message-unix-mail-delimiter): Initialize
Richard M. Stallman <rms@gnu.org>
parents: 19525
diff changeset
1748 ;; From: "Joe User"{space}{tab}
f6ca32374b0b (message-unix-mail-delimiter): Initialize
Richard M. Stallman <rms@gnu.org>
parents: 19525
diff changeset
1749 ;; <joe@y.z>
f6ca32374b0b (message-unix-mail-delimiter): Initialize
Richard M. Stallman <rms@gnu.org>
parents: 19525
diff changeset
1750 ;; can yield `From {space}{tab} Fri Mar 22 08:11:15 1996',
f6ca32374b0b (message-unix-mail-delimiter): Initialize
Richard M. Stallman <rms@gnu.org>
parents: 19525
diff changeset
1751 ;; where {space} and {tab} represent the Ascii space and tab characters.
f6ca32374b0b (message-unix-mail-delimiter): Initialize
Richard M. Stallman <rms@gnu.org>
parents: 19525
diff changeset
1752 ;; We want to match the results of any of these manglings.
f6ca32374b0b (message-unix-mail-delimiter): Initialize
Richard M. Stallman <rms@gnu.org>
parents: 19525
diff changeset
1753 ;; The following regexp rejects names whose first characters are
f6ca32374b0b (message-unix-mail-delimiter): Initialize
Richard M. Stallman <rms@gnu.org>
parents: 19525
diff changeset
1754 ;; obviously bogus, but after that anything goes.
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1755 "\\([^\0-\b\n-\r\^?].*\\)?"
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1756
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1757 ;; The time the message was sent.
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1758 "\\([^\0-\r \^?]+\\) +" ; day of the week
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1759 "\\([^\0-\r \^?]+\\) +" ; month
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1760 "\\([0-3]?[0-9]\\) +" ; day of month
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1761 "\\([0-2][0-9]:[0-5][0-9]\\(:[0-6][0-9]\\)?\\) *" ; time of day
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1762
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1763 ;; Perhaps a time zone, specified by an abbreviation, or by a
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1764 ;; numeric offset.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1765 time-zone-regexp
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1766
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1767 ;; The year.
19762
f6ca32374b0b (message-unix-mail-delimiter): Initialize
Richard M. Stallman <rms@gnu.org>
parents: 19525
diff changeset
1768 " \\([0-9][0-9]+\\) *"
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1769
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1770 ;; On some systems the time zone can appear after the year, too.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1771 time-zone-regexp
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1772
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1773 ;; Old uucp cruft.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1774 "\\(remote from .*\\)?"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1775
19762
f6ca32374b0b (message-unix-mail-delimiter): Initialize
Richard M. Stallman <rms@gnu.org>
parents: 19525
diff changeset
1776 "\n"))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1777 "Regexp matching the delimiter of messages in UNIX mail format.")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1778
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1779 (defvar message-unsent-separator
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1780 (concat "^ *---+ +Unsent message follows +---+ *$\\|"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1781 "^ *---+ +Returned message +---+ *$\\|"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1782 "^Start of returned message$\\|"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1783 "^ *---+ +Original message +---+ *$\\|"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1784 "^ *--+ +begin message +--+ *$\\|"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1785 "^ *---+ +Original message follows +---+ *$\\|"
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1786 "^ *---+ +Undelivered message follows +---+ *$\\|"
92147
773ae07da318 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87941
diff changeset
1787 "^------ This is a copy of the message, including all the headers. ------ *$\\|"
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1788 "^|? *---+ +Message text follows: +---+ *|?$")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1789 "A regexp that matches the separator before the text of a failed message.")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1790
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1791 (defvar message-field-fillers
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1792 '((To message-fill-field-address)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1793 (Cc message-fill-field-address)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1794 (From message-fill-field-address))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1795 "Alist of header names/filler functions.")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1796
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1797 (defvar message-header-format-alist
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1798 `((From)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1799 (Newsgroups)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1800 (To)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1801 (Cc)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1802 (Subject)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1803 (In-Reply-To)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1804 (Fcc)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1805 (Bcc)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1806 (Date)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1807 (Organization)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1808 (Distribution)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1809 (Lines)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1810 (Expires)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1811 (Message-ID)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1812 (References . message-shorten-references)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1813 (User-Agent))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1814 "Alist used for formatting headers.")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1815
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1816 (defvar message-options nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1817 "Some saved answers when sending message.")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1818
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1819 (defvar message-send-mail-real-function nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1820 "Internal send mail function.")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1821
74984
21f28d10d73a Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 74021
diff changeset
1822 (defvar message-bogus-system-names "^localhost\\.\\|\\.local$"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1823 "The regexp of bogus system names.")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1824
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1825 (defcustom message-valid-fqdn-regexp
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1826 (concat "[a-z0-9][-.a-z0-9]+\\." ;; [hostname.subdomain.]domain.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1827 ;; valid TLDs:
70245
322c5c5027dc Revision: emacs@sv.gnu.org/emacs--devo--0--patch-249
Miles Bader <miles@gnu.org>
parents: 70051
diff changeset
1828 "\\([a-z][a-z]\\|" ;; two letter country TDLs
322c5c5027dc Revision: emacs@sv.gnu.org/emacs--devo--0--patch-249
Miles Bader <miles@gnu.org>
parents: 70051
diff changeset
1829 "aero\\|arpa\\|bitnet\\|biz\\|bofh\\|"
322c5c5027dc Revision: emacs@sv.gnu.org/emacs--devo--0--patch-249
Miles Bader <miles@gnu.org>
parents: 70051
diff changeset
1830 "cat\\|com\\|coop\\|edu\\|gov\\|"
322c5c5027dc Revision: emacs@sv.gnu.org/emacs--devo--0--patch-249
Miles Bader <miles@gnu.org>
parents: 70051
diff changeset
1831 "info\\|int\\|jobs\\|"
322c5c5027dc Revision: emacs@sv.gnu.org/emacs--devo--0--patch-249
Miles Bader <miles@gnu.org>
parents: 70051
diff changeset
1832 "mil\\|mobi\\|museum\\|name\\|net\\|"
322c5c5027dc Revision: emacs@sv.gnu.org/emacs--devo--0--patch-249
Miles Bader <miles@gnu.org>
parents: 70051
diff changeset
1833 "org\\|pro\\|travel\\|uucp\\)")
322c5c5027dc Revision: emacs@sv.gnu.org/emacs--devo--0--patch-249
Miles Bader <miles@gnu.org>
parents: 70051
diff changeset
1834 ;; http://en.wikipedia.org/wiki/List_of_Internet_top-level_domains
322c5c5027dc Revision: emacs@sv.gnu.org/emacs--devo--0--patch-249
Miles Bader <miles@gnu.org>
parents: 70051
diff changeset
1835 ;; http://en.wikipedia.org/wiki/GTLD
322c5c5027dc Revision: emacs@sv.gnu.org/emacs--devo--0--patch-249
Miles Bader <miles@gnu.org>
parents: 70051
diff changeset
1836 ;; `in the process of being approved': .asia .post .tel .sex
322c5c5027dc Revision: emacs@sv.gnu.org/emacs--devo--0--patch-249
Miles Bader <miles@gnu.org>
parents: 70051
diff changeset
1837 ;; "dead" nato bitnet uucp
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1838 "Regular expression that matches a valid FQDN."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1839 ;; see also: gnus-button-valid-fqdn-regexp
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59756
diff changeset
1840 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1841 :group 'message-headers
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1842 :type 'regexp)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1843
95820
645fb33380d6 Remove unnecessary eval-and-compile of autoloads.
Glenn Morris <rgm@gnu.org>
parents: 95580
diff changeset
1844 (autoload 'gnus-alive-p "gnus-util")
645fb33380d6 Remove unnecessary eval-and-compile of autoloads.
Glenn Morris <rgm@gnu.org>
parents: 95580
diff changeset
1845 (autoload 'gnus-delay-article "gnus-delay")
645fb33380d6 Remove unnecessary eval-and-compile of autoloads.
Glenn Morris <rgm@gnu.org>
parents: 95580
diff changeset
1846 (autoload 'gnus-extract-address-components "gnus-util")
645fb33380d6 Remove unnecessary eval-and-compile of autoloads.
Glenn Morris <rgm@gnu.org>
parents: 95580
diff changeset
1847 (autoload 'gnus-find-method-for-group "gnus")
645fb33380d6 Remove unnecessary eval-and-compile of autoloads.
Glenn Morris <rgm@gnu.org>
parents: 95580
diff changeset
1848 (autoload 'gnus-group-decoded-name "gnus-group")
645fb33380d6 Remove unnecessary eval-and-compile of autoloads.
Glenn Morris <rgm@gnu.org>
parents: 95580
diff changeset
1849 (autoload 'gnus-group-name-charset "gnus-group")
645fb33380d6 Remove unnecessary eval-and-compile of autoloads.
Glenn Morris <rgm@gnu.org>
parents: 95580
diff changeset
1850 (autoload 'gnus-group-name-decode "gnus-group")
645fb33380d6 Remove unnecessary eval-and-compile of autoloads.
Glenn Morris <rgm@gnu.org>
parents: 95580
diff changeset
1851 (autoload 'gnus-groups-from-server "gnus")
645fb33380d6 Remove unnecessary eval-and-compile of autoloads.
Glenn Morris <rgm@gnu.org>
parents: 95580
diff changeset
1852 (autoload 'gnus-make-local-hook "gnus-util")
645fb33380d6 Remove unnecessary eval-and-compile of autoloads.
Glenn Morris <rgm@gnu.org>
parents: 95580
diff changeset
1853 (autoload 'gnus-open-server "gnus-int")
645fb33380d6 Remove unnecessary eval-and-compile of autoloads.
Glenn Morris <rgm@gnu.org>
parents: 95580
diff changeset
1854 (autoload 'gnus-output-to-mail "gnus-util")
645fb33380d6 Remove unnecessary eval-and-compile of autoloads.
Glenn Morris <rgm@gnu.org>
parents: 95580
diff changeset
1855 (autoload 'gnus-output-to-rmail "gnus-util")
645fb33380d6 Remove unnecessary eval-and-compile of autoloads.
Glenn Morris <rgm@gnu.org>
parents: 95580
diff changeset
1856 (autoload 'gnus-request-post "gnus-int")
645fb33380d6 Remove unnecessary eval-and-compile of autoloads.
Glenn Morris <rgm@gnu.org>
parents: 95580
diff changeset
1857 (autoload 'gnus-select-frame-set-input-focus "gnus-util")
645fb33380d6 Remove unnecessary eval-and-compile of autoloads.
Glenn Morris <rgm@gnu.org>
parents: 95580
diff changeset
1858 (autoload 'gnus-server-string "gnus")
645fb33380d6 Remove unnecessary eval-and-compile of autoloads.
Glenn Morris <rgm@gnu.org>
parents: 95580
diff changeset
1859 (autoload 'idna-to-ascii "idna")
645fb33380d6 Remove unnecessary eval-and-compile of autoloads.
Glenn Morris <rgm@gnu.org>
parents: 95580
diff changeset
1860 (autoload 'message-setup-toolbar "messagexmas")
645fb33380d6 Remove unnecessary eval-and-compile of autoloads.
Glenn Morris <rgm@gnu.org>
parents: 95580
diff changeset
1861 (autoload 'mh-new-draft-name "mh-comp")
645fb33380d6 Remove unnecessary eval-and-compile of autoloads.
Glenn Morris <rgm@gnu.org>
parents: 95580
diff changeset
1862 (autoload 'mh-send-letter "mh-comp")
645fb33380d6 Remove unnecessary eval-and-compile of autoloads.
Glenn Morris <rgm@gnu.org>
parents: 95580
diff changeset
1863 (autoload 'nndraft-request-associate-buffer "nndraft")
645fb33380d6 Remove unnecessary eval-and-compile of autoloads.
Glenn Morris <rgm@gnu.org>
parents: 95580
diff changeset
1864 (autoload 'nndraft-request-expire-articles "nndraft")
645fb33380d6 Remove unnecessary eval-and-compile of autoloads.
Glenn Morris <rgm@gnu.org>
parents: 95580
diff changeset
1865 (autoload 'nnvirtual-find-group-art "nnvirtual")
645fb33380d6 Remove unnecessary eval-and-compile of autoloads.
Glenn Morris <rgm@gnu.org>
parents: 95580
diff changeset
1866 (autoload 'rmail-dont-reply-to "mail-utils")
645fb33380d6 Remove unnecessary eval-and-compile of autoloads.
Glenn Morris <rgm@gnu.org>
parents: 95580
diff changeset
1867 (autoload 'rmail-msg-is-pruned "rmail")
645fb33380d6 Remove unnecessary eval-and-compile of autoloads.
Glenn Morris <rgm@gnu.org>
parents: 95580
diff changeset
1868 (autoload 'rmail-output "rmailout")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1869
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1870
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1871
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1872 ;;;
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1873 ;;; Utility functions.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1874 ;;;
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1875
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1876 (defmacro message-y-or-n-p (question show &rest text)
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
1877 "Ask QUESTION, displaying remaining args in a temporary buffer if SHOW."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1878 `(message-talkative-question 'y-or-n-p ,question ,show ,@text))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1879
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1880 (defmacro message-delete-line (&optional n)
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
1881 "Delete the current line (and the next N lines)."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1882 `(delete-region (progn (beginning-of-line) (point))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1883 (progn (forward-line ,(or n 1)) (point))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1884
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1885 (defun message-mark-active-p ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1886 "Non-nil means the mark and region are currently active in this buffer."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1887 mark-active)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1888
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1889 (defun message-unquote-tokens (elems)
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
1890 "Remove double quotes (\") from strings in list ELEMS."
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1891 (mapcar (lambda (item)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1892 (while (string-match "^\\(.*\\)\"\\(.*\\)$" item)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1893 (setq item (concat (match-string 1 item)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1894 (match-string 2 item))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1895 item)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1896 elems))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1897
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1898 (defun message-tokenize-header (header &optional separator)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1899 "Split HEADER into a list of header elements.
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1900 SEPARATOR is a string of characters to be used as separators. \",\"
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1901 is used by default."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1902 (if (not header)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1903 nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1904 (let ((regexp (format "[%s]+" (or separator ",")))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1905 (first t)
57489
f7785a1e8cf8 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-615
Miles Bader <miles@gnu.org>
parents: 57363
diff changeset
1906 beg quoted elems paren)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1907 (with-temp-buffer
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1908 (mm-enable-multibyte)
57489
f7785a1e8cf8 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-615
Miles Bader <miles@gnu.org>
parents: 57363
diff changeset
1909 (setq beg (point-min))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1910 (insert header)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1911 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1912 (while (not (eobp))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1913 (if first
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1914 (setq first nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1915 (forward-char 1))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1916 (cond ((and (> (point) beg)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1917 (or (eobp)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1918 (and (looking-at regexp)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1919 (not quoted)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1920 (not paren))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1921 (push (buffer-substring beg (point)) elems)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1922 (setq beg (match-end 0)))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1923 ((eq (char-after) ?\")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1924 (setq quoted (not quoted)))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1925 ((and (eq (char-after) ?\()
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1926 (not quoted))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1927 (setq paren t))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1928 ((and (eq (char-after) ?\))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1929 (not quoted))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1930 (setq paren nil))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1931 (nreverse elems)))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1932
107427
ecbe0edc4f69 Stop message.el from loading about 40 libraries it doesn't always need.
Glenn Morris <rgm@gnu.org>
parents: 107235
diff changeset
1933 (autoload 'nnheader-insert-file-contents "nnheader")
ecbe0edc4f69 Stop message.el from loading about 40 libraries it doesn't always need.
Glenn Morris <rgm@gnu.org>
parents: 107235
diff changeset
1934
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1935 (defun message-mail-file-mbox-p (file)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1936 "Say whether FILE looks like a Unix mbox file."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1937 (when (and (file-exists-p file)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1938 (file-readable-p file)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1939 (file-regular-p file))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1940 (with-temp-buffer
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1941 (nnheader-insert-file-contents file)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1942 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1943 (looking-at message-unix-mail-delimiter))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1944
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1945 (defun message-fetch-field (header &optional not-all)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1946 "The same as `mail-fetch-field', only remove all newlines.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1947 The buffer is expected to be narrowed to just the header of the message;
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1948 see `message-narrow-to-headers-or-head'."
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1949 (let* ((inhibit-point-motion-hooks t)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1950 (value (mail-fetch-field header nil (not not-all))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1951 (when value
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1952 (while (string-match "\n[\t ]+" value)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1953 (setq value (replace-match " " t t value)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1954 value)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1955
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1956 (defun message-field-value (header &optional not-all)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1957 "The same as `message-fetch-field', only narrow to the headers first."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1958 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1959 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1960 (message-narrow-to-headers-or-head)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1961 (message-fetch-field header not-all))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1962
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1963 (defun message-narrow-to-field ()
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1964 "Narrow the buffer to the header on the current line."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1965 (beginning-of-line)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1966 (while (looking-at "[ \t]")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1967 (forward-line -1))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1968 (narrow-to-region
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1969 (point)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1970 (progn
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1971 (forward-line 1)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1972 (if (re-search-forward "^[^ \n\t]" nil t)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
1973 (point-at-bol)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1974 (point-max))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1975 (goto-char (point-min)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1976
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1977 (defun message-add-header (&rest headers)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1978 "Add the HEADERS to the message header, skipping those already present."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1979 (while headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1980 (let (hclean)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1981 (unless (string-match "^\\([^:]+\\):[ \t]*[^ \t]" (car headers))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1982 (error "Invalid header `%s'" (car headers)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1983 (setq hclean (match-string 1 (car headers)))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1984 (save-restriction
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1985 (message-narrow-to-headers)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1986 (unless (re-search-forward (concat "^" (regexp-quote hclean) ":") nil t)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1987 (goto-char (point-max))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1988 (if (string-match "\n$" (car headers))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1989 (insert (car headers))
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
1990 (insert (car headers) ?\n)))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1991 (setq headers (cdr headers))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1992
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1993 (defmacro message-with-reply-buffer (&rest forms)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1994 "Evaluate FORMS in the reply buffer, if it exists."
106890
2ed4eab78ca3 * message.el (message-mail): Just pass yank-action on to message-setup.
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
1995 `(when (and (bufferp message-reply-buffer)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1996 (buffer-name message-reply-buffer))
86339
6f4793ab0756 (message-send-mail-function): Fix error convention.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 86276
diff changeset
1997 (with-current-buffer message-reply-buffer
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1998 ,@forms)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1999
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2000 (put 'message-with-reply-buffer 'lisp-indent-function 0)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2001 (put 'message-with-reply-buffer 'edebug-form-spec '(body))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2002
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2003 (defun message-fetch-reply-field (header)
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
2004 "Fetch field HEADER from the message we're replying to."
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2005 (message-with-reply-buffer
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2006 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2007 (mail-narrow-to-head)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2008 (message-fetch-field header))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2009
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2010 (defun message-strip-list-identifiers (subject)
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
2011 "Remove list identifiers in `gnus-list-identifiers' from string SUBJECT."
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2012 (require 'gnus-sum) ; for gnus-list-identifiers
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2013 (let ((regexp (if (stringp gnus-list-identifiers)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2014 gnus-list-identifiers
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2015 (mapconcat 'identity gnus-list-identifiers " *\\|"))))
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
2016 (if (string-match (concat "\\(\\(\\(Re: +\\)?\\(" regexp
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2017 " *\\)\\)+\\(Re: +\\)?\\)") subject)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2018 (concat (substring subject 0 (match-beginning 1))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2019 (or (match-string 3 subject)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2020 (match-string 5 subject))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2021 (substring subject
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2022 (match-end 1)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2023 subject)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2024
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2025 (defun message-strip-subject-re (subject)
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
2026 "Remove \"Re:\" from subject lines in string SUBJECT."
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2027 (if (string-match message-subject-re-regexp subject)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2028 (substring subject (match-end 0))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2029 subject))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2030
74021
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2031 (defcustom message-replacement-char "."
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2032 "Replacement character used instead of unprintable or not decodable chars."
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2033 :group 'message-various
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2034 :version "22.1" ;; Gnus 5.10.9
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2035 :type '(choice string
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2036 (const ".")
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2037 (const "?")))
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2038
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2039 ;; FIXME: We also should call `message-strip-subject-encoded-words'
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2040 ;; when forwarding. Probably in `message-make-forward-subject' and
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2041 ;; `message-forward-make-body'.
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2042
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2043 (defun message-strip-subject-encoded-words (subject)
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2044 "Fix non-decodable words in SUBJECT."
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2045 ;; Cf. `gnus-simplify-subject-fully'.
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2046 (let* ((case-fold-search t)
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2047 (replacement-chars (format "[%s%s%s]"
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2048 message-replacement-char
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2049 message-replacement-char
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2050 message-replacement-char))
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2051 (enc-word-re "=\\?\\([^?]+\\)\\?\\([QB]\\)\\?\\([^?]+\\)\\(\\?=\\)")
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2052 cs-string
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2053 (have-marker
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2054 (with-temp-buffer
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2055 (insert subject)
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2056 (goto-char (point-min))
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2057 (when (re-search-forward enc-word-re nil t)
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2058 (setq cs-string (match-string 1)))))
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2059 cs-coding q-or-b word-beg word-end)
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2060 (if (or (not have-marker) ;; No encoded word found...
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2061 ;; ... or double encoding was correct:
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2062 (and (stringp cs-string)
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2063 (setq cs-string (downcase cs-string))
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2064 (mm-coding-system-p (intern cs-string))
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2065 (not (prog1
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2066 (y-or-n-p
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2067 (format "\
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2068 Decoded Subject \"%s\"
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2069 contains a valid encoded word. Decode again? "
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2070 subject))
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2071 (setq cs-coding (intern cs-string))))))
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2072 subject
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2073 (with-temp-buffer
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2074 (insert subject)
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2075 (goto-char (point-min))
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2076 (while (re-search-forward enc-word-re nil t)
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2077 (setq cs-string (downcase (match-string 1))
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2078 q-or-b (match-string 2)
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2079 word-beg (match-beginning 0)
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2080 word-end (match-end 0))
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2081 (setq cs-coding
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2082 (if (mm-coding-system-p (intern cs-string))
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2083 (setq cs-coding (intern cs-string))
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2084 nil))
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2085 ;; No double encoded subject? => bogus charset.
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2086 (unless cs-coding
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2087 (setq cs-coding
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2088 (mm-read-coding-system
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2089 (format "\
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2090 Decoded Subject \"%s\"
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2091 contains an encoded word. The charset `%s' is unknown or invalid.
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2092 Hit RET to replace non-decodable characters with \"%s\" or enter replacement
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2093 charset: "
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2094 subject cs-string message-replacement-char)))
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2095 (if cs-coding
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2096 (replace-match (concat "=?" (symbol-name cs-coding)
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2097 "?\\2?\\3\\4\\5"))
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2098 (save-excursion
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2099 (goto-char word-beg)
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2100 (re-search-forward "=\\?\\([^?]+\\)\\?\\([QB]\\)\\?" word-end t)
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2101 (replace-match "")
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2102 ;; QP or base64
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2103 (if (string-match "\\`Q\\'" q-or-b)
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2104 ;; QP
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2105 (progn
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2106 (message "Replacing non-decodable characters with \"%s\"."
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2107 message-replacement-char)
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2108 (while (re-search-forward "\\(=[A-F0-9][A-F0-9]\\)+"
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2109 word-end t)
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2110 (replace-match message-replacement-char)))
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2111 ;; base64
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2112 (message "Replacing non-decodable characters with \"%s\"."
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2113 replacement-chars)
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2114 (re-search-forward "[^?]+" word-end t)
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2115 (replace-match replacement-chars))
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2116 (re-search-forward "\\?=")
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2117 (replace-match "")))))
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2118 (rfc2047-decode-region (point-min) (point-max))
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2119 (buffer-string)))))
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
2120
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2121 ;;; Start of functions adopted from `message-utils.el'.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2122
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2123 (defun message-strip-subject-trailing-was (subject)
60390
d8ddb2b48062 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-155
Miles Bader <miles@gnu.org>
parents: 60356
diff changeset
2124 "Remove trailing \"(was: <old subject>)\" from SUBJECT lines.
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2125 Leading \"Re: \" is not stripped by this function. Use the function
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2126 `message-strip-subject-re' for this."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2127 (let* ((query message-subject-trailing-was-query)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2128 (new) (found))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2129 (setq found
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2130 (string-match
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2131 (if (eq query 'ask)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2132 message-subject-trailing-was-ask-regexp
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2133 message-subject-trailing-was-regexp)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2134 subject))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2135 (if found
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2136 (setq new (substring subject 0 (match-beginning 0))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2137 (if (or (not found) (eq query nil))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2138 subject
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2139 (if (eq query 'ask)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2140 (if (message-y-or-n-p
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2141 "Strip `(was: <old subject>)' in subject? " t
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2142 (concat
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2143 "Strip `(was: <old subject>)' in subject "
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2144 "and use the new one instead?\n\n"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2145 "Current subject is: \""
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2146 subject "\"\n\n"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2147 "New subject would be: \""
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2148 new "\"\n\n"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2149 "See the variable `message-subject-trailing-was-query' "
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2150 "to get rid of this query."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2151 ))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2152 new subject)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2153 new))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2154
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2155 ;;; Suggested by Jonas Steverud @ www.dtek.chalmers.se/~d4jonas/
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2156
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2157 (defun message-change-subject (new-subject)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2158 "Ask for NEW-SUBJECT header, append (was: <Old Subject>)."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2159 (interactive
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2160 (list
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2161 (read-from-minibuffer "New subject: ")))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2162 (cond ((and (not (or (null new-subject) ; new subject not empty
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2163 (zerop (string-width new-subject))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2164 (string-match "^[ \t]*$" new-subject))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2165 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2166 (let ((old-subject
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2167 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2168 (message-narrow-to-headers)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2169 (message-fetch-field "Subject"))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2170 (cond ((not old-subject)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2171 (error "No current subject"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2172 ((not (string-match
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2173 (concat "^[ \t]*"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2174 (regexp-quote new-subject)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2175 " \t]*$")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2176 old-subject)) ; yes, it really is a new subject
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2177 ;; delete eventual Re: prefix
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2178 (setq old-subject
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2179 (message-strip-subject-re old-subject))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2180 (message-goto-subject)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2181 (message-delete-line)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2182 (insert (concat "Subject: "
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2183 new-subject
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2184 " (was: "
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
2185 old-subject ")\n")))))))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2186
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2187 (defun message-mark-inserted-region (beg end &optional verbatim)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2188 "Mark some region in the current article with enclosing tags.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2189 See `message-mark-insert-begin' and `message-mark-insert-end'.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2190 If VERBATIM, use slrn style verbatim marks (\"#v+\" and \"#v-\")."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2191 (interactive "r\nP")
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2192 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2193 ;; add to the end of the region first, otherwise end would be invalid
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2194 (goto-char end)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2195 (insert (if verbatim "#v-\n" message-mark-insert-end))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2196 (goto-char beg)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2197 (insert (if verbatim "#v+\n" message-mark-insert-begin))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2198
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2199 (defun message-mark-insert-file (file &optional verbatim)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2200 "Insert FILE at point, marking it with enclosing tags.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2201 See `message-mark-insert-begin' and `message-mark-insert-end'.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2202 If VERBATIM, use slrn style verbatim marks (\"#v+\" and \"#v-\")."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2203 (interactive "fFile to insert: \nP")
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2204 ;; reverse insertion to get correct result.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2205 (let ((p (point)))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2206 (insert (if verbatim "#v-\n" message-mark-insert-end))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2207 (goto-char p)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2208 (insert-file-contents file)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2209 (goto-char p)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2210 (insert (if verbatim "#v+\n" message-mark-insert-begin))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2211
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2212 (defun message-add-archive-header ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2213 "Insert \"X-No-Archive: Yes\" in the header and a note in the body.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2214 The note can be customized using `message-archive-note'. When called with a
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2215 prefix argument, ask for a text to insert. If you don't want the note in the
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2216 body, set `message-archive-note' to nil."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2217 (interactive)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2218 (if current-prefix-arg
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2219 (setq message-archive-note
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2220 (read-from-minibuffer "Reason for No-Archive: "
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2221 (cons message-archive-note 0))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2222 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2223 (if (message-goto-signature)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2224 (re-search-backward message-signature-separator))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2225 (when message-archive-note
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2226 (insert message-archive-note)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2227 (newline))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2228 (message-add-header message-archive-header)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2229 (message-sort-headers)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2230
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2231 (defun message-cross-post-followup-to-header (target-group)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2232 "Mangles FollowUp-To and Newsgroups header to point to TARGET-GROUP.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2233 With prefix-argument just set Follow-Up, don't cross-post."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2234 (interactive
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2235 (list ; Completion based on Gnus
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2236 (completing-read "Followup To: "
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2237 (if (boundp 'gnus-newsrc-alist)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2238 gnus-newsrc-alist)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2239 nil nil '("poster" . 0)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2240 (if (boundp 'gnus-group-history)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2241 'gnus-group-history))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2242 (message-remove-header "Follow[Uu]p-[Tt]o" t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2243 (message-goto-newsgroups)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2244 (beginning-of-line)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2245 ;; if we already did a crosspost before, kill old target
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2246 (if (and message-cross-post-old-target
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2247 (re-search-forward
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2248 (regexp-quote (concat "," message-cross-post-old-target))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2249 nil t))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2250 (replace-match ""))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2251 ;; unless (followup is to poster or user explicitly asked not
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2252 ;; to cross-post, or target-group is already in Newsgroups)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2253 ;; add target-group to Newsgroups line.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2254 (cond ((and (or
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2255 ;; def: cross-post, req:no
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2256 (and message-cross-post-default (not current-prefix-arg))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2257 ;; def: no-cross-post, req:yes
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2258 (and (not message-cross-post-default) current-prefix-arg))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2259 (not (string-match "poster" target-group))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2260 (not (string-match (regexp-quote target-group)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2261 (message-fetch-field "Newsgroups"))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2262 (end-of-line)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2263 (insert (concat "," target-group))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2264 (end-of-line) ; ensure Followup: comes after Newsgroups:
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2265 ;; unless new followup would be identical to Newsgroups line
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2266 ;; make a new Followup-To line
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2267 (if (not (string-match (concat "^[ \t]*"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2268 target-group
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2269 "[ \t]*$")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2270 (message-fetch-field "Newsgroups")))
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
2271 (insert (concat "\nFollowup-To: " target-group)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2272 (setq message-cross-post-old-target target-group))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2273
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2274 (defun message-cross-post-insert-note (target-group cross-post in-old
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2275 old-groups)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2276 "Insert a in message body note about a set Followup or Crosspost.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2277 If there have been previous notes, delete them. TARGET-GROUP specifies the
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2278 group to Followup-To. When CROSS-POST is t, insert note about
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2279 crossposting. IN-OLD specifies whether TARGET-GROUP is a member of
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2280 OLD-GROUPS. OLD-GROUPS lists the old-groups the posting would have
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2281 been made to before the user asked for a Crosspost."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2282 ;; start scanning body for previous uses
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2283 (message-goto-signature)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2284 (let ((head (re-search-backward
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2285 (concat "^" mail-header-separator)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2286 nil t))) ; just search in body
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2287 (message-goto-signature)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2288 (while (re-search-backward
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2289 (concat "^" (regexp-quote message-cross-post-note) ".*")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2290 head t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2291 (message-delete-line))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2292 (message-goto-signature)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2293 (while (re-search-backward
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2294 (concat "^" (regexp-quote message-followup-to-note) ".*")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2295 head t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2296 (message-delete-line))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2297 ;; insert new note
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2298 (if (message-goto-signature)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2299 (re-search-backward message-signature-separator))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2300 (if (or in-old
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2301 (not cross-post)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2302 (string-match "^[ \t]*poster[ \t]*$" target-group))
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
2303 (insert (concat message-followup-to-note target-group "\n"))
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
2304 (insert (concat message-cross-post-note target-group "\n")))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2305
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2306 (defun message-cross-post-followup-to (target-group)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2307 "Crossposts message and set Followup-To to TARGET-GROUP.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2308 With prefix-argument just set Follow-Up, don't cross-post."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2309 (interactive
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2310 (list ; Completion based on Gnus
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2311 (completing-read "Followup To: "
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2312 (if (boundp 'gnus-newsrc-alist)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2313 gnus-newsrc-alist)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2314 nil nil '("poster" . 0)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2315 (if (boundp 'gnus-group-history)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2316 'gnus-group-history))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2317 (cond ((not (or (null target-group) ; new subject not empty
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2318 (zerop (string-width target-group))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2319 (string-match "^[ \t]*$" target-group)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2320 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2321 (let* ((old-groups (message-fetch-field "Newsgroups"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2322 (in-old (string-match
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2323 (regexp-quote target-group)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2324 (or old-groups ""))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2325 ;; check whether target exactly matches old Newsgroups
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2326 (cond ((not old-groups)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2327 (error "No current newsgroup"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2328 ((or (not in-old)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2329 (not (string-match
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2330 (concat "^[ \t]*"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2331 (regexp-quote target-group)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2332 "[ \t]*$")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2333 old-groups)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2334 ;; yes, Newsgroups line must change
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2335 (message-cross-post-followup-to-header target-group)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2336 ;; insert note whether we do cross-post or followup-to
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2337 (funcall message-cross-post-note-function
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2338 target-group
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2339 (if (or (and message-cross-post-default
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2340 (not current-prefix-arg))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2341 (and (not message-cross-post-default)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2342 current-prefix-arg)) t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2343 in-old old-groups))))))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2344
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2345 ;;; Reduce To: to Cc: or Bcc: header
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2346
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2347 (defun message-reduce-to-to-cc ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2348 "Replace contents of To: header with contents of Cc: or Bcc: header."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2349 (interactive)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2350 (let ((cc-content
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2351 (save-restriction (message-narrow-to-headers)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2352 (message-fetch-field "cc")))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2353 (bcc nil))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2354 (if (and (not cc-content)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2355 (setq cc-content
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2356 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2357 (message-narrow-to-headers)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2358 (message-fetch-field "bcc"))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2359 (setq bcc t))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2360 (cond (cc-content
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2361 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2362 (message-goto-to)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2363 (message-delete-line)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
2364 (insert (concat "To: " cc-content "\n"))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2365 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2366 (message-narrow-to-headers)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2367 (message-remove-header (if bcc
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2368 "bcc"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2369 "cc"))))))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2370
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2371 ;;; End of functions adopted from `message-utils.el'.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2372
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2373 (defun message-remove-header (header &optional is-regexp first reverse)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2374 "Remove HEADER in the narrowed buffer.
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
2375 If IS-REGEXP, HEADER is a regular expression.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2376 If FIRST, only remove the first instance of the header.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2377 Return the number of headers removed."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2378 (goto-char (point-min))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2379 (let ((regexp (if is-regexp header (concat "^" (regexp-quote header) ":")))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2380 (number 0)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2381 (case-fold-search t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2382 last)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2383 (while (and (not (eobp))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2384 (not last))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2385 (if (if reverse
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2386 (not (looking-at regexp))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2387 (looking-at regexp))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2388 (progn
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2389 (incf number)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2390 (when first
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2391 (setq last t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2392 (delete-region
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2393 (point)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2394 ;; There might be a continuation header, so we have to search
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2395 ;; until we find a new non-continuation line.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2396 (progn
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2397 (forward-line 1)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2398 (if (re-search-forward "^[^ \t]" nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2399 (goto-char (match-beginning 0))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2400 (point-max)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2401 (forward-line 1)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2402 (if (re-search-forward "^[^ \t]" nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2403 (goto-char (match-beginning 0))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2404 (goto-char (point-max)))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2405 number))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2406
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2407 (defun message-remove-first-header (header)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2408 "Remove the first instance of HEADER if there is more than one."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2409 (let ((count 0)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2410 (regexp (concat "^" (regexp-quote header) ":")))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2411 (save-excursion
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2412 (goto-char (point-min))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2413 (while (re-search-forward regexp nil t)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2414 (incf count)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2415 (while (> count 1)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2416 (message-remove-header header nil t)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2417 (decf count))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2418
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2419 (defun message-narrow-to-headers ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2420 "Narrow the buffer to the head of the message."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2421 (widen)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2422 (narrow-to-region
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2423 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2424 (if (re-search-forward
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2425 (concat "^" (regexp-quote mail-header-separator) "\n") nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2426 (match-beginning 0)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2427 (point-max)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2428 (goto-char (point-min)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2429
34752
f04f551e94ce * message.el (message-narrow-to-head-1): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34485
diff changeset
2430 (defun message-narrow-to-head-1 ()
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
2431 "Like `message-narrow-to-head'. Don't widen."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2432 (narrow-to-region
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2433 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2434 (if (search-forward "\n\n" nil 1)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2435 (1- (point))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2436 (point-max)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2437 (goto-char (point-min)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2438
100993
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
2439 ;; FIXME: clarify diffference: message-narrow-to-head,
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
2440 ;; message-narrow-to-headers-or-head, message-narrow-to-headers
34752
f04f551e94ce * message.el (message-narrow-to-head-1): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34485
diff changeset
2441 (defun message-narrow-to-head ()
f04f551e94ce * message.el (message-narrow-to-head-1): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34485
diff changeset
2442 "Narrow the buffer to the head of the message.
f04f551e94ce * message.el (message-narrow-to-head-1): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34485
diff changeset
2443 Point is left at the beginning of the narrowed-to region."
f04f551e94ce * message.el (message-narrow-to-head-1): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34485
diff changeset
2444 (widen)
f04f551e94ce * message.el (message-narrow-to-head-1): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34485
diff changeset
2445 (message-narrow-to-head-1))
f04f551e94ce * message.el (message-narrow-to-head-1): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34485
diff changeset
2446
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2447 (defun message-narrow-to-headers-or-head ()
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2448 "Narrow the buffer to the head of the message."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2449 (widen)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2450 (narrow-to-region
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2451 (goto-char (point-min))
77823
923182f9ab47 (message-narrow-to-headers-or-head): Ignore mail-header-separator in
Chong Yidong <cyd@stupidchicken.com>
parents: 77819
diff changeset
2452 (if (re-search-forward (concat "\\(\n\\)\n\\|^\\("
923182f9ab47 (message-narrow-to-headers-or-head): Ignore mail-header-separator in
Chong Yidong <cyd@stupidchicken.com>
parents: 77819
diff changeset
2453 (regexp-quote mail-header-separator)
923182f9ab47 (message-narrow-to-headers-or-head): Ignore mail-header-separator in
Chong Yidong <cyd@stupidchicken.com>
parents: 77819
diff changeset
2454 "\n\\)")
923182f9ab47 (message-narrow-to-headers-or-head): Ignore mail-header-separator in
Chong Yidong <cyd@stupidchicken.com>
parents: 77819
diff changeset
2455 nil t)
923182f9ab47 (message-narrow-to-headers-or-head): Ignore mail-header-separator in
Chong Yidong <cyd@stupidchicken.com>
parents: 77819
diff changeset
2456 (or (match-end 1) (match-beginning 2))
923182f9ab47 (message-narrow-to-headers-or-head): Ignore mail-header-separator in
Chong Yidong <cyd@stupidchicken.com>
parents: 77819
diff changeset
2457 (point-max)))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2458 (goto-char (point-min)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2459
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2460 (defun message-news-p ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2461 "Say whether the current buffer contains a news message."
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2462 (and (not message-this-is-mail)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2463 (or message-this-is-news
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2464 (save-excursion
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2465 (save-restriction
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2466 (message-narrow-to-headers)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2467 (and (message-fetch-field "newsgroups")
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2468 (not (message-fetch-field "posted-to"))))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2469
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2470 (defun message-mail-p ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2471 "Say whether the current buffer contains a mail message."
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2472 (and (not message-this-is-news)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2473 (or message-this-is-mail
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2474 (save-excursion
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2475 (save-restriction
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2476 (message-narrow-to-headers)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2477 (or (message-fetch-field "to")
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2478 (message-fetch-field "cc")
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2479 (message-fetch-field "bcc")))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2480
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2481 (defun message-subscribed-p ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2482 "Say whether we need to insert a MFT header."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2483 (or message-subscribed-regexps
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2484 message-subscribed-addresses
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2485 message-subscribed-address-file
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2486 message-subscribed-address-functions))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2487
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2488 (defun message-next-header ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2489 "Go to the beginning of the next header."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2490 (beginning-of-line)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2491 (or (eobp) (forward-char 1))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2492 (not (if (re-search-forward "^[^ \t]" nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2493 (beginning-of-line)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2494 (goto-char (point-max)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2495
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2496 (defun message-sort-headers-1 ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2497 "Sort the buffer as headers using `message-rank' text props."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2498 (goto-char (point-min))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2499 (require 'sort)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2500 (sort-subr
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2501 nil 'message-next-header
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2502 (lambda ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2503 (message-next-header)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2504 (unless (bobp)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2505 (forward-char -1)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2506 (lambda ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2507 (or (get-text-property (point) 'message-rank)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2508 10000))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2509
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2510 (defun message-sort-headers ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2511 "Sort the headers of the current message according to `message-header-format-alist'."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2512 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2513 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2514 (save-restriction
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2515 (let ((max (1+ (length message-header-format-alist)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2516 rank)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2517 (message-narrow-to-headers)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2518 (while (re-search-forward "^[^ \n]+:" nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2519 (put-text-property
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2520 (match-beginning 0) (1+ (match-beginning 0))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2521 'message-rank
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2522 (if (setq rank (length (memq (assq (intern (buffer-substring
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2523 (match-beginning 0)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2524 (1- (match-end 0))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2525 message-header-format-alist)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2526 message-header-format-alist)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2527 (- max rank)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2528 (1+ max)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2529 (message-sort-headers-1))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2530
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2531 (defun message-kill-address ()
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2532 "Kill the address under point."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2533 (interactive)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2534 (let ((start (point)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2535 (message-skip-to-next-address)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2536 (kill-region start (point))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2537
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2538
87245
6207f5a83057 (Info-goto-node, format-spec): Autoload.
Glenn Morris <rgm@gnu.org>
parents: 87191
diff changeset
2539 (autoload 'Info-goto-node "info")
93451
06240ef0da8e (mml2015-use): Declare for compiler.
Glenn Morris <rgm@gnu.org>
parents: 93394
diff changeset
2540 (defvar mml2015-use)
87245
6207f5a83057 (Info-goto-node, format-spec): Autoload.
Glenn Morris <rgm@gnu.org>
parents: 87191
diff changeset
2541
68230
6c7c654eb3c7 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-702
Miles Bader <miles@gnu.org>
parents: 67032
diff changeset
2542 (defun message-info (&optional arg)
6c7c654eb3c7 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-702
Miles Bader <miles@gnu.org>
parents: 67032
diff changeset
2543 "Display the Message manual.
6c7c654eb3c7 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-702
Miles Bader <miles@gnu.org>
parents: 67032
diff changeset
2544
93386
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
2545 Prefixed with one \\[universal-argument], display the Emacs MIME
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
2546 manual. With two \\[universal-argument]'s, display the EasyPG or
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
2547 PGG manual, depending on the value of `mml2015-use'."
68230
6c7c654eb3c7 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-702
Miles Bader <miles@gnu.org>
parents: 67032
diff changeset
2548 (interactive "p")
106548
4a940e6bbe88 (message-info): Explain why we use `Info-goto-node'.
Reiner Steib <Reiner.Steib@gmx.de>
parents: 106372
diff changeset
2549 ;; Don't use `info' because support for `(filename)nodename' is not
4a940e6bbe88 (message-info): Explain why we use `Info-goto-node'.
Reiner Steib <Reiner.Steib@gmx.de>
parents: 106372
diff changeset
2550 ;; available in XEmacs < 21.5.12.
93386
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
2551 (Info-goto-node (format "(%s)Top"
93451
06240ef0da8e (mml2015-use): Declare for compiler.
Glenn Morris <rgm@gnu.org>
parents: 93394
diff changeset
2552 (cond ((eq arg 16)
06240ef0da8e (mml2015-use): Declare for compiler.
Glenn Morris <rgm@gnu.org>
parents: 93394
diff changeset
2553 (require 'mml2015)
06240ef0da8e (mml2015-use): Declare for compiler.
Glenn Morris <rgm@gnu.org>
parents: 93394
diff changeset
2554 mml2015-use)
93386
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
2555 ((eq arg 4) 'emacs-mime)
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
2556 ;; `booleanp' only available in Emacs 22+
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
2557 ((and (not (memq arg '(nil t)))
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
2558 (symbolp arg))
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
2559 arg)
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
2560 (t
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
2561 'message)))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2562
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2563
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2564
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2565 ;;;
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2566 ;;; Message mode
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2567 ;;;
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2568
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2569 ;;; Set up keymap.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2570
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2571 (defvar message-mode-map nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2572
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2573 (unless message-mode-map
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2574 (setq message-mode-map (make-keymap))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2575 (set-keymap-parent message-mode-map text-mode-map)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2576 (define-key message-mode-map "\C-c?" 'describe-mode)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2577
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2578 (define-key message-mode-map "\C-c\C-f\C-t" 'message-goto-to)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2579 (define-key message-mode-map "\C-c\C-f\C-o" 'message-goto-from)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2580 (define-key message-mode-map "\C-c\C-f\C-b" 'message-goto-bcc)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2581 (define-key message-mode-map "\C-c\C-f\C-w" 'message-goto-fcc)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2582 (define-key message-mode-map "\C-c\C-f\C-c" 'message-goto-cc)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2583 (define-key message-mode-map "\C-c\C-f\C-s" 'message-goto-subject)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2584 (define-key message-mode-map "\C-c\C-f\C-r" 'message-goto-reply-to)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2585 (define-key message-mode-map "\C-c\C-f\C-n" 'message-goto-newsgroups)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2586 (define-key message-mode-map "\C-c\C-f\C-d" 'message-goto-distribution)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2587 (define-key message-mode-map "\C-c\C-f\C-f" 'message-goto-followup-to)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2588 (define-key message-mode-map "\C-c\C-f\C-m" 'message-goto-mail-followup-to)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2589 (define-key message-mode-map "\C-c\C-f\C-k" 'message-goto-keywords)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2590 (define-key message-mode-map "\C-c\C-f\C-u" 'message-goto-summary)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2591 (define-key message-mode-map "\C-c\C-f\C-i"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2592 'message-insert-or-toggle-importance)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2593 (define-key message-mode-map "\C-c\C-f\C-a"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2594 'message-generate-unsubscribed-mail-followup-to)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2595
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2596 ;; modify headers (and insert notes in body)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2597 (define-key message-mode-map "\C-c\C-fs" 'message-change-subject)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2598 ;;
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2599 (define-key message-mode-map "\C-c\C-fx" 'message-cross-post-followup-to)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2600 ;; prefix+message-cross-post-followup-to = same w/o cross-post
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2601 (define-key message-mode-map "\C-c\C-ft" 'message-reduce-to-to-cc)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2602 (define-key message-mode-map "\C-c\C-fa" 'message-add-archive-header)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2603 ;; mark inserted text
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2604 (define-key message-mode-map "\C-c\M-m" 'message-mark-inserted-region)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2605 (define-key message-mode-map "\C-c\M-f" 'message-mark-insert-file)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2606
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2607 (define-key message-mode-map "\C-c\C-b" 'message-goto-body)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2608 (define-key message-mode-map "\C-c\C-i" 'message-goto-signature)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2609
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2610 (define-key message-mode-map "\C-c\C-t" 'message-insert-to)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2611 (define-key message-mode-map "\C-c\C-fw" 'message-insert-wide-reply)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2612 (define-key message-mode-map "\C-c\C-n" 'message-insert-newsgroups)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2613 (define-key message-mode-map "\C-c\C-l" 'message-to-list-only)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2614 (define-key message-mode-map "\C-c\C-f\C-e" 'message-insert-expires)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2615
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2616 (define-key message-mode-map "\C-c\C-u" 'message-insert-or-toggle-importance)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2617 (define-key message-mode-map "\C-c\M-n"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2618 'message-insert-disposition-notification-to)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2619
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2620 (define-key message-mode-map "\C-c\C-y" 'message-yank-original)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2621 (define-key message-mode-map "\C-c\M-\C-y" 'message-yank-buffer)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2622 (define-key message-mode-map "\C-c\C-q" 'message-fill-yanked-message)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2623 (define-key message-mode-map "\C-c\C-w" 'message-insert-signature)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2624 (define-key message-mode-map "\C-c\M-h" 'message-insert-headers)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2625 (define-key message-mode-map "\C-c\C-r" 'message-caesar-buffer-body)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2626 (define-key message-mode-map "\C-c\C-o" 'message-sort-headers)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2627 (define-key message-mode-map "\C-c\M-r" 'message-rename-buffer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2628
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2629 (define-key message-mode-map "\C-c\C-c" 'message-send-and-exit)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2630 (define-key message-mode-map "\C-c\C-s" 'message-send)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2631 (define-key message-mode-map "\C-c\C-k" 'message-kill-buffer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2632 (define-key message-mode-map "\C-c\C-d" 'message-dont-send)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2633 (define-key message-mode-map "\C-c\n" 'gnus-delay-article)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2634
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2635 (define-key message-mode-map "\C-c\M-k" 'message-kill-address)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2636 (define-key message-mode-map "\C-c\C-e" 'message-elide-region)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2637 (define-key message-mode-map "\C-c\C-v" 'message-delete-not-region)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2638 (define-key message-mode-map "\C-c\C-z" 'message-kill-to-signature)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2639 (define-key message-mode-map "\M-\r" 'message-newline-and-reformat)
49034
b6e082e00b00 (message-split-line): New function.
Kim F. Storm <storm@cua.dk>
parents: 48588
diff changeset
2640 (define-key message-mode-map [remap split-line] 'message-split-line)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2641
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2642 (define-key message-mode-map "\C-c\C-a" 'mml-attach-file)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2643
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2644 (define-key message-mode-map "\C-a" 'message-beginning-of-line)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2645 (define-key message-mode-map "\t" 'message-tab)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2646
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2647 (define-key message-mode-map "\M-n" 'message-display-abbrev))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2648
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2649 (easy-menu-define
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2650 message-mode-menu message-mode-map "Message Menu."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2651 `("Message"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2652 ["Yank Original" message-yank-original message-reply-buffer]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2653 ["Fill Yanked Message" message-fill-yanked-message t]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2654 ["Insert Signature" message-insert-signature t]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2655 ["Caesar (rot13) Message" message-caesar-buffer-body t]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2656 ["Caesar (rot13) Region" message-caesar-region (message-mark-active-p)]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2657 ["Elide Region" message-elide-region
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2658 :active (message-mark-active-p)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2659 ,@(if (featurep 'xemacs) nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2660 '(:help "Replace text in region with an ellipsis"))]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2661 ["Delete Outside Region" message-delete-not-region
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2662 :active (message-mark-active-p)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2663 ,@(if (featurep 'xemacs) nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2664 '(:help "Delete all quoted text outside region"))]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2665 ["Kill To Signature" message-kill-to-signature t]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2666 ["Newline and Reformat" message-newline-and-reformat t]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2667 ["Rename buffer" message-rename-buffer t]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2668 ["Spellcheck" ispell-message
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2669 ,@(if (featurep 'xemacs) '(t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2670 '(:help "Spellcheck this message"))]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2671 "----"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2672 ["Insert Region Marked" message-mark-inserted-region
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2673 :active (message-mark-active-p)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2674 ,@(if (featurep 'xemacs) nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2675 '(:help "Mark region with enclosing tags"))]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2676 ["Insert File Marked..." message-mark-insert-file
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2677 ,@(if (featurep 'xemacs) '(t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2678 '(:help "Insert file at point marked with enclosing tags"))]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2679 "----"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2680 ["Send Message" message-send-and-exit
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2681 ,@(if (featurep 'xemacs) '(t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2682 '(:help "Send this message"))]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2683 ["Postpone Message" message-dont-send
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2684 ,@(if (featurep 'xemacs) '(t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2685 '(:help "File this draft message and exit"))]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2686 ["Send at Specific Time..." gnus-delay-article
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2687 ,@(if (featurep 'xemacs) '(t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2688 '(:help "Ask, then arrange to send message at that time"))]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2689 ["Kill Message" message-kill-buffer
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2690 ,@(if (featurep 'xemacs) '(t)
68230
6c7c654eb3c7 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-702
Miles Bader <miles@gnu.org>
parents: 67032
diff changeset
2691 '(:help "Delete this message without sending"))]
6c7c654eb3c7 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-702
Miles Bader <miles@gnu.org>
parents: 67032
diff changeset
2692 "----"
6c7c654eb3c7 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-702
Miles Bader <miles@gnu.org>
parents: 67032
diff changeset
2693 ["Message manual" message-info
6c7c654eb3c7 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-702
Miles Bader <miles@gnu.org>
parents: 67032
diff changeset
2694 ,@(if (featurep 'xemacs) '(t)
6c7c654eb3c7 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-702
Miles Bader <miles@gnu.org>
parents: 67032
diff changeset
2695 '(:help "Display the Message manual"))]))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2696
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2697 (easy-menu-define
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2698 message-mode-field-menu message-mode-map ""
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2699 `("Field"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2700 ["To" message-goto-to t]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2701 ["From" message-goto-from t]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2702 ["Subject" message-goto-subject t]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2703 ["Change subject..." message-change-subject t]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2704 ["Cc" message-goto-cc t]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2705 ["Bcc" message-goto-bcc t]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2706 ["Fcc" message-goto-fcc t]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2707 ["Reply-To" message-goto-reply-to t]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2708 ["Flag As Important" message-insert-importance-high
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2709 ,@(if (featurep 'xemacs) '(t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2710 '(:help "Mark this message as important"))]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2711 ["Flag As Unimportant" message-insert-importance-low
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2712 ,@(if (featurep 'xemacs) '(t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2713 '(:help "Mark this message as unimportant"))]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2714 ["Request Receipt"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2715 message-insert-disposition-notification-to
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2716 ,@(if (featurep 'xemacs) '(t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2717 '(:help "Request a receipt notification"))]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2718 "----"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2719 ;; (typical) news stuff
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2720 ["Summary" message-goto-summary t]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2721 ["Keywords" message-goto-keywords t]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2722 ["Newsgroups" message-goto-newsgroups t]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2723 ["Fetch Newsgroups" message-insert-newsgroups t]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2724 ["Followup-To" message-goto-followup-to t]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2725 ;; ["Followup-To (with note in body)" message-cross-post-followup-to t]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2726 ["Crosspost / Followup-To..." message-cross-post-followup-to t]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2727 ["Distribution" message-goto-distribution t]
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2728 ["Expires" message-insert-expires t ]
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2729 ["X-No-Archive" message-add-archive-header t ]
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2730 "----"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2731 ;; (typical) mailing-lists stuff
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2732 ["Fetch To" message-insert-to
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2733 ,@(if (featurep 'xemacs) '(t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2734 '(:help "Insert a To header that points to the author."))]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2735 ["Fetch To and Cc" message-insert-wide-reply
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2736 ,@(if (featurep 'xemacs) '(t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2737 '(:help
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2738 "Insert To and Cc headers as if you were doing a wide reply."))]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2739 "----"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2740 ["Send to list only" message-to-list-only t]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2741 ["Mail-Followup-To" message-goto-mail-followup-to t]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2742 ["Unsubscribed list post" message-generate-unsubscribed-mail-followup-to
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2743 ,@(if (featurep 'xemacs) '(t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2744 '(:help "Insert a reasonable `Mail-Followup-To:' header."))]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2745 ["Reduce To: to Cc:" message-reduce-to-to-cc t]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2746 "----"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2747 ["Sort Headers" message-sort-headers t]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2748 ["Encode non-ASCII domain names" message-idna-to-ascii-rhs t]
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2749 ;; We hide `message-hidden-headers' by narrowing the buffer.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2750 ["Show Hidden Headers" widen t]
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2751 ["Goto Body" message-goto-body t]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2752 ["Goto Signature" message-goto-signature t]))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2753
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2754 (defvar message-tool-bar-map nil)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2755
86154
1cdfc94602cb * smime.el (from):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85974
diff changeset
2756 (defvar facemenu-add-face-function)
1cdfc94602cb * smime.el (from):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85974
diff changeset
2757 (defvar facemenu-remove-face-function)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2758
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2759 ;;; Forbidden properties
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2760 ;;
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2761 ;; We use `after-change-functions' to keep special text properties
107157
6a11e3b311d8 Change a custom default to ease the mail->message transition.
Glenn Morris <rgm@gnu.org>
parents: 106892
diff changeset
2762 ;; that interfere with the normal function of message mode out of the
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2763 ;; buffer.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2764
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2765 (defcustom message-strip-special-text-properties t
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2766 "Strip special properties from the message buffer.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2767
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2768 Emacs has a number of special text properties which can break message
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2769 composing in various ways. If this option is set, message will strip
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2770 these properties from the message composition buffer. However, some
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2771 packages requires these properties to be present in order to work.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2772 If you use one of these packages, turn this option off, and hope the
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2773 message composition doesn't break too bad."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59756
diff changeset
2774 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2775 :group 'message-various
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2776 :link '(custom-manual "(message)Various Message Variables")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2777 :type 'boolean)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2778
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2779 (defconst message-forbidden-properties
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2780 ;; No reason this should be clutter up customize. We make it a
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2781 ;; property list (rather than a list of property symbols), to be
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2782 ;; directly useful for `remove-text-properties'.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2783 '(field nil read-only nil invisible nil intangible nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2784 mouse-face nil modification-hooks nil insert-in-front-hooks nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2785 insert-behind-hooks nil point-entered nil point-left nil)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2786 ;; Other special properties:
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2787 ;; category, face, display: probably doesn't do any harm.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2788 ;; fontified: is used by font-lock.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2789 ;; syntax-table, local-map: I dunno.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2790 ;; We need to add XEmacs names to the list.
58835
9bdd97960431 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents: 57856
diff changeset
2791 "Property list of with properties forbidden in message buffers.
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2792 The values of the properties are ignored, only the property names are used.")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2793
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2794 (defun message-tamago-not-in-use-p (pos)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2795 "Return t when tamago version 4 is not in use at the cursor position.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2796 Tamago version 4 is a popular input method for writing Japanese text.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2797 It uses the properties `intangible', `invisible', `modification-hooks'
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2798 and `read-only' when translating ascii or kana text to kanji text.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2799 These properties are essential to work, so we should never strip them."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2800 (not (and (boundp 'egg-modefull-mode)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2801 (symbol-value 'egg-modefull-mode)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2802 (or (memq (get-text-property pos 'intangible)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2803 '(its-part-1 its-part-2))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2804 (get-text-property pos 'egg-end)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2805 (get-text-property pos 'egg-lang)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2806 (get-text-property pos 'egg-start)))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2807
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2808 (defsubst message-mail-alias-type-p (type)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2809 (if (atom message-mail-alias-type)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2810 (eq message-mail-alias-type type)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2811 (memq type message-mail-alias-type)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2812
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2813 (defun message-strip-forbidden-properties (begin end &optional old-length)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2814 "Strip forbidden properties between BEGIN and END, ignoring the third arg.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2815 This function is intended to be called from `after-change-functions'.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2816 See also `message-forbidden-properties'."
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2817 (when (and (message-mail-alias-type-p 'ecomplete)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2818 (memq this-command message-self-insert-commands))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2819 (message-display-abbrev))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2820 (when (and message-strip-special-text-properties
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2821 (message-tamago-not-in-use-p begin))
58835
9bdd97960431 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents: 57856
diff changeset
2822 (let ((buffer-read-only nil)
9bdd97960431 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents: 57856
diff changeset
2823 (inhibit-read-only t))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2824 (remove-text-properties begin end message-forbidden-properties))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2825
107473
0fe940324254 Synch with Gnus trunk
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107427
diff changeset
2826 (autoload 'ecomplete-setup "ecomplete") ;; for Emacs <23.
0fe940324254 Synch with Gnus trunk
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107427
diff changeset
2827
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2828 ;;;###autoload
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2829 (define-derived-mode message-mode text-mode "Message"
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2830 "Major mode for editing mail and news to be sent.
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
2831 Like Text Mode but with these additional commands:\\<message-mode-map>
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
2832 C-c C-s `message-send' (send the message) C-c C-c `message-send-and-exit'
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
2833 C-c C-d Postpone sending the message C-c C-k Kill the message
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2834 C-c C-f move to a header field (and create it if there isn't):
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2835 C-c C-f C-t move to To C-c C-f C-s move to Subject
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2836 C-c C-f C-c move to Cc C-c C-f C-b move to Bcc
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2837 C-c C-f C-w move to Fcc C-c C-f C-r move to Reply-To
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2838 C-c C-f C-u move to Summary C-c C-f C-n move to Newsgroups
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2839 C-c C-f C-k move to Keywords C-c C-f C-d move to Distribution
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2840 C-c C-f C-o move to From (\"Originator\")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2841 C-c C-f C-f move to Followup-To
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2842 C-c C-f C-m move to Mail-Followup-To
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2843 C-c C-f C-e move to Expires
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2844 C-c C-f C-i cycle through Importance values
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2845 C-c C-f s change subject and append \"(was: <Old Subject>)\"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2846 C-c C-f x crossposting with FollowUp-To header and note in body
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2847 C-c C-f t replace To: header with contents of Cc: or Bcc:
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2848 C-c C-f a Insert X-No-Archive: header and a note in the body
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
2849 C-c C-t `message-insert-to' (add a To header to a news followup)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2850 C-c C-l `message-to-list-only' (removes all but list address in to/cc)
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
2851 C-c C-n `message-insert-newsgroups' (add a Newsgroup header to a news reply)
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
2852 C-c C-b `message-goto-body' (move to beginning of message text).
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
2853 C-c C-i `message-goto-signature' (move to the beginning of the signature).
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
2854 C-c C-w `message-insert-signature' (insert `message-signature-file' file).
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
2855 C-c C-y `message-yank-original' (insert current message, if any).
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
2856 C-c C-q `message-fill-yanked-message' (fill what was yanked).
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
2857 C-c C-e `message-elide-region' (elide the text between point and mark).
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
2858 C-c C-v `message-delete-not-region' (remove the text outside the region).
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
2859 C-c C-z `message-kill-to-signature' (kill the text up to the signature).
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
2860 C-c C-r `message-caesar-buffer-body' (rot13 the message body).
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
2861 C-c C-a `mml-attach-file' (attach a file as MIME).
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2862 C-c C-u `message-insert-or-toggle-importance' (insert or cycle importance).
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2863 C-c M-n `message-insert-disposition-notification-to' (request receipt).
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2864 C-c M-m `message-mark-inserted-region' (mark region with enclosing tags).
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2865 C-c M-f `message-mark-insert-file' (insert file marked with enclosing tags).
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
2866 M-RET `message-newline-and-reformat' (break the line and reformat)."
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2867 (setq local-abbrev-table text-mode-abbrev-table)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2868 (set (make-local-variable 'message-reply-buffer) nil)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2869 (set (make-local-variable 'message-inserted-headers) nil)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2870 (set (make-local-variable 'message-send-actions) nil)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2871 (set (make-local-variable 'message-exit-actions) nil)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2872 (set (make-local-variable 'message-kill-actions) nil)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2873 (set (make-local-variable 'message-postpone-actions) nil)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2874 (set (make-local-variable 'message-draft-article) nil)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2875 (setq buffer-offer-save t)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2876 (set (make-local-variable 'facemenu-add-face-function)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2877 (lambda (face end)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2878 (let ((face-fun (cdr (assq face message-face-alist))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2879 (if face-fun
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2880 (funcall face-fun (point) end)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2881 (error "Face %s not configured for %s mode" face mode-name)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2882 ""))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2883 (set (make-local-variable 'facemenu-remove-face-function) t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2884 (set (make-local-variable 'message-reply-headers) nil)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2885 (make-local-variable 'message-newsreader)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2886 (make-local-variable 'message-mailer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2887 (make-local-variable 'message-post-method)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2888 (set (make-local-variable 'message-sent-message-via) nil)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2889 (set (make-local-variable 'message-checksum) nil)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2890 (set (make-local-variable 'message-mime-part) 0)
33436
a324254af725 From Emerick Rogul <emerick@csa.bu.edu>.
Dave Love <fx@gnu.org>
parents: 33400
diff changeset
2891 (message-setup-fill-variables)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2892 (when message-fill-column
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2893 (setq fill-column message-fill-column)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2894 (turn-on-auto-fill))
34766
053098519a45 Add comment.
Miles Bader <miles@gnu.org>
parents: 34762
diff changeset
2895 ;; Allow using comment commands to add/remove quoting.
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2896 ;; (set (make-local-variable 'comment-start) message-yank-prefix)
54287
5284e720208b (message-mode): Fix last change.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 54277
diff changeset
2897 (when message-yank-prefix
5284e720208b (message-mode): Fix last change.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 54277
diff changeset
2898 (set (make-local-variable 'comment-start) message-yank-prefix)
5284e720208b (message-mode): Fix last change.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 54277
diff changeset
2899 (set (make-local-variable 'comment-start-skip)
5284e720208b (message-mode): Fix last change.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 54277
diff changeset
2900 (concat "^" (regexp-quote message-yank-prefix) "[ \t]*")))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2901 (if (featurep 'xemacs)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2902 (message-setup-toolbar)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2903 (set (make-local-variable 'font-lock-defaults)
32964
352449d35643 (message-mode-menu): Add some :help strings.
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
2904 '(message-font-lock-keywords t))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2905 (if (boundp 'tool-bar-map)
70051
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
2906 (set (make-local-variable 'tool-bar-map) (message-make-tool-bar))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2907 (easy-menu-add message-mode-menu message-mode-map)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2908 (easy-menu-add message-mode-field-menu message-mode-map)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2909 (gnus-make-local-hook 'after-change-functions)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2910 ;; Mmmm... Forbidden properties...
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2911 (add-hook 'after-change-functions 'message-strip-forbidden-properties
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2912 nil 'local)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2913 ;; Allow mail alias things.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2914 (cond
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2915 ((message-mail-alias-type-p 'abbrev)
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
2916 (if (fboundp 'mail-abbrevs-setup)
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
2917 (mail-abbrevs-setup)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2918 (if (fboundp 'mail-aliases-setup) ; warning avoidance
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2919 (mail-aliases-setup))))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2920 ((message-mail-alias-type-p 'ecomplete)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
2921 (ecomplete-setup)))
44075
7782e54757bb * mail-source.el (make-source-make-complex-temp-name): Use
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 43075
diff changeset
2922 (unless buffer-file-name
7782e54757bb * mail-source.el (make-source-make-complex-temp-name): Use
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 43075
diff changeset
2923 (message-set-auto-save-file-name))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2924 (unless (buffer-base-buffer)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2925 ;; Don't enable multibyte on an indirect buffer. Maybe enabling
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2926 ;; multibyte is not necessary at all. -- zsh
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2927 (mm-enable-multibyte))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2928 (set (make-local-variable 'indent-tabs-mode) nil) ;No tabs for indentation.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2929 (mml-mode))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2930
33436
a324254af725 From Emerick Rogul <emerick@csa.bu.edu>.
Dave Love <fx@gnu.org>
parents: 33400
diff changeset
2931 (defun message-setup-fill-variables ()
a324254af725 From Emerick Rogul <emerick@csa.bu.edu>.
Dave Love <fx@gnu.org>
parents: 33400
diff changeset
2932 "Setup message fill variables."
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2933 (set (make-local-variable 'fill-paragraph-function)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2934 'message-fill-paragraph)
33436
a324254af725 From Emerick Rogul <emerick@csa.bu.edu>.
Dave Love <fx@gnu.org>
parents: 33400
diff changeset
2935 (make-local-variable 'paragraph-separate)
a324254af725 From Emerick Rogul <emerick@csa.bu.edu>.
Dave Love <fx@gnu.org>
parents: 33400
diff changeset
2936 (make-local-variable 'paragraph-start)
a324254af725 From Emerick Rogul <emerick@csa.bu.edu>.
Dave Love <fx@gnu.org>
parents: 33400
diff changeset
2937 (make-local-variable 'adaptive-fill-regexp)
a324254af725 From Emerick Rogul <emerick@csa.bu.edu>.
Dave Love <fx@gnu.org>
parents: 33400
diff changeset
2938 (unless (boundp 'adaptive-fill-first-line-regexp)
a324254af725 From Emerick Rogul <emerick@csa.bu.edu>.
Dave Love <fx@gnu.org>
parents: 33400
diff changeset
2939 (setq adaptive-fill-first-line-regexp nil))
a324254af725 From Emerick Rogul <emerick@csa.bu.edu>.
Dave Love <fx@gnu.org>
parents: 33400
diff changeset
2940 (make-local-variable 'adaptive-fill-first-line-regexp)
a324254af725 From Emerick Rogul <emerick@csa.bu.edu>.
Dave Love <fx@gnu.org>
parents: 33400
diff changeset
2941 (let ((quote-prefix-regexp
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2942 ;; User should change message-cite-prefix-regexp if
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2943 ;; message-yank-prefix is set to an abnormal value.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2944 (concat "\\(" message-cite-prefix-regexp "\\)[ \t]*")))
33436
a324254af725 From Emerick Rogul <emerick@csa.bu.edu>.
Dave Love <fx@gnu.org>
parents: 33400
diff changeset
2945 (setq paragraph-start
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2946 (concat
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2947 (regexp-quote mail-header-separator) "$\\|"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2948 "[ \t]*$\\|" ; blank lines
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2949 "-- $\\|" ; signature delimiter
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2950 "---+$\\|" ; delimiters for forwarded messages
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2951 page-delimiter "$\\|" ; spoiler warnings
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2952 ".*wrote:$\\|" ; attribution lines
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2953 quote-prefix-regexp "$\\|" ; empty lines in quoted text
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2954 ; mml tags
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2955 "<#!*/?\\(multipart\\|part\\|external\\|mml\\|secure\\)"))
33436
a324254af725 From Emerick Rogul <emerick@csa.bu.edu>.
Dave Love <fx@gnu.org>
parents: 33400
diff changeset
2956 (setq paragraph-separate paragraph-start)
a324254af725 From Emerick Rogul <emerick@csa.bu.edu>.
Dave Love <fx@gnu.org>
parents: 33400
diff changeset
2957 (setq adaptive-fill-regexp
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2958 (concat quote-prefix-regexp "\\|" adaptive-fill-regexp))
33436
a324254af725 From Emerick Rogul <emerick@csa.bu.edu>.
Dave Love <fx@gnu.org>
parents: 33400
diff changeset
2959 (setq adaptive-fill-first-line-regexp
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2960 (concat quote-prefix-regexp "\\|"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2961 adaptive-fill-first-line-regexp)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2962 (make-local-variable 'auto-fill-inhibit-regexp)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2963 ;;(setq auto-fill-inhibit-regexp "^[A-Z][^: \n\t]+:")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2964 (setq auto-fill-inhibit-regexp nil)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2965 (make-local-variable 'normal-auto-fill-function)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2966 (setq normal-auto-fill-function 'message-do-auto-fill)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2967 ;; KLUDGE: auto fill might already be turned on in `text-mode-hook'.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2968 ;; In that case, ensure that it uses the right function. The real
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2969 ;; solution would be not to use `define-derived-mode', and run
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2970 ;; `text-mode-hook' ourself at the end of the mode.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2971 ;; -- Per Abrahamsen <abraham@dina.kvl.dk> Date: 2001-10-19.
85766
68503cda7180 (message-check-news-body-syntax): Avoid mm-string-as-multibyte.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85712
diff changeset
2972 ;; This kludge is unneeded in Emacs>=21 since define-derived-mode is
68503cda7180 (message-check-news-body-syntax): Avoid mm-string-as-multibyte.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85712
diff changeset
2973 ;; now careful to run parent hooks after the body. --Stef
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2974 (when auto-fill-function
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2975 (setq auto-fill-function normal-auto-fill-function)))
33436
a324254af725 From Emerick Rogul <emerick@csa.bu.edu>.
Dave Love <fx@gnu.org>
parents: 33400
diff changeset
2976
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2977
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2978
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2979 ;;;
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2980 ;;; Message mode commands
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2981 ;;;
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2982
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2983 ;;; Movement commands
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2984
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2985 (defun message-goto-to ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2986 "Move point to the To header."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2987 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2988 (message-position-on-field "To"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2989
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2990 (defun message-goto-from ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2991 "Move point to the From header."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2992 (interactive)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2993 (message-position-on-field "From"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2994
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2995 (defun message-goto-subject ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2996 "Move point to the Subject header."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2997 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2998 (message-position-on-field "Subject"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2999
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3000 (defun message-goto-cc ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3001 "Move point to the Cc header."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3002 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3003 (message-position-on-field "Cc" "To"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3004
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3005 (defun message-goto-bcc ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3006 "Move point to the Bcc header."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3007 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3008 (message-position-on-field "Bcc" "Cc" "To"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3009
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3010 (defun message-goto-fcc ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3011 "Move point to the Fcc header."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3012 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3013 (message-position-on-field "Fcc" "To" "Newsgroups"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3014
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3015 (defun message-goto-reply-to ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3016 "Move point to the Reply-To header."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3017 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3018 (message-position-on-field "Reply-To" "Subject"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3019
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3020 (defun message-goto-newsgroups ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3021 "Move point to the Newsgroups header."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3022 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3023 (message-position-on-field "Newsgroups"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3024
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3025 (defun message-goto-distribution ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3026 "Move point to the Distribution header."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3027 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3028 (message-position-on-field "Distribution"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3029
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3030 (defun message-goto-followup-to ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3031 "Move point to the Followup-To header."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3032 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3033 (message-position-on-field "Followup-To" "Newsgroups"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3034
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3035 (defun message-goto-mail-followup-to ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3036 "Move point to the Mail-Followup-To header."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3037 (interactive)
57581
645f020dcc8a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-626
Miles Bader <miles@gnu.org>
parents: 57561
diff changeset
3038 (message-position-on-field "Mail-Followup-To" "To"))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3039
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3040 (defun message-goto-keywords ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3041 "Move point to the Keywords header."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3042 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3043 (message-position-on-field "Keywords" "Subject"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3044
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3045 (defun message-goto-summary ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3046 "Move point to the Summary header."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3047 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3048 (message-position-on-field "Summary" "Subject"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3049
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3050 (defun message-goto-body (&optional interactivep)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3051 "Move point to the beginning of the message body."
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3052 (interactive (list t))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3053 (when (and interactivep
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3054 (looking-at "[ \t]*\n"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3055 (expand-abbrev))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3056 (goto-char (point-min))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3057 (or (search-forward (concat "\n" mail-header-separator "\n") nil t)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3058 (search-forward-regexp "[^:]+:\\([^\n]\\|\n[ \t]\\)+\n\n" nil t)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3059
70245
322c5c5027dc Revision: emacs@sv.gnu.org/emacs--devo--0--patch-249
Miles Bader <miles@gnu.org>
parents: 70051
diff changeset
3060 (defun message-in-body-p ()
322c5c5027dc Revision: emacs@sv.gnu.org/emacs--devo--0--patch-249
Miles Bader <miles@gnu.org>
parents: 70051
diff changeset
3061 "Return t if point is in the message body."
322c5c5027dc Revision: emacs@sv.gnu.org/emacs--devo--0--patch-249
Miles Bader <miles@gnu.org>
parents: 70051
diff changeset
3062 (let ((body (save-excursion (message-goto-body) (point))))
322c5c5027dc Revision: emacs@sv.gnu.org/emacs--devo--0--patch-249
Miles Bader <miles@gnu.org>
parents: 70051
diff changeset
3063 (>= (point) body)))
322c5c5027dc Revision: emacs@sv.gnu.org/emacs--devo--0--patch-249
Miles Bader <miles@gnu.org>
parents: 70051
diff changeset
3064
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3065 (defun message-goto-eoh ()
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3066 "Move point to the end of the headers."
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3067 (interactive)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3068 (message-goto-body)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3069 (forward-line -1))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3070
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3071 (defun message-goto-signature ()
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3072 "Move point to the beginning of the message signature.
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3073 If there is no signature in the article, go to the end and
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3074 return nil."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3075 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3076 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3077 (if (re-search-forward message-signature-separator nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3078 (forward-line 1)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3079 (goto-char (point-max))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3080 nil))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3081
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3082 (defun message-generate-unsubscribed-mail-followup-to (&optional include-cc)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3083 "Insert a reasonable MFT header in a post to an unsubscribed list.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3084 When making original posts to a mailing list you are not subscribed to,
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3085 you have to type in a MFT header by hand. The contents, usually, are
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3086 the addresses of the list and your own address. This function inserts
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3087 such a header automatically. It fetches the contents of the To: header
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3088 in the current mail buffer, and appends the current `user-mail-address'.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3089
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3090 If the optional argument INCLUDE-CC is non-nil, the addresses in the
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3091 Cc: header are also put into the MFT."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3092
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3093 (interactive "P")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3094 (let* (cc tos)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3095 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3096 (message-narrow-to-headers)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3097 (message-remove-header "Mail-Followup-To")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3098 (setq cc (and include-cc (message-fetch-field "Cc")))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3099 (setq tos (if cc
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3100 (concat (message-fetch-field "To") "," cc)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3101 (message-fetch-field "To"))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3102 (message-goto-mail-followup-to)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3103 (insert (concat tos ", " user-mail-address))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3104
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3105
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3106
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
3107 (defun message-insert-to (&optional force)
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
3108 "Insert a To header that points to the author of the article being replied to.
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3109 If the original author requested not to be sent mail, don't insert unless the
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3110 prefix FORCE is given."
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
3111 (interactive "P")
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3112 (let* ((mct (message-fetch-reply-field "mail-copies-to"))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3113 (dont (and mct (or (equal (downcase mct) "never")
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3114 (equal (downcase mct) "nobody"))))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3115 (to (or (message-fetch-reply-field "mail-reply-to")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3116 (message-fetch-reply-field "reply-to")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3117 (message-fetch-reply-field "from"))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3118 (when (and dont to)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3119 (message
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3120 (if force
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3121 "Ignoring the user request not to have copies sent via mail"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3122 "Complying with the user request not to have copies sent via mail")))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3123 (when (and force (not to))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3124 (error "No mail address in the article"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3125 (when (and to (or force (not dont)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3126 (message-carefully-insert-headers (list (cons 'To to))))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3127
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3128 (defun message-insert-wide-reply ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3129 "Insert To and Cc headers as if you were doing a wide reply."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3130 (interactive)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3131 (let ((headers (message-with-reply-buffer
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3132 (message-get-reply-headers t))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3133 (message-carefully-insert-headers headers)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3134
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3135 (defcustom message-header-synonyms
69944
a87e26272828 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-210
Miles Bader <miles@gnu.org>
parents: 69572
diff changeset
3136 '((To Cc Bcc)
a87e26272828 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-210
Miles Bader <miles@gnu.org>
parents: 69572
diff changeset
3137 (Original-To))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3138 "List of lists of header synonyms.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3139 E.g., if this list contains a member list with elements `Cc' and `To',
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3140 then `message-carefully-insert-headers' will not insert a `To' header
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3141 when the message is already `Cc'ed to the recipient."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59756
diff changeset
3142 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3143 :group 'message-headers
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3144 :link '(custom-manual "(message)Message Headers")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3145 :type '(repeat sexp))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3146
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3147 (defun message-carefully-insert-headers (headers)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3148 "Insert the HEADERS, an alist, into the message buffer.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3149 Does not insert the headers when they are already present there
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3150 or in the synonym headers, defined by `message-header-synonyms'."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3151 ;; FIXME: Should compare only the address and not the full name. Comparison
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3152 ;; should be done case-folded (and with `string=' rather than
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3153 ;; `string-match').
57581
645f020dcc8a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-626
Miles Bader <miles@gnu.org>
parents: 57561
diff changeset
3154 ;; (mail-strip-quoted-names "Foo Bar <foo@bar>, bla@fasel (Bla Fasel)")
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3155 (dolist (header headers)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3156 (let* ((header-name (symbol-name (car header)))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3157 (new-header (cdr header))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3158 (synonyms (loop for synonym in message-header-synonyms
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3159 when (memq (car header) synonym) return synonym))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3160 (old-header
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3161 (loop for synonym in synonyms
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3162 for old-header = (mail-fetch-field (symbol-name synonym))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3163 when (and old-header (string-match new-header old-header))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3164 return synonym)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3165 (if old-header
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3166 (message "already have `%s' in `%s'" new-header old-header)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3167 (when (and (message-position-on-field header-name)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3168 (setq old-header (mail-fetch-field header-name))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3169 (not (string-match "\\` *\\'" old-header)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3170 (insert ", "))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3171 (insert new-header)))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3172
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3173 (defun message-widen-reply ()
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3174 "Widen the reply to include maximum recipients."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3175 (interactive)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3176 (let ((follow-to
106890
2ed4eab78ca3 * message.el (message-mail): Just pass yank-action on to message-setup.
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
3177 (and (bufferp message-reply-buffer)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3178 (buffer-name message-reply-buffer)
86339
6f4793ab0756 (message-send-mail-function): Fix error convention.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 86276
diff changeset
3179 (with-current-buffer message-reply-buffer
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3180 (message-get-reply-headers t)))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3181 (save-excursion
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3182 (save-restriction
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3183 (message-narrow-to-headers)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3184 (dolist (elem follow-to)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3185 (message-remove-header (symbol-name (car elem)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3186 (goto-char (point-min))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3187 (insert (symbol-name (car elem)) ": "
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
3188 (cdr elem) "\n"))))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3189
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3190 (defun message-insert-newsgroups ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3191 "Insert the Newsgroups header from the article being replied to."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3192 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3193 (when (and (message-position-on-field "Newsgroups")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3194 (mail-fetch-field "newsgroups")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3195 (not (string-match "\\` *\\'" (mail-fetch-field "newsgroups"))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3196 (insert ","))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3197 (insert (or (message-fetch-reply-field "newsgroups") "")))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3198
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3199
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3200
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3201 ;;; Various commands
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3202
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3203 (defun message-delete-not-region (beg end)
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
3204 "Delete everything in the body of the current message outside of the region."
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3205 (interactive "r")
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3206 (let (citeprefix)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3207 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3208 (goto-char beg)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3209 ;; snarf citation prefix, if appropriate
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3210 (unless (eq (point) (progn (beginning-of-line) (point)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3211 (when (looking-at message-cite-prefix-regexp)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3212 (setq citeprefix (match-string 0))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3213 (goto-char end)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3214 (delete-region (point) (if (not (message-goto-signature))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3215 (point)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3216 (forward-line -2)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3217 (point)))
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
3218 (insert "\n")
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3219 (goto-char beg)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3220 (delete-region beg (progn (message-goto-body)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3221 (forward-line 2)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3222 (point)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3223 (when citeprefix
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3224 (insert citeprefix))))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3225 (when (message-goto-signature)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3226 (forward-line -2)))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3227
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3228 (defun message-kill-to-signature (&optional arg)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3229 "Kill all text up to the signature.
107515
9317d81f8c81 Fix typos in Gnus.
Juanma Barranquero <lekktu@gmail.com>
parents: 107235
diff changeset
3230 If a numeric argument or prefix arg is given, leave that number
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3231 of lines before the signature intact."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3232 (interactive "P")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3233 (save-excursion
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3234 (save-restriction
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3235 (let ((point (point)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3236 (narrow-to-region point (point-max))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3237 (message-goto-signature)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3238 (unless (eobp)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3239 (if (and arg (numberp arg))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3240 (forward-line (- -1 arg))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3241 (end-of-line -1)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3242 (unless (= point (point))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3243 (kill-region point (point))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3244 (unless (bolp)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3245 (insert "\n")))))))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3246
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3247 (defun message-newline-and-reformat (&optional arg not-break)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3248 "Insert four newlines, and then reformat if inside quoted text.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3249 Prefix arg means justify as well."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3250 (interactive (list (if current-prefix-arg 'full)))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3251 (let (quoted point beg end leading-space bolp fill-paragraph-function)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3252 (setq point (point))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3253 (beginning-of-line)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3254 (setq beg (point))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3255 (setq bolp (= beg point))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3256 ;; Find first line of the paragraph.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3257 (if not-break
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3258 (while (and (not (eobp))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3259 (not (looking-at message-cite-prefix-regexp))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3260 (looking-at paragraph-start))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3261 (forward-line 1)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3262 ;; Find the prefix
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3263 (when (looking-at message-cite-prefix-regexp)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3264 (setq quoted (match-string 0))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3265 (goto-char (match-end 0))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3266 (looking-at "[ \t]*")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3267 (setq leading-space (match-string 0)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3268 (if (and quoted
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3269 (not not-break)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3270 (not bolp)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3271 (< (- point beg) (length quoted)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3272 ;; break inside the cite prefix.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3273 (setq quoted nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3274 end nil))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3275 (if quoted
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3276 (progn
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3277 (forward-line 1)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3278 (while (and (not (eobp))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3279 (not (looking-at paragraph-separate))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3280 (looking-at message-cite-prefix-regexp)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3281 (equal quoted (match-string 0)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3282 (goto-char (match-end 0))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3283 (looking-at "[ \t]*")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3284 (if (> (length leading-space) (length (match-string 0)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3285 (setq leading-space (match-string 0)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3286 (forward-line 1))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3287 (setq end (point))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3288 (goto-char beg)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3289 (while (and (if (bobp) nil (forward-line -1) t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3290 (not (looking-at paragraph-start))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3291 (looking-at message-cite-prefix-regexp)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3292 (equal quoted (match-string 0)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3293 (setq beg (point))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3294 (goto-char (match-end 0))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3295 (looking-at "[ \t]*")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3296 (if (> (length leading-space) (length (match-string 0)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3297 (setq leading-space (match-string 0)))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3298 (while (and (not (eobp))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3299 (not (looking-at paragraph-separate))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3300 (not (looking-at message-cite-prefix-regexp)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3301 (forward-line 1))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3302 (setq end (point))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3303 (goto-char beg)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3304 (while (and (if (bobp) nil (forward-line -1) t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3305 (not (looking-at paragraph-start))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3306 (not (looking-at message-cite-prefix-regexp)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3307 (setq beg (point))))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3308 (goto-char point)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3309 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3310 (narrow-to-region beg end)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3311 (if not-break
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3312 (setq point nil)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3313 (if bolp
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3314 (newline)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3315 (newline)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3316 (newline))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3317 (setq point (point))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3318 ;; (newline 2) doesn't mark both newline's as hard, so call
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3319 ;; newline twice. -jas
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3320 (newline)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3321 (newline)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3322 (delete-region (point) (re-search-forward "[ \t]*"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3323 (when (and quoted (not bolp))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3324 (insert quoted leading-space)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3325 (undo-boundary)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3326 (if quoted
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3327 (let* ((adaptive-fill-regexp
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3328 (regexp-quote (concat quoted leading-space)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3329 (adaptive-fill-first-line-regexp
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3330 adaptive-fill-regexp ))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3331 (fill-paragraph arg))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3332 (fill-paragraph arg))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3333 (if point (goto-char point)))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3334
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3335 (defun message-fill-paragraph (&optional arg)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3336 "Message specific function to fill a paragraph.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3337 This function is used as the value of `fill-paragraph-function' in
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3338 Message buffers and is not meant to be called directly."
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3339 (interactive (list (if current-prefix-arg 'full)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3340 (if (if (boundp 'filladapt-mode) filladapt-mode)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3341 nil
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3342 (if (message-point-in-header-p)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3343 (message-fill-field)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3344 (message-newline-and-reformat arg t))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3345 t))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3346
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3347 (defun message-point-in-header-p ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3348 "Return t if point is in the header."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3349 (save-excursion
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3350 (not (re-search-backward
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3351 (concat "^" (regexp-quote mail-header-separator) "\n") nil t))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3352
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3353 (defun message-do-auto-fill ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3354 "Like `do-auto-fill', but don't fill in message header."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3355 (unless (message-point-in-header-p)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3356 (do-auto-fill)))
49034
b6e082e00b00 (message-split-line): New function.
Kim F. Storm <storm@cua.dk>
parents: 48588
diff changeset
3357
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3358 (defun message-insert-signature (&optional force)
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
3359 "Insert a signature. See documentation for variable `message-signature'."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3360 (interactive (list 0))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3361 (let* ((signature
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3362 (cond
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3363 ((and (null message-signature)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3364 (eq force 0))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3365 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3366 (goto-char (point-max))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3367 (not (re-search-backward message-signature-separator nil t))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3368 ((and (null message-signature)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3369 force)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3370 t)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3371 ((functionp message-signature)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3372 (funcall message-signature))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3373 ((listp message-signature)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3374 (eval message-signature))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3375 (t message-signature)))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3376 signature-file)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3377 (setq signature
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3378 (cond ((stringp signature)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3379 signature)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3380 ((and (eq t signature) message-signature-file)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3381 (setq signature-file
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3382 (if (and message-signature-directory
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3383 ;; don't actually use the signature directory
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3384 ;; if message-signature-file contains a path.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3385 (not (file-name-directory
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3386 message-signature-file)))
107427
ecbe0edc4f69 Stop message.el from loading about 40 libraries it doesn't always need.
Glenn Morris <rgm@gnu.org>
parents: 107235
diff changeset
3387 (expand-file-name message-signature-file
ecbe0edc4f69 Stop message.el from loading about 40 libraries it doesn't always need.
Glenn Morris <rgm@gnu.org>
parents: 107235
diff changeset
3388 message-signature-directory)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3389 message-signature-file))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3390 (file-exists-p signature-file))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3391 (when signature
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3392 (goto-char (point-max))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3393 ;; Insert the signature.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3394 (unless (bolp)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
3395 (insert "\n"))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3396 (when message-signature-insert-empty-line
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
3397 (insert "\n"))
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
3398 (insert "-- \n")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3399 (if (eq signature t)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3400 (insert-file-contents signature-file)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3401 (insert signature))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3402 (goto-char (point-max))
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
3403 (or (bolp) (insert "\n")))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3404
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3405 (defun message-insert-importance-high ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3406 "Insert header to mark message as important."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3407 (interactive)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3408 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3409 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3410 (message-narrow-to-headers)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3411 (message-remove-header "Importance"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3412 (message-goto-eoh)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
3413 (insert "Importance: high\n")))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3414
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3415 (defun message-insert-importance-low ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3416 "Insert header to mark message as unimportant."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3417 (interactive)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3418 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3419 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3420 (message-narrow-to-headers)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3421 (message-remove-header "Importance"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3422 (message-goto-eoh)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
3423 (insert "Importance: low\n")))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3424
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3425 (defun message-insert-or-toggle-importance ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3426 "Insert a \"Importance: high\" header, or cycle through the header values.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3427 The three allowed values according to RFC 1327 are `high', `normal'
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3428 and `low'."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3429 (interactive)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3430 (save-excursion
86339
6f4793ab0756 (message-send-mail-function): Fix error convention.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 86276
diff changeset
3431 (let ((new "high")
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3432 cur)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3433 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3434 (message-narrow-to-headers)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3435 (when (setq cur (message-fetch-field "Importance"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3436 (message-remove-header "Importance")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3437 (setq new (cond ((string= cur "high")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3438 "low")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3439 ((string= cur "low")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3440 "normal")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3441 (t
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3442 "high")))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3443 (message-goto-eoh)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
3444 (insert (format "Importance: %s\n" new)))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3445
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3446 (defun message-insert-disposition-notification-to ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3447 "Request a disposition notification (return receipt) to this message.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3448 Note that this should not be used in newsgroups."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3449 (interactive)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3450 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3451 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3452 (message-narrow-to-headers)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3453 (message-remove-header "Disposition-Notification-To"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3454 (message-goto-eoh)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
3455 (insert (format "Disposition-Notification-To: %s\n"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3456 (or (message-field-value "Reply-to")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3457 (message-field-value "From")
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
3458 (message-make-from))))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3459
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3460 (defun message-elide-region (b e)
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
3461 "Elide the text in the region.
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3462 An ellipsis (from `message-elide-ellipsis') will be inserted where the
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3463 text was killed."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3464 (interactive "r")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3465 (kill-region b e)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3466 (insert message-elide-ellipsis))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3467
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3468 (defvar message-caesar-translation-table nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3469
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3470 (defun message-caesar-region (b e &optional n)
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
3471 "Caesar rotate region B to E by N, default 13, for decrypting netnews."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3472 (interactive
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3473 (list
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3474 (min (point) (or (mark t) (point)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3475 (max (point) (or (mark t) (point)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3476 (when current-prefix-arg
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3477 (prefix-numeric-value current-prefix-arg))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3478
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3479 (setq n (if (numberp n) (mod n 26) 13)) ;canonize N
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3480 (unless (or (zerop n) ; no action needed for a rot of 0
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3481 (= b e)) ; no region to rotate
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3482 ;; We build the table, if necessary.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3483 (when (or (not message-caesar-translation-table)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3484 (/= (aref message-caesar-translation-table ?a) (+ ?a n)))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3485 (setq message-caesar-translation-table
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3486 (message-make-caesar-translation-table n)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3487 (translate-region b e message-caesar-translation-table)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3488
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3489 (defun message-make-caesar-translation-table (n)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3490 "Create a rot table with offset N."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3491 (let ((i -1)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3492 (table (make-string 256 0)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3493 (while (< (incf i) 256)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3494 (aset table i i))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3495 (concat
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3496 (substring table 0 ?A)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3497 (substring table (+ ?A n) (+ ?A n (- 26 n)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3498 (substring table ?A (+ ?A n))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3499 (substring table (+ ?A 26) ?a)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3500 (substring table (+ ?a n) (+ ?a n (- 26 n)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3501 (substring table ?a (+ ?a n))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3502 (substring table (+ ?a 26) 255))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3503
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3504 (defun message-caesar-buffer-body (&optional rotnum wide)
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
3505 "Caesar rotate all letters in the current buffer by 13 places.
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
3506 Used to encode/decode possibly offensive messages (commonly in rec.humor).
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3507 With prefix arg, specifies the number of places to rotate each letter forward.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3508 Mail and USENET news headers are not rotated unless WIDE is non-nil."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3509 (interactive (if current-prefix-arg
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3510 (list (prefix-numeric-value current-prefix-arg))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3511 (list nil)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3512 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3513 (save-restriction
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3514 (when (and (not wide) (message-goto-body))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3515 (narrow-to-region (point) (point-max)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3516 (message-caesar-region (point-min) (point-max) rotnum))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3517
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3518 (defun message-pipe-buffer-body (program)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3519 "Pipe the message body in the current buffer through PROGRAM."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3520 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3521 (save-restriction
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3522 (when (message-goto-body)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3523 (narrow-to-region (point) (point-max)))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3524 (shell-command-on-region
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3525 (point-min) (point-max) program nil t))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3526
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3527 (defun message-rename-buffer (&optional enter-string)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3528 "Rename the *message* buffer to \"*message* RECIPIENT\".
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3529 If the function is run with a prefix, it will ask for a new buffer
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3530 name, rather than giving an automatic name."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3531 (interactive "Pbuffer name: ")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3532 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3533 (save-restriction
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3534 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3535 (narrow-to-region (point)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3536 (search-forward mail-header-separator nil 'end))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3537 (let* ((mail-to (or
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3538 (if (message-news-p) (message-fetch-field "Newsgroups")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3539 (message-fetch-field "To"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3540 ""))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3541 (mail-trimmed-to
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3542 (if (string-match "," mail-to)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3543 (concat (substring mail-to 0 (match-beginning 0)) ", ...")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3544 mail-to))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3545 (name-default (concat "*message* " mail-trimmed-to))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3546 (name (if enter-string
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3547 (read-string "New buffer name: " name-default)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3548 name-default)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3549 (rename-buffer name t)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3550
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3551 (defun message-fill-yanked-message (&optional justifyp)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3552 "Fill the paragraphs of a message yanked into this one.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3553 Numeric argument means justify as well."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3554 (interactive "P")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3555 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3556 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3557 (search-forward (concat "\n" mail-header-separator "\n") nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3558 (let ((fill-prefix message-yank-prefix))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3559 (fill-individual-paragraphs (point) (point-max) justifyp))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3560
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3561 (defun message-indent-citation (&optional start end yank-only)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3562 "Modify text just inserted from a message to be cited.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3563 The inserted text should be the region.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3564 When this function returns, the region is again around the modified text.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3565
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3566 Normally, indent each nonblank line `message-indentation-spaces' spaces.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3567 However, if `message-yank-prefix' is non-nil, insert that prefix on each line."
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3568 (unless start (setq start (point)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3569 (unless yank-only
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3570 ;; Remove unwanted headers.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3571 (when message-ignored-cited-headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3572 (let (all-removed)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3573 (save-restriction
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3574 (narrow-to-region
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3575 (goto-char start)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3576 (if (search-forward "\n\n" nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3577 (1- (point))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3578 (point)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3579 (message-remove-header message-ignored-cited-headers t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3580 (when (= (point-min) (point-max))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3581 (setq all-removed t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3582 (goto-char (point-max)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3583 (if all-removed
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3584 (goto-char start)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3585 (forward-line 1))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3586 ;; Delete blank lines at the start of the buffer.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3587 (while (and (point-min)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3588 (eolp)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3589 (not (eobp)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3590 (message-delete-line))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3591 ;; Delete blank lines at the end of the buffer.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3592 (goto-char (point-max))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3593 (unless (eolp)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
3594 (insert "\n"))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3595 (while (and (zerop (forward-line -1))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3596 (looking-at "$"))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3597 (message-delete-line)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3598 ;; Do the indentation.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3599 (if (null message-yank-prefix)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3600 (indent-rigidly start (or end (mark t)) message-indentation-spaces)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3601 (save-excursion
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3602 (goto-char start)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3603 (while (< (point) (or end (mark t)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3604 (cond ((looking-at ">")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3605 (insert message-yank-cited-prefix))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3606 ((looking-at "^$")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3607 (insert message-yank-empty-prefix))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3608 (t
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3609 (insert message-yank-prefix)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3610 (forward-line 1))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3611 (goto-char start))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3612
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3613 (defun message-remove-blank-cited-lines (&optional remove)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3614 "Remove cited lines containing only blanks.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3615 If REMOVE is non-nil, remove newlines, too.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3616
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3617 To use this automatically, you may add this function to
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3618 `gnus-message-setup-hook'."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3619 (interactive "P")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3620 (let ((citexp
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3621 (concat
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3622 "^\\("
85809
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
3623 (when (boundp 'message-yank-cited-prefix)
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
3624 (concat message-yank-cited-prefix "\\|"))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3625 message-yank-prefix
85809
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
3626 "\\)+ *\n"
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
3627 )))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3628 (gnus-message 8 "removing `%s'" citexp)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3629 (save-excursion
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3630 (message-goto-body)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3631 (while (re-search-forward citexp nil t)
85809
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
3632 (replace-match (if remove "" "\n"))))))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3633
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3634 (defvar message-cite-reply-above nil
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3635 "If non-nil, start own text above the quote.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3636
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3637 Note: Top posting is bad netiquette. Don't use it unless you
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3638 really must. You probably want to set variable only for specific
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3639 groups, e.g. using `gnus-posting-styles':
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3640
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3641 (eval (set (make-local-variable 'message-cite-reply-above) t))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3642
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3643 This variable has no effect in news postings.")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3644
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3645 (defun message-yank-original (&optional arg)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3646 "Insert the message being replied to, if any.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3647 Puts point before the text and mark after.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3648 Normally indents each nonblank line ARG spaces (default 3). However,
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3649 if `message-yank-prefix' is non-nil, insert that prefix on each line.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3650
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3651 This function uses `message-cite-function' to do the actual citing.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3652
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3653 Just \\[universal-argument] as argument means don't indent, insert no
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3654 prefix, and don't delete any headers."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3655 (interactive "P")
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3656 (let ((modified (buffer-modified-p))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3657 body-text)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3658 (when (and message-reply-buffer
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3659 message-cite-function)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3660 (when message-cite-reply-above
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3661 (if (and (not (message-news-p))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3662 (or (eq message-cite-reply-above 'is-evil)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3663 (y-or-n-p "\
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3664 Top posting is bad netiquette. Please don't top post unless you really must.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3665 Really top post? ")))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3666 (save-excursion
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3667 (setq body-text
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3668 (buffer-substring (message-goto-body)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3669 (point-max)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3670 (delete-region (message-goto-body) (point-max)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3671 (set (make-local-variable 'message-cite-reply-above) nil)))
106890
2ed4eab78ca3 * message.el (message-mail): Just pass yank-action on to message-setup.
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
3672 (if (bufferp message-reply-buffer)
2ed4eab78ca3 * message.el (message-mail): Just pass yank-action on to message-setup.
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
3673 (delete-windows-on message-reply-buffer t))
64712
4db92b217e85 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-507
Miles Bader <miles@gnu.org>
parents: 64085
diff changeset
3674 (push-mark (save-excursion
106890
2ed4eab78ca3 * message.el (message-mail): Just pass yank-action on to message-setup.
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
3675 (cond
2ed4eab78ca3 * message.el (message-mail): Just pass yank-action on to message-setup.
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
3676 ((bufferp message-reply-buffer)
2ed4eab78ca3 * message.el (message-mail): Just pass yank-action on to message-setup.
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
3677 (insert-buffer-substring message-reply-buffer))
2ed4eab78ca3 * message.el (message-mail): Just pass yank-action on to message-setup.
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
3678 ((and (consp message-reply-buffer)
2ed4eab78ca3 * message.el (message-mail): Just pass yank-action on to message-setup.
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
3679 (functionp (car message-reply-buffer)))
2ed4eab78ca3 * message.el (message-mail): Just pass yank-action on to message-setup.
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
3680 (apply (car message-reply-buffer)
2ed4eab78ca3 * message.el (message-mail): Just pass yank-action on to message-setup.
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
3681 (cdr message-reply-buffer))))
77114
b64b5f4be390 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76757
diff changeset
3682 (unless (bolp)
b64b5f4be390 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76757
diff changeset
3683 (insert ?\n))
64712
4db92b217e85 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-507
Miles Bader <miles@gnu.org>
parents: 64085
diff changeset
3684 (point)))
35453
26726eff41ca 2001-01-21 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 35147
diff changeset
3685 (unless arg
77114
b64b5f4be390 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76757
diff changeset
3686 (funcall message-cite-function)
b64b5f4be390 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76757
diff changeset
3687 (unless (eq (char-before (mark t)) ?\n)
b64b5f4be390 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76757
diff changeset
3688 (let ((pt (point)))
b64b5f4be390 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76757
diff changeset
3689 (goto-char (mark t))
b64b5f4be390 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76757
diff changeset
3690 (insert-before-markers ?\n)
b64b5f4be390 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76757
diff changeset
3691 (goto-char pt))))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3692 (when message-cite-reply-above
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3693 (message-goto-body)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3694 (insert body-text)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3695 (insert (if (bolp) "\n" "\n\n"))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3696 (message-goto-body))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3697 ;; Add a `message-setup-very-last-hook' here?
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3698 ;; Add `gnus-article-highlight-citation' here?
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3699 (unless modified
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3700 (setq message-checksum (message-checksum))))))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3701
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3702 (defun message-yank-buffer (buffer)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3703 "Insert BUFFER into the current buffer and quote it."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3704 (interactive "bYank buffer: ")
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3705 (let ((message-reply-buffer (get-buffer buffer)))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3706 (save-window-excursion
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3707 (message-yank-original))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3708
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3709 (defun message-buffers ()
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3710 "Return a list of active message buffers."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3711 (let (buffers)
86339
6f4793ab0756 (message-send-mail-function): Fix error convention.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 86276
diff changeset
3712 (save-current-buffer
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3713 (dolist (buffer (buffer-list t))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3714 (set-buffer buffer)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3715 (when (and (eq major-mode 'message-mode)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3716 (null message-sent-message-via))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3717 (push (buffer-name buffer) buffers))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3718 (nreverse buffers)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3719
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3720 (defun message-cite-original-1 (strip-signature)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3721 "Cite an original message.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3722 If STRIP-SIGNATURE is non-nil, strips off the signature from the
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3723 original message.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3724
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3725 This function uses `mail-citation-hook' if that is non-nil."
22656
e3dc0aa099e5 (message-cite-original): If mail-citation-hook
Richard M. Stallman <rms@gnu.org>
parents: 22378
diff changeset
3726 (if (and (boundp 'mail-citation-hook)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3727 mail-citation-hook)
22656
e3dc0aa099e5 (message-cite-original): If mail-citation-hook
Richard M. Stallman <rms@gnu.org>
parents: 22378
diff changeset
3728 (run-hooks 'mail-citation-hook)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3729 (let* ((start (point))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3730 (end (mark t))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3731 (x-no-archive nil)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3732 (functions
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3733 (when message-indent-citation-function
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3734 (if (listp message-indent-citation-function)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3735 message-indent-citation-function
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3736 (list message-indent-citation-function))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3737 ;; This function may be called by `gnus-summary-yank-message' and
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3738 ;; may insert a different article from the original. So, we will
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3739 ;; modify the value of `message-reply-headers' with that article.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3740 (message-reply-headers
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3741 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3742 (narrow-to-region start end)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3743 (message-narrow-to-head-1)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3744 (setq x-no-archive (message-fetch-field "x-no-archive"))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3745 (vector 0
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3746 (or (message-fetch-field "subject") "none")
73007
637b0854d9b5 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 72636
diff changeset
3747 (or (message-fetch-field "from") "nobody")
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3748 (message-fetch-field "date")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3749 (message-fetch-field "message-id" t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3750 (message-fetch-field "references")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3751 0 0 ""))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3752 (mml-quote-region start end)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3753 (when strip-signature
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3754 ;; Allow undoing.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3755 (undo-boundary)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3756 (goto-char end)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3757 (when (re-search-backward message-signature-separator start t)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3758 ;; Also peel off any blank lines before the signature.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3759 (forward-line -1)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3760 (while (looking-at "^[ \t]*$")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3761 (forward-line -1))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3762 (forward-line 1)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3763 (delete-region (point) end)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3764 (unless (search-backward "\n\n" start t)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3765 ;; Insert a blank line if it is peeled off.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3766 (insert "\n"))))
22656
e3dc0aa099e5 (message-cite-original): If mail-citation-hook
Richard M. Stallman <rms@gnu.org>
parents: 22378
diff changeset
3767 (goto-char start)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3768 (mapc 'funcall functions)
22656
e3dc0aa099e5 (message-cite-original): If mail-citation-hook
Richard M. Stallman <rms@gnu.org>
parents: 22378
diff changeset
3769 (when message-citation-line-function
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3770 (unless (bolp)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
3771 (insert "\n"))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3772 (funcall message-citation-line-function))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3773 (when (and x-no-archive
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3774 (not message-cite-articles-with-x-no-archive)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3775 (string-match "yes" x-no-archive))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3776 (undo-boundary)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3777 (delete-region (point) (mark t))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3778 (insert "> [Quoted text removed due to X-No-Archive]\n")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3779 (push-mark)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3780 (forward-line -1)))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3781
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3782 (defun message-cite-original ()
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3783 "Cite function in the standard Message manner."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3784 (message-cite-original-1 nil))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3785
87026
9a6b88cec251 (gnus-extract-address-components): Define for compiler.
Glenn Morris <rgm@gnu.org>
parents: 86393
diff changeset
3786 (defvar gnus-extract-address-components)
9a6b88cec251 (gnus-extract-address-components): Define for compiler.
Glenn Morris <rgm@gnu.org>
parents: 86393
diff changeset
3787
87245
6207f5a83057 (Info-goto-node, format-spec): Autoload.
Glenn Morris <rgm@gnu.org>
parents: 87191
diff changeset
3788 (autoload 'format-spec "format-spec")
6207f5a83057 (Info-goto-node, format-spec): Autoload.
Glenn Morris <rgm@gnu.org>
parents: 87191
diff changeset
3789
85974
403aa95593fa Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85888
diff changeset
3790 (defun message-insert-formatted-citation-line (&optional from date)
403aa95593fa Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85888
diff changeset
3791 "Function that inserts a formatted citation line.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3792
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3793 See `message-citation-line-format'."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3794 ;; The optional args are for testing/debugging. They will disappear later.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3795 ;; Example:
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3796 ;; (with-temp-buffer
85974
403aa95593fa Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85888
diff changeset
3797 ;; (message-insert-formatted-citation-line
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3798 ;; "John Doe <john.doe@example.invalid>"
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3799 ;; (current-time))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3800 ;; (buffer-string))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3801 (when (or message-reply-headers (and from date))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3802 (unless from
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3803 (setq from (mail-header-from message-reply-headers)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3804 (let* ((data (condition-case ()
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3805 (funcall (if (boundp gnus-extract-address-components)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3806 gnus-extract-address-components
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3807 'mail-extract-address-components)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3808 from)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3809 (error nil)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3810 (name (car data))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3811 (fname name)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3812 (lname name)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3813 (net (car (cdr data)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3814 (name-or-net (or (car data)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3815 (car (cdr data)) from))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3816 (replydate
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3817 (or
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3818 date
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3819 ;; We need Gnus functionality if the user wants date or time from
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3820 ;; the original article:
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3821 (when (string-match "%[^fnNFL]" message-citation-line-format)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3822 (autoload 'gnus-date-get-time "gnus-util")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3823 (gnus-date-get-time (mail-header-date message-reply-headers)))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3824 (flist
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3825 (let ((i ?A) lst)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3826 (when (stringp name)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3827 ;; Guess first name and last name:
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3828 (cond ((string-match
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3829 "\\`\\(\\w\\|[-.]\\)+ \\(\\w\\|[-.]\\)+\\'" name)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3830 (setq fname (nth 0 (split-string name "[ \t]+"))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3831 lname (nth 1 (split-string name "[ \t]+"))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3832 ((string-match
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3833 "\\`\\(\\w\\|[-.]\\)+, \\(\\w\\|[-.]\\)+\\'" name)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3834 (setq fname (nth 1 (split-string name "[ \t,]+"))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3835 lname (nth 0 (split-string name "[ \t,]+"))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3836 ((string-match
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3837 "\\`\\(\\w\\|[-.]\\)+\\'" name)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3838 (setq fname name
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3839 lname ""))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3840 ;; The following letters are not used in `format-time-string':
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3841 (push ?E lst) (push "<E>" lst)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3842 (push ?F lst) (push fname lst)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3843 ;; We might want to use "" instead of "<X>" later.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3844 (push ?J lst) (push "<J>" lst)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3845 (push ?K lst) (push "<K>" lst)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3846 (push ?L lst) (push lname lst)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3847 (push ?N lst) (push name-or-net lst)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3848 (push ?O lst) (push "<O>" lst)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3849 (push ?P lst) (push "<P>" lst)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3850 (push ?Q lst) (push "<Q>" lst)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3851 (push ?f lst) (push from lst)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3852 (push ?i lst) (push "<i>" lst)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3853 (push ?n lst) (push net lst)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3854 (push ?o lst) (push "<o>" lst)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3855 (push ?q lst) (push "<q>" lst)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3856 (push ?t lst) (push "<t>" lst)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3857 (push ?v lst) (push "<v>" lst)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3858 ;; Delegate the rest to `format-time-string':
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3859 (while (<= i ?z)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3860 (when (and (not (memq i lst))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3861 ;; Skip (Z,a)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3862 (or (<= i ?Z)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3863 (>= i ?a)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3864 (push i lst)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3865 (push (condition-case nil
105078
40ab4c53d7a6 Fix typos in condition-case handlers.
Glenn Morris <rgm@gnu.org>
parents: 104789
diff changeset
3866 (format-time-string (format "%%%c" i) replydate)
40ab4c53d7a6 Fix typos in condition-case handlers.
Glenn Morris <rgm@gnu.org>
parents: 104789
diff changeset
3867 (error (format ">%c<" i)))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3868 lst))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3869 (setq i (1+ i)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3870 (reverse lst)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3871 (spec (apply 'format-spec-make flist)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3872 (insert (format-spec message-citation-line-format spec)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3873 (newline)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3874
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3875 (defun message-cite-original-without-signature ()
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3876 "Cite function in the standard Message manner.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3877 This function strips off the signature from the original message."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3878 (message-cite-original-1 t))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3879
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3880 (defun message-insert-citation-line ()
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
3881 "Insert a simple citation line."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3882 (when message-reply-headers
67032
ebf472d3ae22 (message-insert-citation-line): Use newlines.
Chong Yidong <cyd@stupidchicken.com>
parents: 67030
diff changeset
3883 (insert (mail-header-from message-reply-headers) " writes:")
ebf472d3ae22 (message-insert-citation-line): Use newlines.
Chong Yidong <cyd@stupidchicken.com>
parents: 67030
diff changeset
3884 (newline)
ebf472d3ae22 (message-insert-citation-line): Use newlines.
Chong Yidong <cyd@stupidchicken.com>
parents: 67030
diff changeset
3885 (newline)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3886
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3887 (defun message-position-on-field (header &rest afters)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3888 (let ((case-fold-search t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3889 (save-restriction
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3890 (narrow-to-region
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3891 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3892 (progn
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3893 (re-search-forward
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3894 (concat "^" (regexp-quote mail-header-separator) "$"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3895 (match-beginning 0)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3896 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3897 (if (re-search-forward (concat "^" (regexp-quote header) ":") nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3898 (progn
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3899 (re-search-forward "^[^ \t]" nil 'move)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3900 (beginning-of-line)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3901 (skip-chars-backward "\n")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3902 t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3903 (while (and afters
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3904 (not (re-search-forward
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3905 (concat "^" (regexp-quote (car afters)) ":")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3906 nil t)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3907 (pop afters))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3908 (when afters
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3909 (re-search-forward "^[^ \t]" nil 'move)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3910 (beginning-of-line))
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
3911 (insert header ": \n")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3912 (forward-char -1)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3913 nil))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3914
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3915 (defun message-remove-signature ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3916 "Remove the signature from the text between point and mark.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3917 The text will also be indented the normal way."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3918 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3919 (let ((start (point))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3920 mark)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3921 (if (not (re-search-forward message-signature-separator (mark t) t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3922 ;; No signature here, so we just indent the cited text.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3923 (message-indent-citation)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3924 ;; Find the last non-empty line.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3925 (forward-line -1)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3926 (while (looking-at "[ \t]*$")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3927 (forward-line -1))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3928 (forward-line 1)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3929 (setq mark (set-marker (make-marker) (point)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3930 (goto-char start)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3931 (message-indent-citation)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3932 ;; Enable undoing the deletion.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3933 (undo-boundary)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3934 (delete-region mark (mark t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3935 (set-marker mark nil)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3936
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3937
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3938
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3939 ;;;
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3940 ;;; Sending messages
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3941 ;;;
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3942
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3943 (defun message-send-and-exit (&optional arg)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3944 "Send message like `message-send', then, if no errors, exit from mail buffer."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3945 (interactive "P")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3946 (let ((buf (current-buffer))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3947 (actions message-exit-actions))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3948 (when (and (message-send arg)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3949 (buffer-name buf))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3950 (if message-kill-buffer-on-exit
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3951 (kill-buffer buf)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3952 (bury-buffer buf)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3953 (when (eq buf (current-buffer))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3954 (message-bury buf)))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3955 (message-do-actions actions)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3956 t)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3957
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3958 (defun message-dont-send ()
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3959 "Don't send the message you have been editing.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3960 Instead, just auto-save the buffer and then bury it."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3961 (interactive)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3962 (set-buffer-modified-p t)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3963 (save-buffer)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3964 (let ((actions message-postpone-actions))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3965 (message-bury (current-buffer))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3966 (message-do-actions actions)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3967
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3968 (defun message-kill-buffer ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3969 "Kill the current buffer."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3970 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3971 (when (or (not (buffer-modified-p))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
3972 (not message-kill-buffer-query)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3973 (yes-or-no-p "Message modified; kill anyway? "))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3974 (let ((actions message-kill-actions)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3975 (draft-article message-draft-article)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3976 (auto-save-file-name buffer-auto-save-file-name)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3977 (file-name buffer-file-name)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3978 (modified (buffer-modified-p)))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3979 (setq buffer-file-name nil)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3980 (kill-buffer (current-buffer))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3981 (when (and (or (and auto-save-file-name
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3982 (file-exists-p auto-save-file-name))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3983 (and file-name
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3984 (file-exists-p file-name)))
64735
bfabe4ff7114 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-512
Miles Bader <miles@gnu.org>
parents: 64712
diff changeset
3985 (progn
bfabe4ff7114 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-512
Miles Bader <miles@gnu.org>
parents: 64712
diff changeset
3986 ;; If the message buffer has lived in a dedicated window,
bfabe4ff7114 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-512
Miles Bader <miles@gnu.org>
parents: 64712
diff changeset
3987 ;; `kill-buffer' has killed the frame. Thus the
bfabe4ff7114 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-512
Miles Bader <miles@gnu.org>
parents: 64712
diff changeset
3988 ;; `yes-or-no-p' may show up in a lowered frame. Make sure
bfabe4ff7114 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-512
Miles Bader <miles@gnu.org>
parents: 64712
diff changeset
3989 ;; that the user can see the question by raising the
bfabe4ff7114 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-512
Miles Bader <miles@gnu.org>
parents: 64712
diff changeset
3990 ;; current frame:
bfabe4ff7114 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-512
Miles Bader <miles@gnu.org>
parents: 64712
diff changeset
3991 (raise-frame)
bfabe4ff7114 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-512
Miles Bader <miles@gnu.org>
parents: 64712
diff changeset
3992 (yes-or-no-p (format "Remove the backup file%s? "
bfabe4ff7114 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-512
Miles Bader <miles@gnu.org>
parents: 64712
diff changeset
3993 (if modified " too" "")))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3994 (ignore-errors
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3995 (delete-file auto-save-file-name))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3996 (let ((message-draft-article draft-article))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3997 (message-disassociate-draft)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3998 (message-do-actions actions))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3999
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4000 (defun message-bury (buffer)
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
4001 "Bury this mail BUFFER."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4002 (let ((newbuf (other-buffer buffer)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4003 (bury-buffer buffer)
64735
bfabe4ff7114 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-512
Miles Bader <miles@gnu.org>
parents: 64712
diff changeset
4004 (if (and (window-dedicated-p (selected-window))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4005 (not (null (delq (selected-frame) (visible-frame-list)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4006 (delete-frame (selected-frame))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4007 (switch-to-buffer newbuf))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4008
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4009 (defun message-send (&optional arg)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4010 "Send the message in the current buffer.
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4011 If `message-interactive' is non-nil, wait for success indication or
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4012 error messages, and inform user.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4013 Otherwise any failure is reported in a message back to the user from
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4014 the mailer.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4015 The usage of ARG is defined by the instance that called Message.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4016 It should typically alter the sending method in some way or other."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4017 (interactive "P")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4018 ;; Make it possible to undo the coming changes.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4019 (undo-boundary)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4020 (let ((inhibit-read-only t))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4021 (put-text-property (point-min) (point-max) 'read-only nil))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4022 (message-fix-before-sending)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4023 (run-hooks 'message-send-hook)
97972
0f2f9b7e7d8e Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97142
diff changeset
4024 (when message-confirm-send
0f2f9b7e7d8e Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97142
diff changeset
4025 (or (y-or-n-p "Send message? ")
0f2f9b7e7d8e Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97142
diff changeset
4026 (keyboard-quit)))
32967
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
4027 (message message-sending-message)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4028 (let ((alist message-send-method-alist)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4029 (success t)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4030 elem sent dont-barf-on-no-method
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4031 (message-options message-options))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4032 (message-options-set-recipient)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4033 (while (and success
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4034 (setq elem (pop alist)))
32967
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
4035 (when (funcall (cadr elem))
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
4036 (when (and (or (not (memq (car elem)
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
4037 message-sent-message-via))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4038 (message-fetch-field "supersedes")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4039 (if (or (message-gnksa-enable-p 'multiple-copies)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4040 (not (eq (car elem) 'news)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4041 (y-or-n-p
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4042 (format
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4043 "Already sent message via %s; resend? "
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4044 (car elem)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4045 (error "Denied posting -- multiple copies")))
32967
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
4046 (setq success (funcall (caddr elem) arg)))
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
4047 (setq sent t))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4048 (unless (or sent
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4049 (not success)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4050 (let ((fcc (message-fetch-field "Fcc"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4051 (gcc (message-fetch-field "Gcc")))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4052 (when (or fcc gcc)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4053 (or (eq message-allow-no-recipients 'always)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4054 (and (not (eq message-allow-no-recipients 'never))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4055 (setq dont-barf-on-no-method
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4056 (gnus-y-or-n-p
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4057 (format "No receiver, perform %s anyway? "
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4058 (cond ((and fcc gcc) "Fcc and Gcc")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4059 (fcc "Fcc")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4060 (t "Gcc"))))))))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4061 (error "No methods specified to send by"))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4062 (when (or dont-barf-on-no-method
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4063 (and success sent))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4064 (message-do-fcc)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4065 (save-excursion
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4066 (run-hooks 'message-sent-hook))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4067 (message "Sending...done")
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4068 ;; Do ecomplete address snarfing.
110023
fa10effce8f8 Misc Gnus fixes by Lars Magne Ingebrigtsen <larsi@gnus.org>.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108513
diff changeset
4069 (when (and (message-mail-alias-type-p 'ecomplete)
fa10effce8f8 Misc Gnus fixes by Lars Magne Ingebrigtsen <larsi@gnus.org>.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108513
diff changeset
4070 (not message-inhibit-ecomplete))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4071 (message-put-addresses-in-ecomplete))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4072 ;; Mark the buffer as unmodified and delete auto-save.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4073 (set-buffer-modified-p nil)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4074 (delete-auto-save-file-if-necessary t)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4075 (message-disassociate-draft)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4076 ;; Delete other mail buffers and stuff.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4077 (message-do-send-housekeeping)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4078 (message-do-actions message-send-actions)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4079 ;; Return success.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4080 t)))
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
4081
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
4082 (defun message-send-via-mail (arg)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4083 "Send the current message via mail."
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
4084 (message-send-mail arg))
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
4085
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
4086 (defun message-send-via-news (arg)
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
4087 "Send the current message via news."
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
4088 (funcall message-send-news-function arg))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4089
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4090 (defmacro message-check (type &rest forms)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4091 "Eval FORMS if TYPE is to be checked."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4092 `(or (message-check-element ,type)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4093 (save-excursion
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4094 ,@forms)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4095
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4096 (put 'message-check 'lisp-indent-function 1)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4097 (put 'message-check 'edebug-form-spec '(form body))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4098
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4099 (defun message-text-with-property (prop &optional start end reverse)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4100 "Return a list of start and end positions where the text has PROP.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4101 START and END bound the search, they default to `point-min' and
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4102 `point-max' respectively. If REVERSE is non-nil, find text which does
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4103 not have PROP."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4104 (unless start
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4105 (setq start (point-min)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4106 (unless end
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4107 (setq end (point-max)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4108 (let (next regions)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4109 (if reverse
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4110 (while (and start
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4111 (setq start (text-property-any start end prop nil)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4112 (setq next (next-single-property-change start prop nil end))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4113 (push (cons start (or next end)) regions)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4114 (setq start next))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4115 (while (and start
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4116 (or (get-text-property start prop)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4117 (and (setq start (next-single-property-change
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4118 start prop nil end))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4119 (get-text-property start prop))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4120 (setq next (text-property-any start end prop nil))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4121 (push (cons start (or next end)) regions)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4122 (setq start next)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4123 (nreverse regions)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4124
95451
15ffd5c2dc17 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95086
diff changeset
4125 (defcustom message-bogus-addresses
15ffd5c2dc17 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95086
diff changeset
4126 ;; '("noreply" "nospam" "invalid")
15ffd5c2dc17 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95086
diff changeset
4127 '("noreply" "nospam" "invalid" "@@" "[^[:ascii:]].*@" "[ \t]")
15ffd5c2dc17 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95086
diff changeset
4128 "List of regexps of potentially bogus mail addresses.
15ffd5c2dc17 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95086
diff changeset
4129 See `message-check-recipients' how to setup checking.
15ffd5c2dc17 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95086
diff changeset
4130
15ffd5c2dc17 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95086
diff changeset
4131 This list should make it possible to catch typos or warn about
15ffd5c2dc17 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95086
diff changeset
4132 spam-trap addresses. It doesn't aim to verify strict RFC
15ffd5c2dc17 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95086
diff changeset
4133 conformance."
92336
5f827896103e Change defcustom :version from 23.0 to 23.1.
Glenn Morris <rgm@gnu.org>
parents: 92147
diff changeset
4134 :version "23.1" ;; No Gnus
85809
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
4135 :group 'message-headers
95451
15ffd5c2dc17 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95086
diff changeset
4136 :type '(choice
15ffd5c2dc17 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95086
diff changeset
4137 (const :tag "None" nil)
15ffd5c2dc17 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95086
diff changeset
4138 (list
15ffd5c2dc17 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95086
diff changeset
4139 (set :inline t
15ffd5c2dc17 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95086
diff changeset
4140 (const "noreply")
15ffd5c2dc17 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95086
diff changeset
4141 (const "nospam")
15ffd5c2dc17 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95086
diff changeset
4142 (const "invalid")
15ffd5c2dc17 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95086
diff changeset
4143 (const :tag "duplicate @" "@@")
15ffd5c2dc17 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95086
diff changeset
4144 (const :tag "non-ascii local part" "[^[:ascii:]].*@")
15ffd5c2dc17 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95086
diff changeset
4145 ;; Already caught by `message-valid-fqdn-regexp'
15ffd5c2dc17 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95086
diff changeset
4146 ;; (const :tag "`_' in domain part" "@.*_")
15ffd5c2dc17 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95086
diff changeset
4147 (const :tag "whitespace" "[ \t]"))
15ffd5c2dc17 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95086
diff changeset
4148 (repeat :inline t
15ffd5c2dc17 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95086
diff changeset
4149 :tag "Other"
15ffd5c2dc17 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95086
diff changeset
4150 (regexp)))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4151
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4152 (defun message-fix-before-sending ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4153 "Do various things to make the message nice before sending it."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4154 ;; Make sure there's a newline at the end of the message.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4155 (goto-char (point-max))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4156 (unless (bolp)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
4157 (insert "\n"))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4158 ;; Make the hidden headers visible.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4159 (widen)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4160 ;; Sort headers before sending the message.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4161 (message-sort-headers)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4162 ;; Make invisible text visible.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4163 ;; It doesn't seem as if this is useful, since the invisible property
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4164 ;; is clobbered by an after-change hook anyhow.
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4165 (message-check 'invisible-text
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4166 (let ((regions (message-text-with-property 'invisible))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4167 from to)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4168 (when regions
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4169 (while regions
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4170 (setq from (caar regions)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4171 to (cdar regions)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4172 regions (cdr regions))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4173 (put-text-property from to 'invisible nil)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4174 (message-overlay-put (message-make-overlay from to)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4175 'face 'highlight))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4176 (unless (yes-or-no-p
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4177 "Invisible text found and made visible; continue sending? ")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4178 (error "Invisible text found and made visible")))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4179 (message-check 'illegible-text
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4180 (let (char found choice)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4181 (message-goto-body)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4182 (while (progn
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4183 (skip-chars-forward mm-7bit-chars)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4184 (when (get-text-property (point) 'no-illegible-text)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4185 ;; There is a signed or encrypted raw message part
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4186 ;; that is considered to be safe.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4187 (goto-char (or (next-single-property-change
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4188 (point) 'no-illegible-text)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4189 (point-max))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4190 (setq char (char-after)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4191 (when (or (< (mm-char-int char) 128)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4192 (and (mm-multibyte-p)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4193 (memq (char-charset char)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4194 '(eight-bit-control eight-bit-graphic
100993
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
4195 ;; Emacs 23, Bug#1770:
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
4196 eight-bit
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4197 control-1))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4198 (not (get-text-property
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4199 (point) 'untranslated-utf-8))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4200 (message-overlay-put (message-make-overlay (point) (1+ (point)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4201 'face 'highlight)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4202 (setq found t))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4203 (forward-char))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4204 (when found
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4205 (setq choice
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4206 (gnus-multiple-choice
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4207 "Non-printable characters found. Continue sending?"
74021
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
4208 `((?d "Remove non-printable characters and send")
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
4209 (?r ,(format
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
4210 "Replace non-printable characters with \"%s\" and send"
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
4211 message-replacement-char))
111072
a7fee19797df message.el (message-fix-before-sending): Change options when sending non-printable characters.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 111030
diff changeset
4212 (?s "Send as is without removing anything")
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4213 (?e "Continue editing"))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4214 (if (eq choice ?e)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4215 (error "Non-printable characters"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4216 (message-goto-body)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4217 (skip-chars-forward mm-7bit-chars)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4218 (while (not (eobp))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4219 (when (let ((char (char-after)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4220 (or (< (mm-char-int char) 128)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4221 (and (mm-multibyte-p)
69135
12d289b6e5de Revision: emacs@sv.gnu.org/emacs--devo--0--patch-118
Miles Bader <miles@gnu.org>
parents: 68521
diff changeset
4222 ;; FIXME: Wrong for Emacs 23 (unicode) and for
100993
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
4223 ;; things like undecodable utf-8 (in Emacs 21?).
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
4224 ;; Should at least use find-coding-systems-region.
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
4225 ;; -- fx
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4226 (memq (char-charset char)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4227 '(eight-bit-control eight-bit-graphic
100993
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
4228 ;; Emacs 23, Bug#1770:
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
4229 eight-bit
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4230 control-1))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4231 (not (get-text-property
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4232 (point) 'untranslated-utf-8)))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4233 (if (eq choice ?i)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4234 (message-kill-all-overlays)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4235 (delete-char 1)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4236 (when (eq choice ?r)
74021
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
4237 (insert message-replacement-char))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4238 (forward-char)
85809
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
4239 (skip-chars-forward mm-7bit-chars)))))
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
4240 (message-check 'bogus-recipient
95086
241ad02f83c7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95028
diff changeset
4241 ;; Warn before sending a mail to an invalid address.
85809
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
4242 (message-check-recipients)))
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
4243
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
4244 (defun message-bogus-recipient-p (recipients)
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
4245 "Check if a mail address in RECIPIENTS looks bogus.
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
4246
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
4247 RECIPIENTS is a mail header. Return a list of potentially bogus
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
4248 addresses. If none is found, return nil.
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
4249
95451
15ffd5c2dc17 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95086
diff changeset
4250 An address might be bogus if the domain part is not fully
15ffd5c2dc17 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95086
diff changeset
4251 qualified, see `message-valid-fqdn-regexp', or if there's a
15ffd5c2dc17 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95086
diff changeset
4252 matching entry in `message-bogus-addresses'."
85809
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
4253 ;; FIXME: How about "foo@subdomain", when the MTA adds ".domain.tld"?
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
4254 (let (found)
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
4255 (mapc (lambda (address)
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
4256 (setq address (cadr address))
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
4257 (when
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
4258 (or (not
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
4259 (or
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
4260 (not (string-match "@" address))
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
4261 (string-match
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
4262 (concat ".@.*\\("
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
4263 message-valid-fqdn-regexp "\\)\\'") address)))
95451
15ffd5c2dc17 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95086
diff changeset
4264 (and message-bogus-addresses
15ffd5c2dc17 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95086
diff changeset
4265 (let ((re
15ffd5c2dc17 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95086
diff changeset
4266 (if (listp message-bogus-addresses)
15ffd5c2dc17 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95086
diff changeset
4267 (mapconcat 'identity
15ffd5c2dc17 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95086
diff changeset
4268 message-bogus-addresses
15ffd5c2dc17 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95086
diff changeset
4269 "\\|")
15ffd5c2dc17 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95086
diff changeset
4270 message-bogus-addresses)))
15ffd5c2dc17 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95086
diff changeset
4271 (string-match re address))))
15ffd5c2dc17 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95086
diff changeset
4272 (push address found)))
85809
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
4273 ;;
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
4274 (mail-extract-address-components recipients t))
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
4275 found))
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
4276
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
4277 (defun message-check-recipients ()
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
4278 "Warn before composing or sending a mail to an invalid address.
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
4279
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
4280 This function could be useful in `message-setup-hook'."
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
4281 (interactive)
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
4282 (save-restriction
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
4283 (message-narrow-to-headers)
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
4284 (dolist (hdr '("To" "Cc" "Bcc"))
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
4285 (let ((addr (message-fetch-field hdr)))
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
4286 (when (stringp addr)
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
4287 (dolist (bog (message-bogus-recipient-p addr))
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
4288 (and bog
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
4289 (not (y-or-n-p
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
4290 (format
a3af441f6431 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85766
diff changeset
4291 "Address `%s' might be bogus. Continue? " bog)))
105167
e14dfafc8256 * gnus-art.el (gnus-article-encrypt-body):
Juanma Barranquero <lekktu@gmail.com>
parents: 105078
diff changeset
4292 (error "Bogus address"))))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4293
95086
241ad02f83c7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95028
diff changeset
4294 (custom-add-option 'message-setup-hook 'message-check-recipients)
241ad02f83c7 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95028
diff changeset
4295
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4296 (defun message-add-action (action &rest types)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4297 "Add ACTION to be performed when doing an exit of type TYPES."
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4298 (while types
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4299 (add-to-list (intern (format "message-%s-actions" (pop types)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4300 action)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4301
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4302 (defun message-delete-action (action &rest types)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4303 "Delete ACTION from lists of actions performed when doing an exit of type TYPES."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4304 (let (var)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4305 (while types
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4306 (set (setq var (intern (format "message-%s-actions" (pop types))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4307 (delq action (symbol-value var))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4308
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4309 (defun message-do-actions (actions)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4310 "Perform all actions in ACTIONS."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4311 ;; Now perform actions on successful sending.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4312 (dolist (action actions)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4313 (ignore-errors
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4314 (cond
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4315 ;; A simple function.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4316 ((functionp action)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4317 (funcall action))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4318 ;; Something to be evaled.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4319 (t
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4320 (eval action))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4321
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4322 (defun message-send-mail-partially ()
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4323 "Send mail as message/partial."
32967
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
4324 ;; replace the header delimiter with a blank line
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
4325 (goto-char (point-min))
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
4326 (re-search-forward
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
4327 (concat "^" (regexp-quote mail-header-separator) "\n"))
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
4328 (replace-match "\n")
32967
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
4329 (run-hooks 'message-send-mail-hook)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4330 (let ((p (goto-char (point-min)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4331 (tembuf (message-generate-new-buffer-clone-locals " message temp"))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4332 (curbuf (current-buffer))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4333 (id (message-make-message-id)) (n 1)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4334 plist total header required-mail-headers)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4335 (while (not (eobp))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4336 (if (< (point-max) (+ p message-send-mail-partially-limit))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4337 (goto-char (point-max))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4338 (goto-char (+ p message-send-mail-partially-limit))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4339 (beginning-of-line)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4340 (if (<= (point) p) (forward-line 1))) ;; In case of bad message.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4341 (push p plist)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4342 (setq p (point)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4343 (setq total (length plist))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4344 (push (point-max) plist)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4345 (setq plist (nreverse plist))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4346 (unwind-protect
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4347 (save-excursion
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4348 (setq p (pop plist))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4349 (while plist
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4350 (set-buffer curbuf)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4351 (copy-to-buffer tembuf p (car plist))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4352 (set-buffer tembuf)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4353 (goto-char (point-min))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4354 (if header
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4355 (progn
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4356 (goto-char (point-min))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4357 (narrow-to-region (point) (point))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4358 (insert header))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4359 (message-goto-eoh)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4360 (setq header (buffer-substring (point-min) (point)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4361 (goto-char (point-min))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4362 (narrow-to-region (point) (point))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4363 (insert header)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4364 (message-remove-header "Mime-Version")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4365 (message-remove-header "Content-Type")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4366 (message-remove-header "Content-Transfer-Encoding")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4367 (message-remove-header "Message-ID")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4368 (message-remove-header "Lines")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4369 (goto-char (point-max))
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
4370 (insert "Mime-Version: 1.0\n")
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4371 (setq header (buffer-string)))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4372 (goto-char (point-max))
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
4373 (insert (format "Content-Type: message/partial; id=\"%s\"; number=%d; total=%d\n\n"
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
4374 id n total))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4375 (forward-char -1)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4376 (let ((mail-header-separator ""))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4377 (when (memq 'Message-ID message-required-mail-headers)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
4378 (insert "Message-ID: " (message-make-message-id) "\n"))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4379 (when (memq 'Lines message-required-mail-headers)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
4380 (insert "Lines: " (message-make-lines) "\n"))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4381 (message-goto-subject)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4382 (end-of-line)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4383 (insert (format " (%d/%d)" n total))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4384 (widen)
99777
b1be79c8e945 (message-send-mail): Just set the buffer to unibyte
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 98398
diff changeset
4385 (funcall (or message-send-mail-real-function
b1be79c8e945 (message-send-mail): Just set the buffer to unibyte
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 98398
diff changeset
4386 message-send-mail-function)))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4387 (setq n (+ n 1))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4388 (setq p (pop plist))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4389 (erase-buffer)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4390 (kill-buffer tembuf))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4391
107427
ecbe0edc4f69 Stop message.el from loading about 40 libraries it doesn't always need.
Glenn Morris <rgm@gnu.org>
parents: 107235
diff changeset
4392 (declare-function hashcash-wait-async "hashcash" (&optional buffer))
ecbe0edc4f69 Stop message.el from loading about 40 libraries it doesn't always need.
Glenn Morris <rgm@gnu.org>
parents: 107235
diff changeset
4393
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4394 (defun message-send-mail (&optional arg)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4395 (require 'mail-utils)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4396 (let* ((tembuf (message-generate-new-buffer-clone-locals " message temp"))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4397 (case-fold-search nil)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4398 (news (message-news-p))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4399 (mailbuf (current-buffer))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4400 (message-this-is-mail t)
107427
ecbe0edc4f69 Stop message.el from loading about 40 libraries it doesn't always need.
Glenn Morris <rgm@gnu.org>
parents: 107235
diff changeset
4401 ;; gnus-setup-posting-charset is autoloaded in mml.el (FIXME
ecbe0edc4f69 Stop message.el from loading about 40 libraries it doesn't always need.
Glenn Morris <rgm@gnu.org>
parents: 107235
diff changeset
4402 ;; maybe it should not be), which this file requires. Hence
ecbe0edc4f69 Stop message.el from loading about 40 libraries it doesn't always need.
Glenn Morris <rgm@gnu.org>
parents: 107235
diff changeset
4403 ;; the fboundp test is always true. Loading it from gnus-msg
ecbe0edc4f69 Stop message.el from loading about 40 libraries it doesn't always need.
Glenn Morris <rgm@gnu.org>
parents: 107235
diff changeset
4404 ;; loads many Gnus files (Bug#5642). If
ecbe0edc4f69 Stop message.el from loading about 40 libraries it doesn't always need.
Glenn Morris <rgm@gnu.org>
parents: 107235
diff changeset
4405 ;; gnus-group-posting-charset-alist hasn't been customized,
ecbe0edc4f69 Stop message.el from loading about 40 libraries it doesn't always need.
Glenn Morris <rgm@gnu.org>
parents: 107235
diff changeset
4406 ;; this is just going to return nil anyway. FIXME it would
ecbe0edc4f69 Stop message.el from loading about 40 libraries it doesn't always need.
Glenn Morris <rgm@gnu.org>
parents: 107235
diff changeset
4407 ;; be good to improve this further, because even if g-g-p-c-a
ecbe0edc4f69 Stop message.el from loading about 40 libraries it doesn't always need.
Glenn Morris <rgm@gnu.org>
parents: 107235
diff changeset
4408 ;; has been customized, that is likely to just be for news.
ecbe0edc4f69 Stop message.el from loading about 40 libraries it doesn't always need.
Glenn Morris <rgm@gnu.org>
parents: 107235
diff changeset
4409 ;; Eg either move the definition from gnus-msg, or separate out
ecbe0edc4f69 Stop message.el from loading about 40 libraries it doesn't always need.
Glenn Morris <rgm@gnu.org>
parents: 107235
diff changeset
4410 ;; the mail and news parts.
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4411 (message-posting-charset
107427
ecbe0edc4f69 Stop message.el from loading about 40 libraries it doesn't always need.
Glenn Morris <rgm@gnu.org>
parents: 107235
diff changeset
4412 (if (and (fboundp 'gnus-setup-posting-charset)
ecbe0edc4f69 Stop message.el from loading about 40 libraries it doesn't always need.
Glenn Morris <rgm@gnu.org>
parents: 107235
diff changeset
4413 (boundp 'gnus-group-posting-charset-alist))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4414 (gnus-setup-posting-charset nil)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4415 message-posting-charset))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4416 (headers message-required-mail-headers))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4417 (when (and message-generate-hashcash
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4418 (not (eq message-generate-hashcash 'opportunistic)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4419 (message "Generating hashcash...")
107427
ecbe0edc4f69 Stop message.el from loading about 40 libraries it doesn't always need.
Glenn Morris <rgm@gnu.org>
parents: 107235
diff changeset
4420 (require 'hashcash)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4421 ;; Wait for calculations already started to finish...
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4422 (hashcash-wait-async)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4423 ;; ...and do calculations not already done. mail-add-payment
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4424 ;; will leave existing X-Hashcash headers alone.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4425 (mail-add-payment)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4426 (message "Generating hashcash...done"))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4427 (save-restriction
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4428 (message-narrow-to-headers)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4429 ;; Generate the Mail-Followup-To header if the header is not there...
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4430 (if (and (message-subscribed-p)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4431 (not (mail-fetch-field "mail-followup-to")))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4432 (setq headers
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4433 (cons
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4434 (cons "Mail-Followup-To" (message-make-mail-followup-to))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4435 message-required-mail-headers))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4436 ;; otherwise, delete the MFT header if the field is empty
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4437 (when (equal "" (mail-fetch-field "mail-followup-to"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4438 (message-remove-header "^Mail-Followup-To:")))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4439 ;; Insert some headers.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4440 (let ((message-deletable-headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4441 (if news nil message-deletable-headers)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4442 (message-generate-headers headers))
71379
cb6e677b13d4 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70245
diff changeset
4443 ;; Check continuation headers.
cb6e677b13d4 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70245
diff changeset
4444 (message-check 'continuation-headers
cb6e677b13d4 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70245
diff changeset
4445 (goto-char (point-min))
cb6e677b13d4 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70245
diff changeset
4446 (while (re-search-forward "^[^ \t\n][^ \t\n:]*[ \t\n]" nil t)
cb6e677b13d4 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70245
diff changeset
4447 (goto-char (match-beginning 0))
cb6e677b13d4 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70245
diff changeset
4448 (if (y-or-n-p "Fix continuation lines? ")
cb6e677b13d4 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70245
diff changeset
4449 (insert " ")
cb6e677b13d4 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70245
diff changeset
4450 (forward-line 1)
cb6e677b13d4 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70245
diff changeset
4451 (unless (y-or-n-p "Send anyway? ")
cb6e677b13d4 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70245
diff changeset
4452 (error "Failed to send the message")))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4453 ;; Let the user do all of the above.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4454 (run-hooks 'message-header-hook))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4455 (unwind-protect
86339
6f4793ab0756 (message-send-mail-function): Fix error convention.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 86276
diff changeset
4456 (with-current-buffer tembuf
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4457 (erase-buffer)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4458 ;; Avoid copying text props (except hard newlines).
33748
2827e4066e08 * message.el (message-send-mail): Use buffer-substring-no-properties.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 33436
diff changeset
4459 (insert (with-current-buffer mailbuf
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4460 (mml-buffer-substring-no-properties-except-hard-newlines
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4461 (point-min) (point-max))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4462 ;; Remove some headers.
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4463 (message-encode-message-body)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4464 (save-restriction
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4465 (message-narrow-to-headers)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4466 ;; We (re)generate the Lines header.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4467 (when (memq 'Lines message-required-mail-headers)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4468 (message-generate-headers '(Lines)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4469 ;; Remove some headers.
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4470 (message-remove-header message-ignored-mail-headers t)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4471 (let ((mail-parse-charset message-default-charset))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4472 (mail-encode-encoded-word-buffer)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4473 (goto-char (point-max))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4474 ;; require one newline at the end.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4475 (or (= (preceding-char) ?\n)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
4476 (insert ?\n))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4477 (message-cleanup-headers)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4478 ;; FIXME: we're inserting the courtesy copy after encoding.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4479 ;; This is wrong if the courtesy copy string contains
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4480 ;; non-ASCII characters. -- jh
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
4481 (when
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4482 (save-restriction
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4483 (message-narrow-to-headers)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4484 (and news
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4485 (or (message-fetch-field "cc")
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4486 (message-fetch-field "bcc")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4487 (message-fetch-field "to"))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4488 (let ((content-type (message-fetch-field
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4489 "content-type")))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4490 (and
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4491 (or
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4492 (not content-type)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4493 (string= "text/plain"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4494 (car
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4495 (mail-header-parse-content-type
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4496 content-type))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4497 (not
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4498 (string= "base64"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4499 (message-fetch-field
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4500 "content-transfer-encoding")))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4501 (message-insert-courtesy-copy))
99777
b1be79c8e945 (message-send-mail): Just set the buffer to unibyte
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 98398
diff changeset
4502 ;; Let's make sure we encoded all the body.
b1be79c8e945 (message-send-mail): Just set the buffer to unibyte
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 98398
diff changeset
4503 (assert (save-excursion
b1be79c8e945 (message-send-mail): Just set the buffer to unibyte
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 98398
diff changeset
4504 (goto-char (point-min))
b1be79c8e945 (message-send-mail): Just set the buffer to unibyte
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 98398
diff changeset
4505 (not (re-search-forward "[^\000-\377]" nil t))))
b1be79c8e945 (message-send-mail): Just set the buffer to unibyte
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 98398
diff changeset
4506 (mm-disable-multibyte)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4507 (if (or (not message-send-mail-partially-limit)
56947
a1a3a7ab3bad (message-tokenize-header, message-send-mail-with-qmail):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 56927
diff changeset
4508 (< (buffer-size) message-send-mail-partially-limit)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4509 (not (message-y-or-n-p
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4510 "The message size is too large, split? "
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4511 t
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4512 "\
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4513 The message size, "
56947
a1a3a7ab3bad (message-tokenize-header, message-send-mail-with-qmail):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 56927
diff changeset
4514 (/ (buffer-size) 1000) "KB, is too large.
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4515
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4516 Some mail gateways (MTA's) bounce large messages. To avoid the
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4517 problem, answer `y', and the message will be split into several
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4518 smaller pieces, the size of each is about "
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4519 (/ message-send-mail-partially-limit 1000)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4520 "KB except the last
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4521 one.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4522
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4523 However, some mail readers (MUA's) can't read split messages, i.e.,
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4524 mails in message/partially format. Answer `n', and the message will be
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4525 sent in one piece.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4526
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4527 The size limit is controlled by `message-send-mail-partially-limit'.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4528 If you always want Gnus to send messages in one piece, set
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4529 `message-send-mail-partially-limit' to nil.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4530 ")))
99777
b1be79c8e945 (message-send-mail): Just set the buffer to unibyte
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 98398
diff changeset
4531 (progn
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4532 (message "Sending via mail...")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4533 (funcall (or message-send-mail-real-function
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4534 message-send-mail-function)))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4535 (message-send-mail-partially)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4536 (kill-buffer tembuf))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4537 (set-buffer mailbuf)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4538 (push 'mail message-sent-message-via)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4539
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4540 (defun message-send-mail-with-sendmail ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4541 "Send off the prepared buffer with sendmail."
107427
ecbe0edc4f69 Stop message.el from loading about 40 libraries it doesn't always need.
Glenn Morris <rgm@gnu.org>
parents: 107235
diff changeset
4542 (require 'sendmail)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4543 (let ((errbuf (if message-interactive
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4544 (message-generate-new-buffer-clone-locals
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4545 " sendmail errors")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4546 0))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4547 resend-to-addresses delimline)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4548 (unwind-protect
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4549 (progn
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4550 (let ((case-fold-search t))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4551 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4552 (message-narrow-to-headers)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4553 (setq resend-to-addresses (message-fetch-field "resent-to")))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4554 ;; Change header-delimiter to be what sendmail expects.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4555 (goto-char (point-min))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4556 (re-search-forward
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4557 (concat "^" (regexp-quote mail-header-separator) "\n"))
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
4558 (replace-match "\n")
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4559 (backward-char 1)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4560 (setq delimline (point-marker))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4561 (run-hooks 'message-send-mail-hook)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4562 ;; Insert an extra newline if we need it to work around
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4563 ;; Sun's bug that swallows newlines.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4564 (goto-char (1+ delimline))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4565 (when (eval message-mailer-swallows-blank-line)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4566 (newline))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4567 (when message-interactive
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4568 (with-current-buffer errbuf
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4569 (erase-buffer))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4570 (let* ((default-directory "/")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4571 (coding-system-for-write message-send-coding-system)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4572 (cpr (apply
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4573 'call-process-region
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4574 (append
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4575 (list (point-min) (point-max)
72636
cbdca6c6638d * message.el (message-send-mail-with-sendmail): Look for sendmail in
Chong Yidong <cyd@stupidchicken.com>
parents: 71398
diff changeset
4576 (cond ((boundp 'sendmail-program)
cbdca6c6638d * message.el (message-send-mail-with-sendmail): Look for sendmail in
Chong Yidong <cyd@stupidchicken.com>
parents: 71398
diff changeset
4577 sendmail-program)
cbdca6c6638d * message.el (message-send-mail-with-sendmail): Look for sendmail in
Chong Yidong <cyd@stupidchicken.com>
parents: 71398
diff changeset
4578 ((file-exists-p "/usr/sbin/sendmail")
cbdca6c6638d * message.el (message-send-mail-with-sendmail): Look for sendmail in
Chong Yidong <cyd@stupidchicken.com>
parents: 71398
diff changeset
4579 "/usr/sbin/sendmail")
cbdca6c6638d * message.el (message-send-mail-with-sendmail): Look for sendmail in
Chong Yidong <cyd@stupidchicken.com>
parents: 71398
diff changeset
4580 ((file-exists-p "/usr/lib/sendmail")
cbdca6c6638d * message.el (message-send-mail-with-sendmail): Look for sendmail in
Chong Yidong <cyd@stupidchicken.com>
parents: 71398
diff changeset
4581 "/usr/lib/sendmail")
cbdca6c6638d * message.el (message-send-mail-with-sendmail): Look for sendmail in
Chong Yidong <cyd@stupidchicken.com>
parents: 71398
diff changeset
4582 ((file-exists-p "/usr/ucblib/sendmail")
cbdca6c6638d * message.el (message-send-mail-with-sendmail): Look for sendmail in
Chong Yidong <cyd@stupidchicken.com>
parents: 71398
diff changeset
4583 "/usr/ucblib/sendmail")
cbdca6c6638d * message.el (message-send-mail-with-sendmail): Look for sendmail in
Chong Yidong <cyd@stupidchicken.com>
parents: 71398
diff changeset
4584 (t "fakemail"))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4585 nil errbuf nil "-oi")
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4586 message-sendmail-extra-arguments
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4587 ;; Always specify who from,
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4588 ;; since some systems have broken sendmails.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4589 ;; But some systems are more broken with -f, so
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4590 ;; we'll let users override this.
106118
8542a4738a96 * message.el (message-from-style, message-interactive)
Chong Yidong <cyd@stupidchicken.com>
parents: 105167
diff changeset
4591 (and (null message-sendmail-f-is-evil)
8542a4738a96 * message.el (message-from-style, message-interactive)
Chong Yidong <cyd@stupidchicken.com>
parents: 105167
diff changeset
4592 (list "-f" (message-sendmail-envelope-from)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4593 ;; These mean "report errors by mail"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4594 ;; and "deliver in background".
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4595 (if (null message-interactive) '("-oem" "-odb"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4596 ;; Get the addresses from the message
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4597 ;; unless this is a resend.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4598 ;; We must not do that for a resend
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4599 ;; because we would find the original addresses.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4600 ;; For a resend, include the specific addresses.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4601 (if resend-to-addresses
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4602 (list resend-to-addresses)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4603 '("-t"))))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4604 (unless (or (null cpr) (and (numberp cpr) (zerop cpr)))
96596
fe7840feb64b (message-send-mail-with-sendmail): Display the error message.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 96376
diff changeset
4605 (if errbuf (pop-to-buffer errbuf))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4606 (error "Sending...failed with exit value %d" cpr)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4607 (when message-interactive
86339
6f4793ab0756 (message-send-mail-function): Fix error convention.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 86276
diff changeset
4608 (with-current-buffer errbuf
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4609 (goto-char (point-min))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4610 (while (re-search-forward "\n+ *" nil t)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4611 (replace-match "; "))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4612 (if (not (zerop (buffer-size)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4613 (error "Sending...failed to %s"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4614 (buffer-string))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4615 (when (bufferp errbuf)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4616 (kill-buffer errbuf)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4617
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4618 (defun message-send-mail-with-qmail ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4619 "Pass the prepared message buffer to qmail-inject.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4620 Refer to the documentation for the variable `message-send-mail-function'
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4621 to find out how to use this."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4622 ;; replace the header delimiter with a blank line
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4623 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4624 (re-search-forward
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4625 (concat "^" (regexp-quote mail-header-separator) "\n"))
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
4626 (replace-match "\n")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4627 (run-hooks 'message-send-mail-hook)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4628 ;; send the message
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4629 (case
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4630 (let ((coding-system-for-write message-send-coding-system))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4631 (apply
56947
a1a3a7ab3bad (message-tokenize-header, message-send-mail-with-qmail):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 56927
diff changeset
4632 'call-process-region (point-min) (point-max)
a1a3a7ab3bad (message-tokenize-header, message-send-mail-with-qmail):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 56927
diff changeset
4633 message-qmail-inject-program nil nil nil
96376
c3309dba6542 American English spelling fix.
Glenn Morris <rgm@gnu.org>
parents: 95820
diff changeset
4634 ;; qmail-inject's default behavior is to look for addresses on the
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4635 ;; command line; if there're none, it scans the headers.
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4636 ;; yes, it does The Right Thing w.r.t. Resent-To and it's kin.
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4637 ;;
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4638 ;; in general, ALL of qmail-inject's defaults are perfect for simply
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4639 ;; reading a formatted (i. e., at least a To: or Resent-To header)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4640 ;; message from stdin.
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4641 ;;
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4642 ;; qmail also has the advantage of not having been raped by
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4643 ;; various vendors, so we don't have to allow for that, either --
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4644 ;; compare this with message-send-mail-with-sendmail and weep
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4645 ;; for sendmail's lost innocence.
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4646 ;;
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4647 ;; all this is way cool coz it lets us keep the arguments entirely
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4648 ;; free for -inject-arguments -- a big win for the user and for us
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4649 ;; since we don't have to play that double-guessing game and the user
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4650 ;; gets full control (no gestapo'ish -f's, for instance). --sj
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4651 (if (functionp message-qmail-inject-args)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4652 (funcall message-qmail-inject-args)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
4653 message-qmail-inject-args)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4654 ;; qmail-inject doesn't say anything on it's stdout/stderr,
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4655 ;; we have to look at the retval instead
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4656 (0 nil)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4657 (100 (error "qmail-inject reported permanent failure"))
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
4658 (111 (error "qmail-inject reported transient failure"))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4659 ;; should never happen
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
4660 (t (error "qmail-inject reported unknown failure"))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4661
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4662 (defun message-send-mail-with-mh ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4663 "Send the prepared message buffer with mh."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4664 (let ((mh-previous-window-config nil)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4665 (name (mh-new-draft-name)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4666 (setq buffer-file-name name)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4667 ;; MH wants to generate these headers itself.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4668 (when message-mh-deletable-headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4669 (let ((headers message-mh-deletable-headers))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4670 (while headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4671 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4672 (and (re-search-forward
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4673 (concat "^" (symbol-name (car headers)) ": *") nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4674 (message-delete-line))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4675 (pop headers))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4676 (run-hooks 'message-send-mail-hook)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4677 ;; Pass it on to mh.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4678 (mh-send-letter)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4679
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4680 (defun message-smtpmail-send-it ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4681 "Send the prepared message buffer with `smtpmail-send-it'.
107211
a41886cf3890 Doc fixes.
Glenn Morris <rgm@gnu.org>
parents: 107157
diff changeset
4682 The only difference from `smtpmail-send-it' is that this command
a41886cf3890 Doc fixes.
Glenn Morris <rgm@gnu.org>
parents: 107157
diff changeset
4683 evaluates `message-send-mail-hook' just before sending a message.
a41886cf3890 Doc fixes.
Glenn Morris <rgm@gnu.org>
parents: 107157
diff changeset
4684 It is useful if your ISP requires the POP-before-SMTP
a41886cf3890 Doc fixes.
Glenn Morris <rgm@gnu.org>
parents: 107157
diff changeset
4685 authentication. See the Gnus manual for details."
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4686 (run-hooks 'message-send-mail-hook)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4687 (smtpmail-send-it))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4688
86254
0d061e2dce73 (message-send-mail-function): New function.
Reiner Steib <Reiner.Steib@gmx.de>
parents: 86154
diff changeset
4689 (defun message-send-mail-with-mailclient ()
0d061e2dce73 (message-send-mail-function): New function.
Reiner Steib <Reiner.Steib@gmx.de>
parents: 86154
diff changeset
4690 "Send the prepared message buffer with `mailclient-send-it'.
107211
a41886cf3890 Doc fixes.
Glenn Morris <rgm@gnu.org>
parents: 107157
diff changeset
4691 The only difference from `mailclient-send-it' is that this
a41886cf3890 Doc fixes.
Glenn Morris <rgm@gnu.org>
parents: 107157
diff changeset
4692 command evaluates `message-send-mail-hook' just before sending a message."
86254
0d061e2dce73 (message-send-mail-function): New function.
Reiner Steib <Reiner.Steib@gmx.de>
parents: 86154
diff changeset
4693 (run-hooks 'message-send-mail-hook)
0d061e2dce73 (message-send-mail-function): New function.
Reiner Steib <Reiner.Steib@gmx.de>
parents: 86154
diff changeset
4694 (mailclient-send-it))
0d061e2dce73 (message-send-mail-function): New function.
Reiner Steib <Reiner.Steib@gmx.de>
parents: 86154
diff changeset
4695
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4696 (defun message-canlock-generate ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4697 "Return a string that is non-trivial to guess.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4698 Do not use this for anything important, it is cryptographically weak."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4699 (require 'sha1)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4700 (let (sha1-maximum-internal-length)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4701 (sha1 (concat (message-unique-id)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4702 (format "%x%x%x" (random) (random t) (random))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4703 (prin1-to-string (recent-keys))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4704 (prin1-to-string (garbage-collect))))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4705
107427
ecbe0edc4f69 Stop message.el from loading about 40 libraries it doesn't always need.
Glenn Morris <rgm@gnu.org>
parents: 107235
diff changeset
4706 (defvar canlock-password)
ecbe0edc4f69 Stop message.el from loading about 40 libraries it doesn't always need.
Glenn Morris <rgm@gnu.org>
parents: 107235
diff changeset
4707 (defvar canlock-password-for-verify)
ecbe0edc4f69 Stop message.el from loading about 40 libraries it doesn't always need.
Glenn Morris <rgm@gnu.org>
parents: 107235
diff changeset
4708
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4709 (defun message-canlock-password ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4710 "The password used by message for cancel locks.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4711 This is the value of `canlock-password', if that option is non-nil.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4712 Otherwise, generate and save a value for `canlock-password' first."
107427
ecbe0edc4f69 Stop message.el from loading about 40 libraries it doesn't always need.
Glenn Morris <rgm@gnu.org>
parents: 107235
diff changeset
4713 (require 'canlock)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4714 (unless canlock-password
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4715 (customize-save-variable 'canlock-password (message-canlock-generate))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4716 (setq canlock-password-for-verify canlock-password))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4717 canlock-password)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4718
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4719 (defun message-insert-canlock ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4720 (when message-insert-canlock
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4721 (message-canlock-password)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4722 (canlock-insert-header)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4723
107427
ecbe0edc4f69 Stop message.el from loading about 40 libraries it doesn't always need.
Glenn Morris <rgm@gnu.org>
parents: 107235
diff changeset
4724 (autoload 'nnheader-get-report "nnheader")
ecbe0edc4f69 Stop message.el from loading about 40 libraries it doesn't always need.
Glenn Morris <rgm@gnu.org>
parents: 107235
diff changeset
4725
ecbe0edc4f69 Stop message.el from loading about 40 libraries it doesn't always need.
Glenn Morris <rgm@gnu.org>
parents: 107235
diff changeset
4726 (declare-function gnus-setup-posting-charset "gnus-msg" (group))
ecbe0edc4f69 Stop message.el from loading about 40 libraries it doesn't always need.
Glenn Morris <rgm@gnu.org>
parents: 107235
diff changeset
4727
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4728 (defun message-send-news (&optional arg)
107427
ecbe0edc4f69 Stop message.el from loading about 40 libraries it doesn't always need.
Glenn Morris <rgm@gnu.org>
parents: 107235
diff changeset
4729 (require 'gnus-msg)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4730 (let* ((tembuf (message-generate-new-buffer-clone-locals " *message temp*"))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4731 (case-fold-search nil)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4732 (method (if (functionp message-post-method)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4733 (funcall message-post-method arg)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4734 message-post-method))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4735 (newsgroups-field (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4736 (message-narrow-to-headers-or-head)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4737 (message-fetch-field "Newsgroups")))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4738 (followup-field (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4739 (message-narrow-to-headers-or-head)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4740 (message-fetch-field "Followup-To")))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4741 ;; BUG: We really need to get the charset for each name in the
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4742 ;; Newsgroups and Followup-To lines to allow crossposting
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4743 ;; between group namess with incompatible character sets.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4744 ;; -- Per Abrahamsen <abraham@dina.kvl.dk> 2001-10-08.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4745 (group-field-charset
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4746 (gnus-group-name-charset method newsgroups-field))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4747 (followup-field-charset
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4748 (gnus-group-name-charset method (or followup-field "")))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4749 (rfc2047-header-encoding-alist
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4750 (append (when group-field-charset
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4751 (list (cons "Newsgroups" group-field-charset)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4752 (when followup-field-charset
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4753 (list (cons "Followup-To" followup-field-charset)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4754 rfc2047-header-encoding-alist))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4755 (messbuf (current-buffer))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4756 (message-syntax-checks
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4757 (if (and arg
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4758 (listp message-syntax-checks))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4759 (cons '(existing-newsgroups . disabled)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4760 message-syntax-checks)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4761 message-syntax-checks))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4762 (message-this-is-news t)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4763 (message-posting-charset
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4764 (gnus-setup-posting-charset newsgroups-field))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4765 result)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4766 (if (not (message-check-news-body-syntax))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4767 nil
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4768 (save-restriction
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4769 (message-narrow-to-headers)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4770 ;; Insert some headers.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4771 (message-generate-headers message-required-news-headers)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4772 (message-insert-canlock)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4773 ;; Let the user do all of the above.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4774 (run-hooks 'message-header-hook))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4775 ;; Note: This check will be disabled by the ".*" default value for
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4776 ;; gnus-group-name-charset-group-alist. -- Pa 2001-10-07.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4777 (when (and group-field-charset
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4778 (listp message-syntax-checks))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4779 (setq message-syntax-checks
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4780 (cons '(valid-newsgroups . disabled)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4781 message-syntax-checks)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4782 (message-cleanup-headers)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4783 (if (not (let ((message-post-method method))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4784 (message-check-news-syntax)))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4785 nil
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4786 (unwind-protect
86339
6f4793ab0756 (message-send-mail-function): Fix error convention.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 86276
diff changeset
4787 (with-current-buffer tembuf
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4788 (buffer-disable-undo)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4789 (erase-buffer)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4790 ;; Avoid copying text props (except hard newlines).
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4791 (insert
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4792 (with-current-buffer messbuf
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4793 (mml-buffer-substring-no-properties-except-hard-newlines
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4794 (point-min) (point-max))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4795 (message-encode-message-body)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4796 ;; Remove some headers.
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4797 (save-restriction
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4798 (message-narrow-to-headers)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4799 ;; We (re)generate the Lines header.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4800 (when (memq 'Lines message-required-mail-headers)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4801 (message-generate-headers '(Lines)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4802 ;; Remove some headers.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4803 (message-remove-header message-ignored-news-headers t)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4804 (let ((mail-parse-charset message-default-charset))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4805 (mail-encode-encoded-word-buffer)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4806 (goto-char (point-max))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4807 ;; require one newline at the end.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4808 (or (= (preceding-char) ?\n)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
4809 (insert ?\n))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4810 (let ((case-fold-search t))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4811 ;; Remove the delimiter.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4812 (goto-char (point-min))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4813 (re-search-forward
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4814 (concat "^" (regexp-quote mail-header-separator) "\n"))
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
4815 (replace-match "\n")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4816 (backward-char 1))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4817 (run-hooks 'message-send-news-hook)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4818 (gnus-open-server method)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4819 (message "Sending news via %s..." (gnus-server-string method))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4820 (setq result (let ((mail-header-separator ""))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4821 (gnus-request-post method))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4822 (kill-buffer tembuf))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4823 (set-buffer messbuf)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4824 (if result
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4825 (push 'news message-sent-message-via)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4826 (message "Couldn't send message via news: %s"
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4827 (nnheader-get-report (car method)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4828 nil)))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4829
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4830 ;;;
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4831 ;;; Header generation & syntax checking.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4832 ;;;
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4833
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4834 (defun message-check-element (type)
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
4835 "Return non-nil if this TYPE is not to be checked."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4836 (if (eq message-syntax-checks 'dont-check-for-anything-just-trust-me)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4837 t
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4838 (let ((able (assq type message-syntax-checks)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4839 (and (consp able)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4840 (eq (cdr able) 'disabled)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4841
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4842 (defun message-check-news-syntax ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4843 "Check the syntax of the message."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4844 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4845 (save-restriction
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4846 (widen)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4847 ;; We narrow to the headers and check them first.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4848 (save-excursion
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4849 (save-restriction
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4850 (message-narrow-to-headers)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4851 (message-check-news-header-syntax))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4852
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4853 (defun message-check-news-header-syntax ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4854 (and
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4855 ;; Check Newsgroups header.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4856 (message-check 'newsgroups
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4857 (let ((group (message-fetch-field "newsgroups")))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4858 (or
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4859 (and group
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4860 (not (string-match "\\`[ \t]*\\'" group)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4861 (ignore
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4862 (message
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4863 "The newsgroups field is empty or missing. Posting is denied.")))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4864 ;; Check the Subject header.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4865 (message-check 'subject
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4866 (let* ((case-fold-search t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4867 (subject (message-fetch-field "subject")))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4868 (or
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4869 (and subject
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4870 (not (string-match "\\`[ \t]*\\'" subject)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4871 (ignore
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4872 (message
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4873 "The subject field is empty or missing. Posting is denied.")))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4874 ;; Check for commands in Subject.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4875 (message-check 'subject-cmsg
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4876 (if (string-match "^cmsg " (message-fetch-field "subject"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4877 (y-or-n-p
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4878 "The control code \"cmsg\" is in the subject. Really post? ")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4879 t))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4880 ;; Check long header lines.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4881 (message-check 'long-header-lines
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4882 (let ((start (point))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4883 (header nil)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4884 (length 0)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4885 found)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4886 (while (and (not found)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4887 (re-search-forward "^\\([^ \t:]+\\): " nil t))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4888 (if (> (- (point) (match-beginning 0)) 998)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4889 (setq found t
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4890 length (- (point) (match-beginning 0)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4891 (setq header (match-string-no-properties 1)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4892 (setq start (match-beginning 0))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4893 (forward-line 1))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4894 (if found
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4895 (y-or-n-p (format "Your %s header is too long (%d). Really post? "
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4896 header length))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4897 t)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4898 ;; Check for multiple identical headers.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4899 (message-check 'multiple-headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4900 (let (found)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4901 (while (and (not found)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4902 (re-search-forward "^[^ \t:]+: " nil t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4903 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4904 (or (re-search-forward
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4905 (concat "^"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4906 (regexp-quote
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4907 (setq found
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4908 (buffer-substring
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4909 (match-beginning 0) (- (match-end 0) 2))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4910 ":")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4911 nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4912 (setq found nil))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4913 (if found
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4914 (y-or-n-p (format "Multiple %s headers. Really post? " found))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4915 t)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4916 ;; Check for Version and Sendsys.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4917 (message-check 'sendsys
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4918 (if (re-search-forward "^Sendsys:\\|^Version:" nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4919 (y-or-n-p
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4920 (format "The article contains a %s command. Really post? "
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4921 (buffer-substring (match-beginning 0)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4922 (1- (match-end 0)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4923 t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4924 ;; See whether we can shorten Followup-To.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4925 (message-check 'shorten-followup-to
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4926 (let ((newsgroups (message-fetch-field "newsgroups"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4927 (followup-to (message-fetch-field "followup-to"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4928 to)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4929 (when (and newsgroups
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4930 (string-match "," newsgroups)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4931 (not followup-to)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4932 (not
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4933 (zerop
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4934 (length
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4935 (setq to (completing-read
65682
c16795de963a 2005-09-24 Emilio C. Lopes <eclig@gmx.net>
Romain Francoise <romain@orebokech.com>
parents: 65342
diff changeset
4936 "Followups to (default no Followup-To header): "
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4937 (mapcar #'list
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4938 (cons "poster"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4939 (message-tokenize-header
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4940 newsgroups)))))))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4941 (goto-char (point-min))
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
4942 (insert "Followup-To: " to "\n"))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4943 t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4944 ;; Check "Shoot me".
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4945 (message-check 'shoot
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4946 (if (re-search-forward
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4947 "Message-ID.*.i-did-not-set--mail-host-address--so-tickle-me" nil t)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4948 (y-or-n-p "You appear to have a misconfigured system. Really post? ")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4949 t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4950 ;; Check for Approved.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4951 (message-check 'approved
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4952 (if (re-search-forward "^Approved:" nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4953 (y-or-n-p "The article contains an Approved header. Really post? ")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4954 t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4955 ;; Check the Message-ID header.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4956 (message-check 'message-id
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4957 (let* ((case-fold-search t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4958 (message-id (message-fetch-field "message-id" t)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4959 (or (not message-id)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4960 ;; Is there an @ in the ID?
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4961 (and (string-match "@" message-id)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4962 ;; Is there a dot in the ID?
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4963 (string-match "@[^.]*\\." message-id)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4964 ;; Does the ID end with a dot?
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4965 (not (string-match "\\.>" message-id)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4966 (y-or-n-p
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4967 (format "The Message-ID looks strange: \"%s\". Really post? "
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4968 message-id)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4969 ;; Check the Newsgroups & Followup-To headers.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4970 (message-check 'existing-newsgroups
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4971 (let* ((case-fold-search t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4972 (newsgroups (message-fetch-field "newsgroups"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4973 (followup-to (message-fetch-field "followup-to"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4974 (groups (message-tokenize-header
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4975 (if followup-to
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4976 (concat newsgroups "," followup-to)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4977 newsgroups)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4978 (post-method (if (functionp message-post-method)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4979 (funcall message-post-method)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4980 message-post-method))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4981 ;; KLUDGE to handle nnvirtual groups. Doing this right
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4982 ;; would probably involve a new nnoo function.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4983 ;; -- Per Abrahamsen <abraham@dina.kvl.dk>, 2001-10-17.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4984 (method (if (and (consp post-method)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4985 (eq (car post-method) 'nnvirtual)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4986 gnus-message-group-art)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4987 (let ((group (car (nnvirtual-find-group-art
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4988 (car gnus-message-group-art)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4989 (cdr gnus-message-group-art)))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4990 (gnus-find-method-for-group group))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4991 post-method))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4992 (known-groups
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4993 (mapcar (lambda (n)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4994 (gnus-group-name-decode
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4995 (gnus-group-real-name n)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4996 (gnus-group-name-charset method n)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4997 (gnus-groups-from-server method)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4998 errors)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4999 (while groups
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5000 (when (and (not (equal (car groups) "poster"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5001 (not (member (car groups) known-groups))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5002 (not (member (car groups) errors)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5003 (push (car groups) errors))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5004 (pop groups))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5005 (cond
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5006 ;; Gnus is not running.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5007 ((or (not (and (boundp 'gnus-active-hashtb)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5008 gnus-active-hashtb))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5009 (not (boundp 'gnus-read-active-file)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5010 t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5011 ;; We don't have all the group names.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5012 ((and (or (not gnus-read-active-file)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5013 (eq gnus-read-active-file 'some))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5014 errors)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5015 (y-or-n-p
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5016 (format
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5017 "Really use %s possibly unknown group%s: %s? "
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5018 (if (= (length errors) 1) "this" "these")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5019 (if (= (length errors) 1) "" "s")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5020 (mapconcat 'identity errors ", "))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5021 ;; There were no errors.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5022 ((not errors)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5023 t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5024 ;; There are unknown groups.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5025 (t
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5026 (y-or-n-p
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5027 (format
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5028 "Really post to %s unknown group%s: %s? "
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5029 (if (= (length errors) 1) "this" "these")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5030 (if (= (length errors) 1) "" "s")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5031 (mapconcat 'identity errors ", ")))))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5032 ;; Check continuation headers.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5033 (message-check 'continuation-headers
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5034 (goto-char (point-min))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5035 (let ((do-posting t))
71379
cb6e677b13d4 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70245
diff changeset
5036 (while (re-search-forward "^[^ \t\n][^ \t\n:]*[ \t\n]" nil t)
cb6e677b13d4 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70245
diff changeset
5037 (goto-char (match-beginning 0))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5038 (if (y-or-n-p "Fix continuation lines? ")
71379
cb6e677b13d4 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70245
diff changeset
5039 (insert " ")
cb6e677b13d4 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70245
diff changeset
5040 (forward-line 1)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5041 (unless (y-or-n-p "Send anyway? ")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5042 (setq do-posting nil))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5043 do-posting))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5044 ;; Check the Newsgroups & Followup-To headers for syntax errors.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5045 (message-check 'valid-newsgroups
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5046 (let ((case-fold-search t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5047 (headers '("Newsgroups" "Followup-To"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5048 header error)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5049 (while (and headers (not error))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5050 (when (setq header (mail-fetch-field (car headers)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5051 (if (or
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5052 (not
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5053 (string-match
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5054 "\\`\\([-+_&.a-zA-Z0-9]+\\)?\\(,[-+_&.a-zA-Z0-9]+\\)*\\'"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5055 header))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5056 (memq
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5057 nil (mapcar
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5058 (lambda (g)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5059 (not (string-match "\\.\\'\\|\\.\\." g)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5060 (message-tokenize-header header ","))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5061 (setq error t)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5062 (unless error
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5063 (pop headers)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5064 (if (not error)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5065 t
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5066 (y-or-n-p
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5067 (format "The %s header looks odd: \"%s\". Really post? "
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5068 (car headers) header)))))
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
5069 (message-check 'repeated-newsgroups
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
5070 (let ((case-fold-search t)
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
5071 (headers '("Newsgroups" "Followup-To"))
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
5072 header error groups group)
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
5073 (while (and headers
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
5074 (not error))
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
5075 (when (setq header (mail-fetch-field (pop headers)))
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
5076 (setq groups (message-tokenize-header header ","))
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
5077 (while (setq group (pop groups))
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
5078 (when (member group groups)
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
5079 (setq error group
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
5080 groups nil)))))
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
5081 (if (not error)
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
5082 t
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
5083 (y-or-n-p
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
5084 (format "Group %s is repeated in headers. Really post? " error)))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5085 ;; Check the From header.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5086 (message-check 'from
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5087 (let* ((case-fold-search t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5088 (from (message-fetch-field "from"))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5089 ad)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5090 (cond
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5091 ((not from)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5092 (message "There is no From line. Posting is denied.")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5093 nil)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5094 ((or (not (string-match
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5095 "@[^\\.]*\\."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5096 (setq ad (nth 1 (mail-extract-address-components
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5097 from))))) ;larsi@ifi
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5098 (string-match "\\.\\." ad) ;larsi@ifi..uio
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5099 (string-match "@\\." ad) ;larsi@.ifi.uio
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5100 (string-match "\\.$" ad) ;larsi@ifi.uio.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5101 (not (string-match "^[^@]+@[^@]+$" ad)) ;larsi.ifi.uio
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5102 (string-match "(.*).*(.*)" from)) ;(lars) (lars)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5103 (message
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5104 "Denied posting -- the From looks strange: \"%s\"." from)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5105 nil)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5106 ((let ((addresses (rfc822-addresses from)))
106746
e09f67191b6c Merge from mainline.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 106715
diff changeset
5107 ;; `rfc822-addresses' returns a string if parsing fails.
e09f67191b6c Merge from mainline.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 106715
diff changeset
5108 (while (and (consp addresses)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5109 (not (eq (string-to-char (car addresses)) ?\()))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5110 (setq addresses (cdr addresses)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5111 addresses)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5112 (message
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5113 "Denied posting -- bad From address: \"%s\"." from)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5114 nil)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5115 (t t))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5116 ;; Check the Reply-To header.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5117 (message-check 'reply-to
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5118 (let* ((case-fold-search t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5119 (reply-to (message-fetch-field "reply-to"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5120 ad)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5121 (cond
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5122 ((not reply-to)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5123 t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5124 ((string-match "," reply-to)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5125 (y-or-n-p
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5126 (format "Multiple Reply-To addresses: \"%s\". Really post? "
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5127 reply-to)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5128 ((or (not (string-match
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5129 "@[^\\.]*\\."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5130 (setq ad (nth 1 (mail-extract-address-components
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5131 reply-to))))) ;larsi@ifi
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5132 (string-match "\\.\\." ad) ;larsi@ifi..uio
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5133 (string-match "@\\." ad) ;larsi@.ifi.uio
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5134 (string-match "\\.$" ad) ;larsi@ifi.uio.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5135 (not (string-match "^[^@]+@[^@]+$" ad)) ;larsi.ifi.uio
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5136 (string-match "(.*).*(.*)" reply-to)) ;(lars) (lars)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5137 (y-or-n-p
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5138 (format
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5139 "The Reply-To looks strange: \"%s\". Really post? "
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5140 reply-to)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5141 (t t))))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5142
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5143 (defun message-check-news-body-syntax ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5144 (and
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5145 ;; Check for long lines.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5146 (message-check 'long-lines
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5147 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5148 (re-search-forward
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5149 (concat "^" (regexp-quote mail-header-separator) "$"))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5150 (forward-line 1)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5151 (while (and
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5152 (or (looking-at
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5153 "<#\\(/\\)?\\(multipart\\|part\\|external\\|mml\\)")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5154 (let ((p (point)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5155 (end-of-line)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5156 (< (- (point) p) 80)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5157 (zerop (forward-line 1))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5158 (or (bolp)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5159 (eobp)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5160 (y-or-n-p
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5161 "You have lines longer than 79 characters. Really post? ")))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5162 ;; Check whether the article is empty.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5163 (message-check 'empty
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5164 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5165 (re-search-forward
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5166 (concat "^" (regexp-quote mail-header-separator) "$"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5167 (forward-line 1)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5168 (let ((b (point)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5169 (goto-char (point-max))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5170 (re-search-backward message-signature-separator nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5171 (beginning-of-line)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5172 (or (re-search-backward "[^ \n\t]" b t)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5173 (if (message-gnksa-enable-p 'empty-article)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5174 (y-or-n-p "Empty article. Really post? ")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5175 (message "Denied posting -- Empty article.")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5176 nil))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5177 ;; Check for control characters.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5178 (message-check 'control-chars
57321
3381cb76bac3 * gnus-group.el (gnus-update-group-mark-positions):
Juri Linkov <juri@jurta.org>
parents: 57243
diff changeset
5179 (if (re-search-forward
85766
68503cda7180 (message-check-news-body-syntax): Avoid mm-string-as-multibyte.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85712
diff changeset
5180 (mm-string-to-multibyte "[\000-\007\013\015-\032\034-\037\200-\237]")
57321
3381cb76bac3 * gnus-group.el (gnus-update-group-mark-positions):
Juri Linkov <juri@jurta.org>
parents: 57243
diff changeset
5181 nil t)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5182 (y-or-n-p
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5183 "The article contains control characters. Really post? ")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5184 t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5185 ;; Check excessive size.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5186 (message-check 'size
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5187 (if (> (buffer-size) 60000)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5188 (y-or-n-p
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5189 (format "The article is %d octets long. Really post? "
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5190 (buffer-size)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5191 t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5192 ;; Check whether any new text has been added.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5193 (message-check 'new-text
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5194 (or
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5195 (not message-checksum)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5196 (not (eq (message-checksum) message-checksum))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5197 (if (message-gnksa-enable-p 'quoted-text-only)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5198 (y-or-n-p
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5199 "It looks like no new text has been added. Really post? ")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5200 (message "Denied posting -- no new text has been added.")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5201 nil)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5202 ;; Check the length of the signature.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5203 (message-check 'signature
100993
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
5204 (let (sig-start sig-end)
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
5205 (goto-char (point-max))
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
5206 (if (not (re-search-backward message-signature-separator nil t))
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
5207 t
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
5208 (setq sig-start (1+ (point-at-eol)))
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
5209 (setq sig-end
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
5210 (if (re-search-forward
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
5211 "<#/?\\(multipart\\|part\\|external\\|mml\\)" nil t)
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
5212 (- (point-at-bol) 1)
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
5213 (point-max)))
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
5214 (if (>= (count-lines sig-start sig-end) 5)
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
5215 (if (message-gnksa-enable-p 'signature)
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
5216 (y-or-n-p
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
5217 (format "Signature is excessively long (%d lines). Really post? "
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
5218 (count-lines sig-start sig-end)))
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
5219 (message "Denied posting -- Excessive signature.")
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
5220 nil)
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
5221 t))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5222 ;; Ensure that text follows last quoted portion.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5223 (message-check 'quoting-style
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5224 (goto-char (point-max))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5225 (let ((no-problem t))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5226 (when (search-backward-regexp "^>[^\n]*\n" nil t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5227 (setq no-problem (search-forward-regexp "^[ \t]*[^>\n]" nil t)))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5228 (if no-problem
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5229 t
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5230 (if (message-gnksa-enable-p 'quoted-text-only)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5231 (y-or-n-p "Your text should follow quoted text. Really post? ")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5232 ;; Ensure that
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5233 (goto-char (point-min))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5234 (re-search-forward
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5235 (concat "^" (regexp-quote mail-header-separator) "$"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5236 (if (search-forward-regexp "^[ \t]*[^>\n]" nil t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5237 (y-or-n-p "Your text should follow quoted text. Really post? ")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5238 (message "Denied posting -- only quoted text.")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5239 nil)))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5240
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5241 (defun message-checksum ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5242 "Return a \"checksum\" for the current buffer."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5243 (let ((sum 0))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5244 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5245 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5246 (re-search-forward
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5247 (concat "^" (regexp-quote mail-header-separator) "$"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5248 (while (not (eobp))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5249 (when (not (looking-at "[ \t\n]"))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5250 (setq sum (logxor (ash sum 1) (if (natnump sum) 0 1)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5251 (char-after))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5252 (forward-char 1)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5253 sum))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5254
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5255 (defun message-do-fcc ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5256 "Process Fcc headers in the current buffer."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5257 (let ((case-fold-search t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5258 (buf (current-buffer))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5259 list file
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5260 (mml-externalize-attachments message-fcc-externalize-attachments))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5261 (save-excursion
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5262 (save-restriction
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5263 (message-narrow-to-headers)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5264 (setq file (message-fetch-field "fcc" t)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5265 (when file
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5266 (set-buffer (get-buffer-create " *message temp*"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5267 (erase-buffer)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5268 (insert-buffer-substring buf)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5269 (message-encode-message-body)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5270 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5271 (message-narrow-to-headers)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5272 (while (setq file (message-fetch-field "fcc" t))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5273 (push file list)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5274 (message-remove-header "fcc" nil t))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5275 (let ((mail-parse-charset message-default-charset)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5276 (rfc2047-header-encoding-alist
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5277 (cons '("Newsgroups" . default)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5278 rfc2047-header-encoding-alist)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5279 (mail-encode-encoded-word-buffer)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5280 (goto-char (point-min))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5281 (when (re-search-forward
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5282 (concat "^" (regexp-quote mail-header-separator) "$")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5283 nil t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5284 (replace-match "" t t ))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5285 ;; Process FCC operations.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5286 (while list
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5287 (setq file (pop list))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5288 (if (string-match "^[ \t]*|[ \t]*\\(.*\\)[ \t]*$" file)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5289 ;; Pipe the article to the program in question.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5290 (call-process-region (point-min) (point-max) shell-file-name
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5291 nil nil nil shell-command-switch
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5292 (match-string 1 file))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5293 ;; Save the article.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5294 (setq file (expand-file-name file))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5295 (unless (file-exists-p (file-name-directory file))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5296 (make-directory (file-name-directory file) t))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5297 (if (and message-fcc-handler-function
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5298 (not (eq message-fcc-handler-function 'rmail-output)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5299 (funcall message-fcc-handler-function file)
102061
cd6c733e7e27 Comment.
Glenn Morris <rgm@gnu.org>
parents: 101896
diff changeset
5300 ;; FIXME this option, rmail-output (also used if
cd6c733e7e27 Comment.
Glenn Morris <rgm@gnu.org>
parents: 101896
diff changeset
5301 ;; message-fcc-handler-function is nil) is not
cd6c733e7e27 Comment.
Glenn Morris <rgm@gnu.org>
parents: 101896
diff changeset
5302 ;; documented anywhere AFAICS. It should work in Emacs
cd6c733e7e27 Comment.
Glenn Morris <rgm@gnu.org>
parents: 101896
diff changeset
5303 ;; 23; I suspect it does not work in Emacs 22.
cd6c733e7e27 Comment.
Glenn Morris <rgm@gnu.org>
parents: 101896
diff changeset
5304 ;; FIXME I don't see the need for the two different cases here.
cd6c733e7e27 Comment.
Glenn Morris <rgm@gnu.org>
parents: 101896
diff changeset
5305 ;; mail-use-rfc822 makes no difference (in Emacs 23),and
cd6c733e7e27 Comment.
Glenn Morris <rgm@gnu.org>
parents: 101896
diff changeset
5306 ;; the third argument just controls \"Wrote file\" message.
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5307 (if (and (file-readable-p file) (mail-file-babyl-p file))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5308 (rmail-output file 1 nil t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5309 (let ((mail-use-rfc822 t))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5310 (rmail-output file 1 t t))))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5311 (kill-buffer (current-buffer))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5312
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5313 (defun message-output (filename)
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
5314 "Append this article to Unix/babyl mail file FILENAME."
110528
a4f29934ad86 Fix message-mode bug with fcc to Rmail buffers.
Glenn Morris <rgm@gnu.org>
parents: 108343
diff changeset
5315 (if (or (and (file-readable-p filename)
a4f29934ad86 Fix message-mode bug with fcc to Rmail buffers.
Glenn Morris <rgm@gnu.org>
parents: 108343
diff changeset
5316 (mail-file-babyl-p filename))
a4f29934ad86 Fix message-mode bug with fcc to Rmail buffers.
Glenn Morris <rgm@gnu.org>
parents: 108343
diff changeset
5317 ;; gnus-output-to-mail does the wrong thing with live, mbox
a4f29934ad86 Fix message-mode bug with fcc to Rmail buffers.
Glenn Morris <rgm@gnu.org>
parents: 108343
diff changeset
5318 ;; Rmail buffers in Emacs 23.
a4f29934ad86 Fix message-mode bug with fcc to Rmail buffers.
Glenn Morris <rgm@gnu.org>
parents: 108343
diff changeset
5319 ;; http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=597255
a4f29934ad86 Fix message-mode bug with fcc to Rmail buffers.
Glenn Morris <rgm@gnu.org>
parents: 108343
diff changeset
5320 (let ((buff (find-buffer-visiting filename)))
a4f29934ad86 Fix message-mode bug with fcc to Rmail buffers.
Glenn Morris <rgm@gnu.org>
parents: 108343
diff changeset
5321 (and buff (with-current-buffer buff
a4f29934ad86 Fix message-mode bug with fcc to Rmail buffers.
Glenn Morris <rgm@gnu.org>
parents: 108343
diff changeset
5322 (eq major-mode 'rmail-mode)))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5323 (gnus-output-to-rmail filename t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5324 (gnus-output-to-mail filename t)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5325
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5326 (defun message-cleanup-headers ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5327 "Do various automatic cleanups of the headers."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5328 ;; Remove empty lines in the header.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5329 (save-restriction
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5330 (message-narrow-to-headers)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5331 ;; Remove blank lines.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5332 (while (re-search-forward "^[ \t]*\n" nil t)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5333 (replace-match "" t t))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5334
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5335 ;; Correct Newsgroups and Followup-To headers: Change sequence of
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5336 ;; spaces to comma and eliminate spaces around commas. Eliminate
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5337 ;; embedded line breaks.
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5338 (goto-char (point-min))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5339 (while (re-search-forward "^\\(Newsgroups\\|Followup-To\\): +" nil t)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5340 (save-restriction
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5341 (narrow-to-region
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5342 (point)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5343 (if (re-search-forward "^[^ \t]" nil t)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5344 (match-beginning 0)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5345 (forward-line 1)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5346 (point)))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5347 (goto-char (point-min))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5348 (while (re-search-forward "\n[ \t]+" nil t)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5349 (replace-match " " t t)) ;No line breaks (too confusing)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5350 (goto-char (point-min))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5351 (while (re-search-forward "[ \t\n]*,[ \t\n]*\\|[ \t]+" nil t)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5352 (replace-match "," t t))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5353 (goto-char (point-min))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5354 ;; Remove trailing commas.
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5355 (when (re-search-forward ",+$" nil t)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5356 (replace-match "" t t))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5357
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5358 (defun message-make-date (&optional now)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5359 "Make a valid data header.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5360 If NOW, use that time instead."
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5361 (let ((system-time-locale "C"))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5362 (format-time-string "%a, %d %b %Y %T %z" now)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5363
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5364 (defun message-insert-expires (days)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5365 "Insert the Expires header. Expiry in DAYS days."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5366 (interactive "NExpire article in how many days? ")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5367 (save-excursion
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5368 (message-position-on-field "Expires" "X-Draft-From")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5369 (insert (message-make-expires-date days))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5370
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5371 (defun message-make-expires-date (days)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5372 "Make date string for the Expires header. Expiry in DAYS days.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5373
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5374 In posting styles use `(\"Expires\" (make-expires-date 30))'."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5375 (let* ((cur (decode-time (current-time)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5376 (nday (+ days (nth 3 cur))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5377 (setf (nth 3 cur) nday)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5378 (message-make-date (apply 'encode-time cur))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5379
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5380 (defun message-make-message-id ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5381 "Make a unique Message-ID."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5382 (concat "<" (message-unique-id)
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
5383 (let ((psubject (save-excursion (message-fetch-field "subject")))
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
5384 (psupersedes
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
5385 (save-excursion (message-fetch-field "supersedes"))))
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
5386 (if (or
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
5387 (and message-reply-headers
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
5388 (mail-header-references message-reply-headers)
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
5389 (mail-header-subject message-reply-headers)
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
5390 psubject
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
5391 (not (string=
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
5392 (message-strip-subject-re
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
5393 (mail-header-subject message-reply-headers))
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
5394 (message-strip-subject-re psubject))))
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
5395 (and psupersedes
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
5396 (string-match "_-_@" psupersedes)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5397 "_-_" ""))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5398 "@" (message-make-fqdn) ">"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5399
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5400 (defvar message-unique-id-char nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5401
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5402 ;; If you ever change this function, make sure the new version
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5403 ;; cannot generate IDs that the old version could.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5404 ;; You might for example insert a "." somewhere (not next to another dot
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5405 ;; or string boundary), or modify the "fsf" string.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5406 (defun message-unique-id ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5407 ;; Don't use microseconds from (current-time), they may be unsupported.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5408 ;; Instead we use this randomly inited counter.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5409 (setq message-unique-id-char
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5410 (% (1+ (or message-unique-id-char (logand (random t) (1- (lsh 1 20)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5411 ;; (current-time) returns 16-bit ints,
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5412 ;; and 2^16*25 just fits into 4 digits i base 36.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5413 (* 25 25)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5414 (let ((tm (current-time)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5415 (concat
110039
459fd421257a gnus-group-completing-read: Add 'substring to completion-styles for group selection; imap.el, mailcap.el, message.el, mm-util.el, nnheader.el, nnmail.el, pop3.el: Remove references to outdated systems; References to win32 w32 mswindows ms-windows emx were probably cargo-culted, and are removed for clarity; By Lars Magne Ingebrigtsen <larsi@gnus.org>.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110027
diff changeset
5416 (if (or (eq system-type 'ms-dos)
69572
b4faac2800dd Revision: emacs@sv.gnu.org/emacs--devo--0--patch-163
Miles Bader <miles@gnu.org>
parents: 69135
diff changeset
5417 ;; message-number-base36 doesn't handle bigints.
b4faac2800dd Revision: emacs@sv.gnu.org/emacs--devo--0--patch-163
Miles Bader <miles@gnu.org>
parents: 69135
diff changeset
5418 (floatp (user-uid)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5419 (let ((user (downcase (user-login-name))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5420 (while (string-match "[^a-z0-9_]" user)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5421 (aset user (match-beginning 0) ?_))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5422 user)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5423 (message-number-base36 (user-uid) -1))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5424 (message-number-base36 (+ (car tm)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5425 (lsh (% message-unique-id-char 25) 16)) 4)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5426 (message-number-base36 (+ (nth 1 tm)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5427 (lsh (/ message-unique-id-char 25) 16)) 4)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5428 ;; Append a given name, because while the generated ID is unique
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5429 ;; to this newsreader, other newsreaders might otherwise generate
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5430 ;; the same ID via another algorithm.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5431 ".fsf")))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5432
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5433 (defun message-number-base36 (num len)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5434 (if (if (< len 0)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5435 (<= num 0)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5436 (= len 0))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5437 ""
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5438 (concat (message-number-base36 (/ num 36) (1- len))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5439 (char-to-string (aref "zyxwvutsrqponmlkjihgfedcba9876543210"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5440 (% num 36))))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5441
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5442 (defun message-make-organization ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5443 "Make an Organization header."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5444 (let* ((organization
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5445 (when message-user-organization
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5446 (if (functionp message-user-organization)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5447 (funcall message-user-organization)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5448 message-user-organization))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5449 (with-temp-buffer
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5450 (mm-enable-multibyte)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5451 (cond ((stringp organization)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5452 (insert organization))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5453 ((and (eq t organization)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5454 message-user-organization-file
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5455 (file-exists-p message-user-organization-file))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5456 (insert-file-contents message-user-organization-file)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5457 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5458 (while (re-search-forward "[\t\n]+" nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5459 (replace-match "" t t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5460 (unless (zerop (buffer-size))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5461 (buffer-string)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5462
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5463 (defun message-make-lines ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5464 "Count the number of lines and return numeric string."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5465 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5466 (save-restriction
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5467 (widen)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5468 (message-goto-body)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5469 (int-to-string (count-lines (point) (point-max))))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5470
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5471 (defun message-make-references ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5472 "Return the References header for this message."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5473 (when message-reply-headers
107427
ecbe0edc4f69 Stop message.el from loading about 40 libraries it doesn't always need.
Glenn Morris <rgm@gnu.org>
parents: 107235
diff changeset
5474 (let ((message-id (mail-header-id message-reply-headers))
86339
6f4793ab0756 (message-send-mail-function): Fix error convention.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 86276
diff changeset
5475 (references (mail-header-references message-reply-headers)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5476 (if (or references message-id)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5477 (concat (or references "") (and references " ")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5478 (or message-id ""))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5479 nil))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5480
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5481 (defun message-make-in-reply-to ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5482 "Return the In-Reply-To header for this message."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5483 (when message-reply-headers
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5484 (let ((from (mail-header-from message-reply-headers))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5485 (date (mail-header-date message-reply-headers))
107427
ecbe0edc4f69 Stop message.el from loading about 40 libraries it doesn't always need.
Glenn Morris <rgm@gnu.org>
parents: 107235
diff changeset
5486 (msg-id (mail-header-id message-reply-headers)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5487 (when from
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5488 (let ((name (mail-extract-address-components from)))
76267
96573486524e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 75347
diff changeset
5489 (concat
96573486524e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 75347
diff changeset
5490 msg-id (if msg-id " (")
96573486524e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 75347
diff changeset
5491 (if (car name)
96573486524e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 75347
diff changeset
5492 (if (string-match "[^\000-\177]" (car name))
96573486524e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 75347
diff changeset
5493 ;; Quote a string containing non-ASCII characters.
96573486524e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 75347
diff changeset
5494 ;; It will make the RFC2047 encoder cause an error
96573486524e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 75347
diff changeset
5495 ;; if there are special characters.
93394
789028492ded (message-make-in-reply-to): Use mm-with-multibyte-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 93386
diff changeset
5496 (mm-with-multibyte-buffer
789028492ded (message-make-in-reply-to): Use mm-with-multibyte-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 93386
diff changeset
5497 (insert (car name))
789028492ded (message-make-in-reply-to): Use mm-with-multibyte-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 93386
diff changeset
5498 (goto-char (point-min))
789028492ded (message-make-in-reply-to): Use mm-with-multibyte-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 93386
diff changeset
5499 (while (search-forward "\"" nil t)
789028492ded (message-make-in-reply-to): Use mm-with-multibyte-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 93386
diff changeset
5500 (when (prog2
789028492ded (message-make-in-reply-to): Use mm-with-multibyte-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 93386
diff changeset
5501 (backward-char)
789028492ded (message-make-in-reply-to): Use mm-with-multibyte-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 93386
diff changeset
5502 (zerop (% (skip-chars-backward "\\\\") 2))
789028492ded (message-make-in-reply-to): Use mm-with-multibyte-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 93386
diff changeset
5503 (goto-char (match-beginning 0)))
789028492ded (message-make-in-reply-to): Use mm-with-multibyte-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 93386
diff changeset
5504 (insert "\\"))
789028492ded (message-make-in-reply-to): Use mm-with-multibyte-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 93386
diff changeset
5505 (forward-char))
789028492ded (message-make-in-reply-to): Use mm-with-multibyte-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 93386
diff changeset
5506 ;; Those quotes will be removed by the RFC2047 encoder.
789028492ded (message-make-in-reply-to): Use mm-with-multibyte-buffer.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 93386
diff changeset
5507 (concat "\"" (buffer-string) "\""))
76267
96573486524e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 75347
diff changeset
5508 (car name))
96573486524e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 75347
diff changeset
5509 (nth 1 name))
96573486524e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 75347
diff changeset
5510 "'s message of \""
96573486524e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 75347
diff changeset
5511 (if (or (not date) (string= date ""))
96573486524e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 75347
diff changeset
5512 "(unknown date)" date)
96573486524e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 75347
diff changeset
5513 "\"" (if msg-id ")")))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5514
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5515 (defun message-make-distribution ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5516 "Make a Distribution header."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5517 (let ((orig-distribution (message-fetch-reply-field "distribution")))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5518 (cond ((functionp message-distribution-function)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5519 (funcall message-distribution-function))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5520 (t orig-distribution))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5521
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5522 (defun message-make-expires ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5523 "Return an Expires header based on `message-expires'."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5524 (let ((current (current-time))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5525 (future (* 1.0 message-expires 60 60 24)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5526 ;; Add the future to current.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5527 (setcar current (+ (car current) (round (/ future (expt 2 16)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5528 (setcar (cdr current) (+ (nth 1 current) (% (round future) (expt 2 16))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5529 (message-make-date current)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5530
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5531 (defun message-make-path ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5532 "Return uucp path."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5533 (let ((login-name (user-login-name)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5534 (cond ((null message-user-path)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5535 (concat (system-name) "!" login-name))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5536 ((stringp message-user-path)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5537 ;; Support GENERICPATH. Suggested by vixie@decwrl.dec.com.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5538 (concat message-user-path "!" login-name))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5539 (t login-name))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5540
85888
ff86fe6b4194 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 85809
diff changeset
5541 (defun message-make-from (&optional name address)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5542 "Make a From header."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5543 (let* ((style message-from-style)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5544 (login (or address (message-make-address)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5545 (fullname (or name
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5546 (and (boundp 'user-full-name)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5547 user-full-name)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5548 (user-full-name))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5549 (when (string= fullname "&")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5550 (setq fullname (user-login-name)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5551 (with-temp-buffer
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5552 (mm-enable-multibyte)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5553 (cond
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5554 ((or (null style)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5555 (equal fullname ""))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5556 (insert login))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5557 ((or (eq style 'angles)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5558 (and (not (eq style 'parens))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5559 ;; Use angles if no quoting is needed, or if parens would
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5560 ;; need quoting too.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5561 (or (not (string-match "[^- !#-'*+/-9=?A-Z^-~]" fullname))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5562 (let ((tmp (concat fullname nil)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5563 (while (string-match "([^()]*)" tmp)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5564 (aset tmp (match-beginning 0) ?-)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5565 (aset tmp (1- (match-end 0)) ?-))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5566 (string-match "[\\()]" tmp)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5567 (insert fullname)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5568 (goto-char (point-min))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5569 ;; Look for a character that cannot appear unquoted
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5570 ;; according to RFC 822.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5571 (when (re-search-forward "[^- !#-'*+/-9=?A-Z^-~]" nil 1)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5572 ;; Quote fullname, escaping specials.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5573 (goto-char (point-min))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5574 (insert "\"")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5575 (while (re-search-forward "[\"\\]" nil 1)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5576 (replace-match "\\\\\\&" t))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5577 (insert "\""))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5578 (insert " <" login ">"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5579 (t ; 'parens or default
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5580 (insert login " (")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5581 (let ((fullname-start (point)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5582 (insert fullname)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5583 (goto-char fullname-start)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5584 ;; RFC 822 says \ and nonmatching parentheses
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5585 ;; must be escaped in comments.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5586 ;; Escape every instance of ()\ ...
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5587 (while (re-search-forward "[()\\]" nil 1)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5588 (replace-match "\\\\\\&" t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5589 ;; ... then undo escaping of matching parentheses,
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5590 ;; including matching nested parentheses.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5591 (goto-char fullname-start)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5592 (while (re-search-forward
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5593 "\\(\\=\\|[^\\]\\(\\\\\\\\\\)*\\)\\\\(\\(\\([^\\]\\|\\\\\\\\\\)*\\)\\\\)"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5594 nil 1)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5595 (replace-match "\\1(\\3)" t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5596 (goto-char fullname-start)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5597 (insert ")")))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5598 (buffer-string))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5599
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5600 (defun message-make-sender ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5601 "Return the \"real\" user address.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5602 This function tries to ignore all user modifications, and
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5603 give as trustworthy answer as possible."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5604 (concat (user-login-name) "@" (system-name)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5605
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5606 (defun message-make-address ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5607 "Make the address of the user."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5608 (or (message-user-mail-address)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5609 (concat (user-login-name) "@" (message-make-domain))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5610
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5611 (defun message-user-mail-address ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5612 "Return the pertinent part of `user-mail-address'."
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5613 (when (and user-mail-address
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5614 (string-match "@.*\\." user-mail-address))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5615 (if (string-match " " user-mail-address)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5616 (nth 1 (mail-extract-address-components user-mail-address))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5617 user-mail-address)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5618
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5619 (defun message-sendmail-envelope-from ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5620 "Return the envelope from."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5621 (cond ((eq message-sendmail-envelope-from 'header)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5622 (nth 1 (mail-extract-address-components
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5623 (message-fetch-field "from"))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5624 ((stringp message-sendmail-envelope-from)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5625 message-sendmail-envelope-from)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5626 (t
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5627 (message-make-address))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5628
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5629 (defun message-make-fqdn ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5630 "Return user's fully qualified domain name."
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5631 (let* ((system-name (system-name))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5632 (user-mail (message-user-mail-address))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5633 (user-domain
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5634 (if (and user-mail
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5635 (string-match "@\\(.*\\)\\'" user-mail))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5636 (match-string 1 user-mail)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5637 (case-fold-search t))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5638 (cond
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5639 ((and message-user-fqdn
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5640 (stringp message-user-fqdn)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5641 (string-match message-valid-fqdn-regexp message-user-fqdn)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5642 (not (string-match message-bogus-system-names message-user-fqdn)))
74984
21f28d10d73a Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 74021
diff changeset
5643 ;; `message-user-fqdn' seems to be valid
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5644 message-user-fqdn)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5645 ((and (string-match message-valid-fqdn-regexp system-name)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5646 (not (string-match message-bogus-system-names system-name)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5647 ;; `system-name' returned the right result.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5648 system-name)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5649 ;; Try `mail-host-address'.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5650 ((and (boundp 'mail-host-address)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5651 (stringp mail-host-address)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5652 (string-match message-valid-fqdn-regexp mail-host-address)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5653 (not (string-match message-bogus-system-names mail-host-address)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5654 mail-host-address)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5655 ;; We try `user-mail-address' as a backup.
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5656 ((and user-domain
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5657 (stringp user-domain)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5658 (string-match message-valid-fqdn-regexp user-domain)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5659 (not (string-match message-bogus-system-names user-domain)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5660 user-domain)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5661 ;; Default to this bogus thing.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5662 (t
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5663 (concat system-name
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5664 ".i-did-not-set--mail-host-address--so-tickle-me")))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5665
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5666 (defun message-make-host-name ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5667 "Return the name of the host."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5668 (let ((fqdn (message-make-fqdn)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5669 (string-match "^[^.]+\\." fqdn)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5670 (substring fqdn 0 (1- (match-end 0)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5671
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5672 (defun message-make-domain ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5673 "Return the domain name."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5674 (or mail-host-address
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5675 (message-make-fqdn)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5676
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5677 (defun message-to-list-only ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5678 "Send a message to the list only.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5679 Remove all addresses but the list address from To and Cc headers."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5680 (interactive)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5681 (let ((listaddr (message-make-mail-followup-to t)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5682 (when listaddr
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5683 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5684 (message-remove-header "to")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5685 (message-remove-header "cc")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5686 (message-position-on-field "To" "X-Draft-From")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5687 (insert listaddr)))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5688
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5689 (defun message-make-mail-followup-to (&optional only-show-subscribed)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5690 "Return the Mail-Followup-To header.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5691 If passed the optional argument ONLY-SHOW-SUBSCRIBED only return the
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5692 subscribed address (and not the additional To and Cc header contents)."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5693 (let* ((case-fold-search t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5694 (to (message-fetch-field "To"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5695 (cc (message-fetch-field "cc"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5696 (msg-recipients (concat to (and to cc ", ") cc))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5697 (recipients
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5698 (mapcar 'mail-strip-quoted-names
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5699 (message-tokenize-header msg-recipients)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5700 (file-regexps
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5701 (if message-subscribed-address-file
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5702 (let (begin end item re)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5703 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5704 (with-temp-buffer
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5705 (insert-file-contents message-subscribed-address-file)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5706 (while (not (eobp))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5707 (setq begin (point))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5708 (forward-line 1)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5709 (setq end (point))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5710 (if (bolp) (setq end (1- end)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5711 (setq item (regexp-quote (buffer-substring begin end)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5712 (if re (setq re (concat re "\\|" item))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5713 (setq re (concat "\\`\\(" item))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5714 (and re (list (concat re "\\)\\'"))))))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5715 (mft-regexps (apply 'append message-subscribed-regexps
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5716 (mapcar 'regexp-quote
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5717 message-subscribed-addresses)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5718 file-regexps
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5719 (mapcar 'funcall
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5720 message-subscribed-address-functions))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5721 (save-match-data
86339
6f4793ab0756 (message-send-mail-function): Fix error convention.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 86276
diff changeset
5722 (let ((list
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5723 (loop for recipient in recipients
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5724 when (loop for regexp in mft-regexps
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5725 when (string-match regexp recipient) return t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5726 return recipient)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5727 (when list
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5728 (if only-show-subscribed
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5729 list
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5730 msg-recipients))))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5731
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5732 (defun message-idna-to-ascii-rhs-1 (header)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5733 "Interactively potentially IDNA encode domain names in HEADER."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5734 (let ((field (message-fetch-field header))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5735 rhs ace address)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5736 (when field
65719
5265a4059126 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-564
Miles Bader <miles@gnu.org>
parents: 65682
diff changeset
5737 (dolist (rhs
65846
a4e8d78ae3fb Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-574
Miles Bader <miles@gnu.org>
parents: 65742
diff changeset
5738 (mm-delete-duplicates
65719
5265a4059126 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-564
Miles Bader <miles@gnu.org>
parents: 65682
diff changeset
5739 (mapcar (lambda (rhs) (or (cadr (split-string rhs "@")) ""))
100197
3076f8588570 (message-idna-to-ascii-rhs-1): Fix previous commit.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 100142
diff changeset
5740 (mapcar 'downcase
65719
5265a4059126 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-564
Miles Bader <miles@gnu.org>
parents: 65682
diff changeset
5741 (mapcar
110763
0fe64d68a522 Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110689
diff changeset
5742 (lambda (elem)
0fe64d68a522 Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110689
diff changeset
5743 (or (cadr elem)
0fe64d68a522 Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110689
diff changeset
5744 ""))
98398
39408ed11da9 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 98345
diff changeset
5745 (mail-extract-address-components field t))))))
100197
3076f8588570 (message-idna-to-ascii-rhs-1): Fix previous commit.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 100142
diff changeset
5746 ;; Note that `rhs' will be "" if the address does not have
3076f8588570 (message-idna-to-ascii-rhs-1): Fix previous commit.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 100142
diff changeset
5747 ;; the domain part, i.e., if it is a local user's address.
3076f8588570 (message-idna-to-ascii-rhs-1): Fix previous commit.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 100142
diff changeset
5748 (setq ace (if (string-match "\\`[[:ascii:]]*\\'" rhs)
87097
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87026
diff changeset
5749 rhs
781256628613 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 87026
diff changeset
5750 (downcase (idna-to-ascii rhs))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5751 (when (and (not (equal rhs ace))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5752 (or (not (eq message-use-idna 'ask))
65719
5265a4059126 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-564
Miles Bader <miles@gnu.org>
parents: 65682
diff changeset
5753 (y-or-n-p (format "Replace %s with %s in %s:? "
5265a4059126 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-564
Miles Bader <miles@gnu.org>
parents: 65682
diff changeset
5754 rhs ace header))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5755 (goto-char (point-min))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5756 (while (re-search-forward (concat "^" header ":") nil t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5757 (message-narrow-to-field)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5758 (while (search-forward (concat "@" rhs) nil t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5759 (replace-match (concat "@" ace) t t))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5760 (goto-char (point-max))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5761 (widen)))))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5762
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5763 (defun message-idna-to-ascii-rhs ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5764 "Possibly IDNA encode non-ASCII domain names in From:, To: and Cc: headers.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5765 See `message-idna-encode'."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5766 (interactive)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5767 (when message-use-idna
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5768 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5769 (save-restriction
100197
3076f8588570 (message-idna-to-ascii-rhs-1): Fix previous commit.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 100142
diff changeset
5770 ;; `message-narrow-to-head' that recognizes only the first empty
3076f8588570 (message-idna-to-ascii-rhs-1): Fix previous commit.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 100142
diff changeset
5771 ;; line as the message header separator used to be used here.
3076f8588570 (message-idna-to-ascii-rhs-1): Fix previous commit.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 100142
diff changeset
5772 ;; However, since there is the "--text follows this line--" line
3076f8588570 (message-idna-to-ascii-rhs-1): Fix previous commit.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 100142
diff changeset
5773 ;; normally, it failed in narrowing to the headers and potentially
3076f8588570 (message-idna-to-ascii-rhs-1): Fix previous commit.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 100142
diff changeset
5774 ;; caused the IDNA encoding on lines that look like headers in
3076f8588570 (message-idna-to-ascii-rhs-1): Fix previous commit.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 100142
diff changeset
5775 ;; the message body.
100137
f3e7e60dc941 (message-idna-to-ascii-rhs): Use message-narrow-to-headers-or-head rather than
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 99777
diff changeset
5776 (message-narrow-to-headers-or-head)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5777 (message-idna-to-ascii-rhs-1 "From")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5778 (message-idna-to-ascii-rhs-1 "To")
65719
5265a4059126 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-564
Miles Bader <miles@gnu.org>
parents: 65682
diff changeset
5779 (message-idna-to-ascii-rhs-1 "Reply-To")
5265a4059126 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-564
Miles Bader <miles@gnu.org>
parents: 65682
diff changeset
5780 (message-idna-to-ascii-rhs-1 "Mail-Reply-To")
5265a4059126 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-564
Miles Bader <miles@gnu.org>
parents: 65682
diff changeset
5781 (message-idna-to-ascii-rhs-1 "Mail-Followup-To")
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5782 (message-idna-to-ascii-rhs-1 "Cc")))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5783
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5784 (defun message-generate-headers (headers)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5785 "Prepare article HEADERS.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5786 Headers already prepared in the buffer are not modified."
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5787 (setq headers (append headers message-required-headers))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5788 (save-restriction
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5789 (message-narrow-to-headers)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5790 (let* ((Date (message-make-date))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5791 (Message-ID (message-make-message-id))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5792 (Organization (message-make-organization))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5793 (From (message-make-from))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5794 (Path (message-make-path))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5795 (Subject nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5796 (Newsgroups nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5797 (In-Reply-To (message-make-in-reply-to))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5798 (References (message-make-references))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5799 (To nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5800 (Distribution (message-make-distribution))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5801 (Lines (message-make-lines))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5802 (User-Agent message-newsreader)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5803 (Expires (message-make-expires))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5804 (case-fold-search t)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5805 (optionalp nil)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5806 header value elem header-string)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5807 ;; First we remove any old generated headers.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5808 (let ((headers message-deletable-headers))
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
5809 (unless (buffer-modified-p)
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
5810 (setq headers (delq 'Message-ID (copy-sequence headers))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5811 (while headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5812 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5813 (and (re-search-forward
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5814 (concat "^" (symbol-name (car headers)) ": *") nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5815 (get-text-property (1+ (match-beginning 0)) 'message-deletable)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5816 (message-delete-line))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5817 (pop headers)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5818 ;; Go through all the required headers and see if they are in the
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5819 ;; articles already. If they are not, or are empty, they are
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5820 ;; inserted automatically - except for Subject, Newsgroups and
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5821 ;; Distribution.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5822 (while headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5823 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5824 (setq elem (pop headers))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5825 (if (consp elem)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5826 (if (eq (car elem) 'optional)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5827 (setq header (cdr elem)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5828 optionalp t)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5829 (setq header (car elem)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5830 (setq header elem))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5831 (setq header-string (if (stringp header)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5832 header
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5833 (symbol-name header)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5834 (when (or (not (re-search-forward
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5835 (concat "^"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5836 (regexp-quote (downcase header-string))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5837 ":")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5838 nil t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5839 (progn
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5840 ;; The header was found. We insert a space after the
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5841 ;; colon, if there is none.
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5842 (if (/= (char-after) ? ) (insert " ") (forward-char 1))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5843 ;; Find out whether the header is empty.
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5844 (looking-at "[ \t]*\n[^ \t]")))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5845 ;; So we find out what value we should insert.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5846 (setq value
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5847 (cond
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5848 ((and (consp elem)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5849 (eq (car elem) 'optional)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5850 (not (member header-string message-inserted-headers)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5851 ;; This is an optional header. If the cdr of this
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5852 ;; is something that is nil, then we do not insert
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5853 ;; this header.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5854 (setq header (cdr elem))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5855 (or (and (functionp (cdr elem))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5856 (funcall (cdr elem)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5857 (and (boundp (cdr elem))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5858 (symbol-value (cdr elem)))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5859 ((consp elem)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5860 ;; The element is a cons. Either the cdr is a
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5861 ;; string to be inserted verbatim, or it is a
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5862 ;; function, and we insert the value returned from
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5863 ;; this function.
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5864 (or (and (stringp (cdr elem))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5865 (cdr elem))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5866 (and (functionp (cdr elem))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5867 (funcall (cdr elem)))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5868 ((and (boundp header)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5869 (symbol-value header))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5870 ;; The element is a symbol. We insert the value
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5871 ;; of this symbol, if any.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5872 (symbol-value header))
66808
a93385a3e7a2 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-646
Miles Bader <miles@gnu.org>
parents: 66573
diff changeset
5873 ((not (message-check-element
a93385a3e7a2 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-646
Miles Bader <miles@gnu.org>
parents: 66573
diff changeset
5874 (intern (downcase (symbol-name header)))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5875 ;; We couldn't generate a value for this header,
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5876 ;; so we just ask the user.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5877 (read-from-minibuffer
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5878 (format "Empty header for %s; enter value: " header)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5879 ;; Finally insert the header.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5880 (when (and value
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5881 (not (equal value "")))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5882 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5883 (if (bolp)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5884 (progn
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5885 ;; This header didn't exist, so we insert it.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5886 (goto-char (point-max))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5887 (let ((formatter
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5888 (cdr (assq header message-header-format-alist))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5889 (if formatter
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5890 (funcall formatter header value)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5891 (insert header-string ": " value))
108343
97594bf4e5a9 Synch with Gnus trunk:
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107686
diff changeset
5892 (push header-string message-inserted-headers)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5893 (goto-char (message-fill-field))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5894 ;; We check whether the value was ended by a
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5895 ;; newline. If not, we insert one.
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5896 (unless (bolp)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
5897 (insert "\n"))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5898 (forward-line -1)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5899 ;; The value of this header was empty, so we clear
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5900 ;; totally and insert the new value.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5901 (delete-region (point) (point-at-eol))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5902 ;; If the header is optional, and the header was
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5903 ;; empty, we can't insert it anyway.
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5904 (unless optionalp
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5905 (push header-string message-inserted-headers)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5906 (insert value)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5907 (message-fill-field)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5908 ;; Add the deletable property to the headers that require it.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5909 (and (memq header message-deletable-headers)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5910 (progn (beginning-of-line) (looking-at "[^:]+: "))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5911 (add-text-properties
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5912 (point) (match-end 0)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5913 '(message-deletable t face italic) (current-buffer)))))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5914 ;; Insert new Sender if the From is strange.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5915 (let ((from (message-fetch-field "from"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5916 (sender (message-fetch-field "sender"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5917 (secure-sender (message-make-sender)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5918 (when (and from
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5919 (not (message-check-element 'sender))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5920 (not (string=
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5921 (downcase
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5922 (cadr (mail-extract-address-components from)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5923 (downcase secure-sender)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5924 (or (null sender)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5925 (not
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5926 (string=
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5927 (downcase
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5928 (cadr (mail-extract-address-components sender)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5929 (downcase secure-sender)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5930 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5931 ;; Rename any old Sender headers to Original-Sender.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5932 (when (re-search-forward "^\\(Original-\\)*Sender:" nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5933 (beginning-of-line)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5934 (insert "Original-")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5935 (beginning-of-line))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5936 (when (or (message-news-p)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5937 (string-match "@.+\\.." secure-sender))
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
5938 (insert "Sender: " secure-sender "\n"))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5939 ;; Check for IDNA
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5940 (message-idna-to-ascii-rhs))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5941
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5942 (defun message-insert-courtesy-copy ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5943 "Insert a courtesy message in mail copies of combined messages."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5944 (let (newsgroups)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5945 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5946 (save-restriction
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5947 (message-narrow-to-headers)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5948 (when (setq newsgroups (message-fetch-field "newsgroups"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5949 (goto-char (point-max))
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
5950 (insert "Posted-To: " newsgroups "\n")))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5951 (forward-line 1)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5952 (when message-courtesy-message
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5953 (cond
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5954 ((string-match "%s" message-courtesy-message)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5955 (insert (format message-courtesy-message newsgroups)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5956 (t
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5957 (insert message-courtesy-message)))))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5958
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5959 ;;;
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5960 ;;; Setting up a message buffer
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5961 ;;;
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5962
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5963 (defun message-skip-to-next-address ()
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5964 (let ((end (save-excursion
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5965 (message-next-header)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5966 (point)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5967 quoted char)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5968 (when (looking-at ",")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5969 (forward-char 1))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5970 (while (and (not (= (point) end))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5971 (or (not (eq char ?,))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5972 quoted))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5973 (skip-chars-forward "^,\"" (point-max))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5974 (when (eq (setq char (following-char)) ?\")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5975 (setq quoted (not quoted)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5976 (unless (= (point) end)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5977 (forward-char 1)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5978 (skip-chars-forward " \t\n")))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5979
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5980 (defun message-fill-address (header value)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5981 (insert (capitalize (symbol-name header))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5982 ": "
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5983 (if (consp value) (car value) value)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5984 "\n")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5985 (message-fill-field-address))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5986
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5987 (defun message-split-line ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5988 "Split current line, moving portion beyond point vertically down.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5989 If the current line has `message-yank-prefix', insert it on the new line."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5990 (interactive "*")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5991 (condition-case nil
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59756
diff changeset
5992 (split-line message-yank-prefix) ;; Emacs 22.1+ supports arg.
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5993 (error
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5994 (split-line))))
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59756
diff changeset
5995
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5996 (defun message-insert-header (header value)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5997 (insert (capitalize (symbol-name header))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5998 ": "
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
5999 (if (consp value) (car value) value)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6000
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6001 (defun message-field-name ()
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6002 (save-excursion
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6003 (goto-char (point-min))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6004 (when (looking-at "\\([^:]+\\):")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6005 (intern (capitalize (match-string 1))))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6006
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6007 (defun message-fill-field ()
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6008 (save-excursion
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6009 (save-restriction
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6010 (message-narrow-to-field)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6011 (let ((field-name (message-field-name)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6012 (funcall (or (cadr (assq field-name message-field-fillers))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6013 'message-fill-field-general)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6014 (point-max))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6015
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6016 (defun message-fill-field-address ()
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6017 (while (not (eobp))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6018 (message-skip-to-next-address)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6019 (let (last)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6020 (if (and (> (current-column) 78)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6021 last)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6022 (progn
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6023 (save-excursion
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6024 (goto-char last)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6025 (insert "\n\t"))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6026 (setq last (1+ (point))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6027 (setq last (1+ (point)))))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6028
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6029 (defun message-fill-field-general ()
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6030 (let ((begin (point))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6031 (fill-column 78)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6032 (fill-prefix "\t"))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6033 (while (and (search-forward "\n" nil t)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6034 (not (eobp)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6035 (replace-match " " t t))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6036 (fill-region-as-paragraph begin (point-max))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6037 ;; Tapdance around looong Message-IDs.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6038 (forward-line -1)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6039 (when (looking-at "[ \t]*$")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6040 (message-delete-line))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6041 (goto-char begin)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6042 (search-forward ":" nil t)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6043 (when (looking-at "\n[ \t]+")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6044 (replace-match " " t t))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6045 (goto-char (point-max))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6046
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6047 (defun message-shorten-1 (list cut surplus)
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
6048 "Cut SURPLUS elements out of LIST, beginning with CUTth one."
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6049 (setcdr (nthcdr (- cut 2) list)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6050 (nthcdr (+ (- cut 2) surplus 1) list)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6051
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6052 (defun message-shorten-references (header references)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6053 "Trim REFERENCES to be 21 Message-ID long or less, and fold them.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6054 When sending via news, also check that the REFERENCES are less
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6055 than 988 characters long, and if they are not, trim them until
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6056 they are."
110689
42815c76b976 Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110666
diff changeset
6057 ;; 21 is the number suggested by USEAGE.
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6058 (let ((maxcount 21)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6059 (count 0)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6060 (cut 2)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6061 refs)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6062 (with-temp-buffer
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6063 (insert references)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6064 (goto-char (point-min))
93386
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
6065 ;; Cons a list of valid references. GNKSA says we must not include MIDs
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
6066 ;; with whitespace or missing brackets (7.a "Does not propagate broken
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
6067 ;; Message-IDs in original References").
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
6068 (while (re-search-forward "<[^ <]+@[^ <]+>" nil t)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6069 (push (match-string 0) refs))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6070 (setq refs (nreverse refs)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6071 count (length refs)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6072
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6073 ;; If the list has more than MAXCOUNT elements, trim it by
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6074 ;; removing the CUTth element and the required number of
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6075 ;; elements that follow.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6076 (when (> count maxcount)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6077 (let ((surplus (- count maxcount)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6078 (message-shorten-1 refs cut surplus)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6079 (decf count surplus)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6080
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6081 ;; When sending via news, make sure the total folded length will
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6082 ;; be less than 998 characters. This is to cater to broken INN
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6083 ;; 2.3 which counts the total number of characters in a header
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6084 ;; rather than the physical line length of each line, as it should.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6085 ;;
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6086 ;; This hack should be removed when it's believed than INN 2.3 is
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6087 ;; no longer widely used.
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6088 ;;
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6089 ;; At this point the headers have not been generated, thus we use
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6090 ;; message-this-is-news directly.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6091 (when message-this-is-news
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6092 (while (< 998
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6093 (with-temp-buffer
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6094 (message-insert-header
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6095 header (mapconcat #'identity refs " "))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6096 (buffer-size)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6097 (message-shorten-1 refs cut 1)))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6098 ;; Finally, collect the references back into a string and insert
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6099 ;; it into the buffer.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6100 (message-insert-header header (mapconcat #'identity refs " "))))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6101
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6102 (defun message-position-point ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6103 "Move point to where the user probably wants to find it."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6104 (message-narrow-to-headers)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6105 (cond
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6106 ((re-search-forward "^[^:]+:[ \t]*$" nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6107 (search-backward ":" )
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6108 (widen)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6109 (forward-char 1)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6110 (if (eq (char-after) ? )
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6111 (forward-char 1)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6112 (insert " ")))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6113 (t
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6114 (goto-char (point-max))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6115 (widen)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6116 (forward-line 1)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6117 (unless (looking-at "$")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6118 (forward-line 2)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6119 (sit-for 0)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6120
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6121 (defcustom message-beginning-of-line t
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6122 "Whether \\<message-mode-map>\\[message-beginning-of-line]\
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6123 goes to beginning of header values."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59756
diff changeset
6124 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6125 :group 'message-buffers
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6126 :link '(custom-manual "(message)Movement")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6127 :type 'boolean)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6128
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6129 (defun message-beginning-of-line (&optional n)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6130 "Move point to beginning of header value or to beginning of line.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6131 The prefix argument N is passed directly to `beginning-of-line'.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6132
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6133 This command is identical to `beginning-of-line' if point is
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6134 outside the message header or if the option `message-beginning-of-line'
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6135 is nil.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6136
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6137 If point is in the message header and on a (non-continued) header
59756
b53453586872 (message-beginning-of-line): Change the behavior when
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 58835
diff changeset
6138 line, move point to the beginning of the header value or the beginning of line,
b53453586872 (message-beginning-of-line): Change the behavior when
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 58835
diff changeset
6139 whichever is closer. If point is already at beginning of line, move point to
b53453586872 (message-beginning-of-line): Change the behavior when
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 58835
diff changeset
6140 beginning of header value. Therefore, repeated calls will toggle point
b53453586872 (message-beginning-of-line): Change the behavior when
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 58835
diff changeset
6141 between beginning of field and beginning of line."
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6142 (interactive "p")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6143 (let ((zrs 'zmacs-region-stays))
87941
d77b6e5ee8af * sieve.el (sieve-make-overlay, sieve-overlay-put, sieve-overlays-at):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 87649
diff changeset
6144 (when (and (featurep 'xemacs) (interactive-p) (boundp zrs))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6145 (set zrs t)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6146 (if (and message-beginning-of-line
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6147 (message-point-in-header-p))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6148 (let* ((here (point))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6149 (bol (progn (beginning-of-line n) (point)))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6150 (eol (point-at-eol))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6151 (eoh (re-search-forward ": *" eol t)))
59756
b53453586872 (message-beginning-of-line): Change the behavior when
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 58835
diff changeset
6152 (goto-char
b53453586872 (message-beginning-of-line): Change the behavior when
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 58835
diff changeset
6153 (if (and eoh (or (< eoh here) (= bol here)))
b53453586872 (message-beginning-of-line): Change the behavior when
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 58835
diff changeset
6154 eoh bol)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6155 (beginning-of-line n)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6156
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6157 (defun message-buffer-name (type &optional to group)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6158 "Return a new (unique) buffer name based on TYPE and TO."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6159 (cond
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6160 ;; Generate a new buffer name The Message Way.
76650
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6161 ((memq message-generate-new-buffers '(unique t))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6162 (generate-new-buffer-name
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6163 (concat "*" type
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6164 (if to
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6165 (concat " to "
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6166 (or (car (mail-extract-address-components to))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6167 to) "")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6168 "")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6169 (if (and group (not (string= group ""))) (concat " on " group) "")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6170 "*")))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6171 ;; Check whether `message-generate-new-buffers' is a function,
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6172 ;; and if so, call it.
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6173 ((functionp message-generate-new-buffers)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6174 (funcall message-generate-new-buffers type to group))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6175 ((eq message-generate-new-buffers 'unsent)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6176 (generate-new-buffer-name
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6177 (concat "*unsent " type
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6178 (if to
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6179 (concat " to "
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6180 (or (car (mail-extract-address-components to))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6181 to) "")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6182 "")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6183 (if (and group (not (string= group ""))) (concat " on " group) "")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6184 "*")))
76650
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6185 ;; Search for the existing message buffer with the specified name.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6186 (t
76650
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6187 (let* ((new (if (eq message-generate-new-buffers 'standard)
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6188 (generate-new-buffer-name (concat "*" type " message*"))
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6189 (let ((message-generate-new-buffers 'unique))
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6190 (message-buffer-name type to group))))
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6191 (regexp (concat "\\`"
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6192 (regexp-quote
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6193 (if (string-match "<[0-9]+>\\'" new)
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6194 (substring new 0 (match-beginning 0))
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6195 new))
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6196 "\\(?:<\\([0-9]+\\)>\\)?\\'"))
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6197 (case-fold-search nil))
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6198 (or (cdar
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6199 (last
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6200 (sort
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6201 (delq nil
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6202 (mapcar
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6203 (lambda (b)
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6204 (when (and (string-match regexp (setq b (buffer-name b)))
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6205 (eq (with-current-buffer b major-mode)
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6206 'message-mode))
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6207 (cons (string-to-number (or (match-string 1 b) "1"))
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6208 b)))
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6209 (buffer-list)))
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6210 'car-less-than-car)))
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6211 new)))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6212
77819
20662529a1ae (message-pop-to-buffer): Add switch-function argument.
Chong Yidong <cyd@stupidchicken.com>
parents: 77114
diff changeset
6213 (defun message-pop-to-buffer (name &optional switch-function)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6214 "Pop to buffer NAME, and warn if it already exists and is modified."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6215 (let ((buffer (get-buffer name)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6216 (if (and buffer
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6217 (buffer-name buffer))
76650
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6218 (let ((window (get-buffer-window buffer 0)))
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6219 (if window
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6220 ;; Raise the frame already displaying the message buffer.
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6221 (progn
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6222 (gnus-select-frame-set-input-focus (window-frame window))
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6223 (select-window window))
77819
20662529a1ae (message-pop-to-buffer): Add switch-function argument.
Chong Yidong <cyd@stupidchicken.com>
parents: 77114
diff changeset
6224 (funcall (or switch-function 'pop-to-buffer) buffer)
20662529a1ae (message-pop-to-buffer): Add switch-function argument.
Chong Yidong <cyd@stupidchicken.com>
parents: 77114
diff changeset
6225 (set-buffer buffer))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6226 (when (and (buffer-modified-p)
76650
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6227 (not (prog1
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6228 (y-or-n-p
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6229 "Message already being composed; erase? ")
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6230 (message nil))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6231 (error "Message being composed")))
77819
20662529a1ae (message-pop-to-buffer): Add switch-function argument.
Chong Yidong <cyd@stupidchicken.com>
parents: 77114
diff changeset
6232 (funcall (or switch-function 'pop-to-buffer) name)
20662529a1ae (message-pop-to-buffer): Add switch-function argument.
Chong Yidong <cyd@stupidchicken.com>
parents: 77114
diff changeset
6233 (set-buffer name))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6234 (erase-buffer)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6235 (message-mode)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6236
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6237 (defun message-do-send-housekeeping ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6238 "Kill old message buffers."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6239 ;; We might have sent this buffer already. Delete it from the
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6240 ;; list of buffers.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6241 (setq message-buffer-list (delq (current-buffer) message-buffer-list))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6242 (while (and message-max-buffers
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6243 message-buffer-list
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6244 (>= (length message-buffer-list) message-max-buffers))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6245 ;; Kill the oldest buffer -- unless it has been changed.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6246 (let ((buffer (pop message-buffer-list)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6247 (when (and (buffer-name buffer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6248 (not (buffer-modified-p buffer)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6249 (kill-buffer buffer))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6250 ;; Rename the buffer.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6251 (if message-send-rename-function
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6252 (funcall message-send-rename-function)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6253 ;; Note: mail-abbrevs of XEmacs renames buffer name behind Gnus.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6254 (when (string-match
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6255 "\\`\\*\\(sent \\|unsent \\)?\\(.+\\)\\*[^\\*]*\\|\\`mail to "
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6256 (buffer-name))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6257 (let ((name (match-string 2 (buffer-name)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6258 to group)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6259 (if (not (or (null name)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6260 (string-equal name "mail")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6261 (string-equal name "posting")))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6262 (setq name (concat "*sent " name "*"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6263 (message-narrow-to-headers)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6264 (setq to (message-fetch-field "to"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6265 (setq group (message-fetch-field "newsgroups"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6266 (widen)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6267 (setq name
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6268 (cond
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6269 (to (concat "*sent mail to "
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6270 (or (car (mail-extract-address-components to))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6271 to) "*"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6272 ((and group (not (string= group "")))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6273 (concat "*sent posting on " group "*"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6274 (t "*sent mail*"))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6275 (unless (string-equal name (buffer-name))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6276 (rename-buffer name t)))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6277 ;; Push the current buffer onto the list.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6278 (when message-max-buffers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6279 (setq message-buffer-list
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6280 (nconc message-buffer-list (list (current-buffer))))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6281
34797
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6282 (defun message-mail-user-agent ()
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6283 (let ((mua (cond
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6284 ((not message-mail-user-agent) nil)
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6285 ((eq message-mail-user-agent t) mail-user-agent)
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6286 (t message-mail-user-agent))))
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6287 (if (memq mua '(message-user-agent gnus-user-agent))
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6288 nil
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6289 mua)))
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6290
106890
2ed4eab78ca3 * message.el (message-mail): Just pass yank-action on to message-setup.
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
6291 ;; YANK-ACTION, if non-nil, can be a buffer or a yank action of the
2ed4eab78ca3 * message.el (message-mail): Just pass yank-action on to message-setup.
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
6292 ;; form (FUNCTION . ARGS).
2ed4eab78ca3 * message.el (message-mail): Just pass yank-action on to message-setup.
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
6293 (defun message-setup (headers &optional yank-action actions
76650
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6294 continue switch-function)
34797
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6295 (let ((mua (message-mail-user-agent))
106890
2ed4eab78ca3 * message.el (message-mail): Just pass yank-action on to message-setup.
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
6296 subject to field)
34797
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6297 (if (not (and message-this-is-mail mua))
106890
2ed4eab78ca3 * message.el (message-mail): Just pass yank-action on to message-setup.
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
6298 (message-setup-1 headers yank-action actions)
34797
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6299 (setq headers (copy-sequence headers))
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6300 (setq field (assq 'Subject headers))
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6301 (when field
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6302 (setq subject (cdr field))
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6303 (setq headers (delq field headers)))
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6304 (setq field (assq 'To headers))
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6305 (when field
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6306 (setq to (cdr field))
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6307 (setq headers (delq field headers)))
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6308 (let ((mail-user-agent mua))
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
6309 (compose-mail to subject
34797
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6310 (mapcar (lambda (item)
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6311 (cons
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6312 (format "%s" (car item))
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6313 (cdr item)))
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6314 headers)
106890
2ed4eab78ca3 * message.el (message-mail): Just pass yank-action on to message-setup.
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
6315 continue switch-function
2ed4eab78ca3 * message.el (message-mail): Just pass yank-action on to message-setup.
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
6316 (if (bufferp yank-action)
2ed4eab78ca3 * message.el (message-mail): Just pass yank-action on to message-setup.
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
6317 (list 'insert-buffer yank-action)
2ed4eab78ca3 * message.el (message-mail): Just pass yank-action on to message-setup.
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
6318 yank-action)
2ed4eab78ca3 * message.el (message-mail): Just pass yank-action on to message-setup.
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
6319 actions)))))
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49034
diff changeset
6320
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6321 (defun message-headers-to-generate (headers included-headers excluded-headers)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6322 "Return a list that includes all headers from HEADERS.
73487
d34b38862f88 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73007
diff changeset
6323 If INCLUDED-HEADERS is a list, just include those headers. If it is
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6324 t, include all headers. In any case, headers from EXCLUDED-HEADERS
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6325 are not included."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6326 (let ((result nil)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6327 header-name)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6328 (dolist (header headers)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6329 (setq header-name (cond
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6330 ((and (consp header)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6331 (eq (car header) 'optional))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6332 ;; On the form (optional . Header)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6333 (cdr header))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6334 ((consp header)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6335 ;; On the form (Header . function)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6336 (car header))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6337 (t
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6338 ;; Just a Header.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6339 header)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6340 (when (and (not (memq header-name excluded-headers))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6341 (or (eq included-headers t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6342 (memq header-name included-headers)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6343 (push header result)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6344 (nreverse result)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6345
106890
2ed4eab78ca3 * message.el (message-mail): Just pass yank-action on to message-setup.
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
6346 (defun message-setup-1 (headers &optional yank-action actions)
41511
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
6347 (dolist (action actions)
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
6348 (condition-case nil
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
6349 (add-to-list 'message-send-actions
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
6350 `(apply ',(car action) ',(cdr action)))))
106892
2bef3a4193f8 * message.el (message-setup-1): Prefer to save message-reply-buffer as a buffer.
Chong Yidong <cyd@stupidchicken.com>
parents: 106890
diff changeset
6351 (setq message-reply-buffer
2bef3a4193f8 * message.el (message-setup-1): Prefer to save message-reply-buffer as a buffer.
Chong Yidong <cyd@stupidchicken.com>
parents: 106890
diff changeset
6352 (if (and (consp yank-action)
2bef3a4193f8 * message.el (message-setup-1): Prefer to save message-reply-buffer as a buffer.
Chong Yidong <cyd@stupidchicken.com>
parents: 106890
diff changeset
6353 (eq (car yank-action) 'insert-buffer))
2bef3a4193f8 * message.el (message-setup-1): Prefer to save message-reply-buffer as a buffer.
Chong Yidong <cyd@stupidchicken.com>
parents: 106890
diff changeset
6354 (nth 1 yank-action)
2bef3a4193f8 * message.el (message-setup-1): Prefer to save message-reply-buffer as a buffer.
Chong Yidong <cyd@stupidchicken.com>
parents: 106890
diff changeset
6355 yank-action))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6356 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6357 ;; Insert all the headers.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6358 (mail-header-format
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6359 (let ((h headers)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6360 (alist message-header-format-alist))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6361 (while h
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6362 (unless (assq (caar h) message-header-format-alist)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6363 (push (list (caar h)) alist))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6364 (pop h))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6365 alist)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6366 headers)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6367 (delete-region (point) (progn (forward-line -1) (point)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6368 (when message-default-headers
111082
9d01a8aadec3 message.el (message-setup-1): Allow message-default-headers to be a function.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 111072
diff changeset
6369 (insert
9d01a8aadec3 message.el (message-setup-1): Allow message-default-headers to be a function.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 111072
diff changeset
6370 (if (functionp message-default-headers)
9d01a8aadec3 message.el (message-setup-1): Allow message-default-headers to be a function.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 111072
diff changeset
6371 (funcall message-default-headers)
9d01a8aadec3 message.el (message-setup-1): Allow message-default-headers to be a function.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 111072
diff changeset
6372 message-default-headers))
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
6373 (or (bolp) (insert ?\n)))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6374 (insert mail-header-separator "\n")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6375 (forward-line -1)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6376 (when (message-news-p)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6377 (when message-default-news-headers
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6378 (insert message-default-news-headers)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
6379 (or (bolp) (insert ?\n)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6380 (when message-generate-headers-first
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6381 (message-generate-headers
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6382 (message-headers-to-generate
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6383 (append message-required-news-headers
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6384 message-required-headers)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6385 message-generate-headers-first
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6386 '(Lines Subject)))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6387 (when (message-mail-p)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6388 (when message-default-mail-headers
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6389 (insert message-default-mail-headers)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
6390 (or (bolp) (insert ?\n)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6391 (when message-generate-headers-first
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6392 (message-generate-headers
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6393 (message-headers-to-generate
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6394 (append message-required-mail-headers
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6395 message-required-headers)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6396 message-generate-headers-first
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6397 '(Lines Subject)))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6398 (run-hooks 'message-signature-setup-hook)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6399 (message-insert-signature)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6400 (save-restriction
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6401 (message-narrow-to-headers)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6402 (run-hooks 'message-header-setup-hook))
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
6403 (setq buffer-undo-list nil)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6404 (when message-generate-hashcash
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6405 ;; Generate hashcash headers for recipients already known
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6406 (mail-add-payment-async))
93386
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
6407 ;; Gnus posting styles are applied via buffer-local `message-setup-hook'
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
6408 ;; values.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6409 (run-hooks 'message-setup-hook)
68521
04c2548593f7 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-33
Miles Bader <miles@gnu.org>
parents: 68230
diff changeset
6410 ;; Do this last to give it precedence over posting styles, etc.
04c2548593f7 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-33
Miles Bader <miles@gnu.org>
parents: 68230
diff changeset
6411 (when (message-mail-p)
04c2548593f7 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-33
Miles Bader <miles@gnu.org>
parents: 68230
diff changeset
6412 (save-restriction
04c2548593f7 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-33
Miles Bader <miles@gnu.org>
parents: 68230
diff changeset
6413 (message-narrow-to-headers)
04c2548593f7 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-33
Miles Bader <miles@gnu.org>
parents: 68230
diff changeset
6414 (if message-alternative-emails
04c2548593f7 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-33
Miles Bader <miles@gnu.org>
parents: 68230
diff changeset
6415 (message-use-alternative-email-as-from))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6416 (message-position-point)
93386
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
6417 ;; Allow correct handling of `message-checksum' in `message-yank-original':
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
6418 (set-buffer-modified-p nil)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6419 (undo-boundary))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6420
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6421 (defun message-set-auto-save-file-name ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6422 "Associate the message buffer with a file in the drafts directory."
23379
cfa9bc8ed327 (message-auto-save-directory): Renamed from
Karl Heuer <kwzh@gnu.org>
parents: 23096
diff changeset
6423 (when message-auto-save-directory
34057
98bd49d8cf7d (message-auto-save-directory): Use
Dave Love <fx@gnu.org>
parents: 33982
diff changeset
6424 (unless (file-directory-p
98bd49d8cf7d (message-auto-save-directory): Use
Dave Love <fx@gnu.org>
parents: 33982
diff changeset
6425 (directory-file-name message-auto-save-directory))
48376
285ddf07e772 * message.el (message-set-auto-save-file-name): Use
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 47947
diff changeset
6426 (make-directory message-auto-save-directory t))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6427 (if (gnus-alive-p)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6428 (setq message-draft-article
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6429 (nndraft-request-associate-buffer "drafts"))
98344
7fa3e064d230 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97972
diff changeset
6430
7fa3e064d230 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97972
diff changeset
6431 ;; If Gnus were alive, draft messages would be saved in the drafts folder.
7fa3e064d230 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97972
diff changeset
6432 ;; But Gnus is not alive, so arrange to save the draft message in a
7fa3e064d230 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97972
diff changeset
6433 ;; regular file in message-auto-save-directory. Append a unique
7fa3e064d230 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97972
diff changeset
6434 ;; time-based suffix to the filename to allow multiple drafts to be saved
7fa3e064d230 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97972
diff changeset
6435 ;; simultaneously without overwriting each other (which mimics the
7fa3e064d230 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97972
diff changeset
6436 ;; functionality of the Gnus drafts folder).
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6437 (setq buffer-file-name (expand-file-name
98344
7fa3e064d230 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97972
diff changeset
6438 (concat
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6439 (if (memq system-type
110039
459fd421257a gnus-group-completing-read: Add 'substring to completion-styles for group selection; imap.el, mailcap.el, message.el, mm-util.el, nnheader.el, nnmail.el, pop3.el: Remove references to outdated systems; References to win32 w32 mswindows ms-windows emx were probably cargo-culted, and are removed for clarity; By Lars Magne Ingebrigtsen <larsi@gnus.org>.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110027
diff changeset
6440 '(ms-dos windows-nt cygwin))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6441 "message"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6442 "*message*")
98344
7fa3e064d230 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 97972
diff changeset
6443 (format-time-string "-%Y%m%d-%H%M%S"))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6444 message-auto-save-directory))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6445 (setq buffer-auto-save-file-name (make-auto-save-file-name)))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6446 (clear-visited-file-modtime)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6447 (setq buffer-file-coding-system message-draft-coding-system)))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6448
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6449 (defun message-disassociate-draft ()
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6450 "Disassociate the message buffer from the drafts directory."
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6451 (when message-draft-article
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6452 (nndraft-request-expire-articles
95580
00fc076296f8 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 95451
diff changeset
6453 (list message-draft-article) "drafts" nil t)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6454
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6455 (defun message-insert-headers ()
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6456 "Generate the headers for the article."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6457 (interactive)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6458 (save-excursion
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6459 (save-restriction
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6460 (message-narrow-to-headers)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6461 (when (message-news-p)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6462 (message-generate-headers
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6463 (delq 'Lines
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6464 (delq 'Subject
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6465 (copy-sequence message-required-news-headers)))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6466 (when (message-mail-p)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6467 (message-generate-headers
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6468 (delq 'Lines
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6469 (delq 'Subject
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6470 (copy-sequence message-required-mail-headers))))))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6471
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6472
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6473
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6474 ;;;
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6475 ;;; Commands for interfacing with message
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6476 ;;;
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6477
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6478 ;;;###autoload
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6479 (defun message-mail (&optional to subject
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6480 other-headers continue switch-function
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6481 yank-action send-actions)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6482 "Start editing a mail message to be sent.
76650
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6483 OTHER-HEADERS is an alist of header/value pairs. CONTINUE says whether
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6484 to continue editing a message already being composed. SWITCH-FUNCTION
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6485 is a function used to switch to and display the mail buffer."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6486 (interactive)
106890
2ed4eab78ca3 * message.el (message-mail): Just pass yank-action on to message-setup.
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
6487 (let ((message-this-is-mail t))
34797
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6488 (unless (message-mail-user-agent)
77819
20662529a1ae (message-pop-to-buffer): Add switch-function argument.
Chong Yidong <cyd@stupidchicken.com>
parents: 77114
diff changeset
6489 (message-pop-to-buffer
76650
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6490 ;; Search for the existing message buffer if `continue' is non-nil.
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6491 (let ((message-generate-new-buffers
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6492 (when (or (not continue)
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6493 (eq message-generate-new-buffers 'standard)
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6494 (functionp message-generate-new-buffers))
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
6495 message-generate-new-buffers)))
77819
20662529a1ae (message-pop-to-buffer): Add switch-function argument.
Chong Yidong <cyd@stupidchicken.com>
parents: 77114
diff changeset
6496 (message-buffer-name "mail" to))
20662529a1ae (message-pop-to-buffer): Add switch-function argument.
Chong Yidong <cyd@stupidchicken.com>
parents: 77114
diff changeset
6497 switch-function))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6498 (message-setup
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6499 (nconc
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6500 `((To . ,(or to "")) (Subject . ,(or subject "")))
34859
596342378358 * message.el (message-mail): Support yank-action.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34858
diff changeset
6501 (when other-headers other-headers))
106890
2ed4eab78ca3 * message.el (message-mail): Just pass yank-action on to message-setup.
Chong Yidong <cyd@stupidchicken.com>
parents: 106815
diff changeset
6502 yank-action send-actions continue switch-function)
34859
596342378358 * message.el (message-mail): Support yank-action.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34858
diff changeset
6503 ;; FIXME: Should return nil if failure.
596342378358 * message.el (message-mail): Support yank-action.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34858
diff changeset
6504 t))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6505
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6506 ;;;###autoload
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6507 (defun message-news (&optional newsgroups subject)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6508 "Start editing a news article to be sent."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6509 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6510 (let ((message-this-is-news t))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6511 (message-pop-to-buffer (message-buffer-name "posting" nil newsgroups))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6512 (message-setup `((Newsgroups . ,(or newsgroups ""))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6513 (Subject . ,(or subject ""))))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6514
93386
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
6515 (defun message-alter-recipients-discard-bogus-full-name (addrcell)
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
6516 "Discard mail address in full names.
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
6517 When the full name in reply headers contains the mail
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
6518 address (e.g. \"foo@bar <foo@bar>\"), discard full name.
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
6519 ADDRCELL is a cons cell where the car is the mail address and the
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
6520 cdr is the complete address (full name and mail address)."
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
6521 (if (string-match (concat (regexp-quote (car addrcell)) ".*"
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
6522 (regexp-quote (car addrcell)))
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
6523 (cdr addrcell))
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
6524 (cons (car addrcell) (car addrcell))
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
6525 addrcell))
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
6526
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
6527 (defcustom message-alter-recipients-function nil
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
6528 "Function called to allow alteration of reply header structures.
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
6529 It is called in `message-get-reply-headers' for each recipient.
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
6530 The function is called with one parameter, a cons cell ..."
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
6531 :type '(choice (const :tag "None" nil)
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
6532 (const :tag "Discard bogus full name"
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
6533 message-alter-recipients-discard-bogus-full-name)
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
6534 function)
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
6535 :version "23.1" ;; No Gnus
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
6536 :group 'message-headers)
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
6537
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6538 (defun message-get-reply-headers (wide &optional to-address address-headers)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6539 (let (follow-to mct never-mct to cc author mft recipients extra)
110073
38805092633e gnus-ems.el: Provide compatibility functions for gnus-set-process-plist by Katsumi Yamaoka <yamaoka@jpl.org>; gnus-html.el: Use gnus-process-plist and friends for compatibility; gnus-cite.el: New function to guess whether a long line is natural text or not; message.el: Implement message-prune-recipient-rules; by Lars Magne Ingebrigtsen <larsi@gnus.org>.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110064
diff changeset
6540 ;; Find all relevant headers we need.
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6541 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6542 (message-narrow-to-headers-or-head)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6543 ;; Gmane renames "To". Look at "Original-To", too, if it is present in
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6544 ;; message-header-synonyms.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6545 (setq to (or (message-fetch-field "to")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6546 (and (loop for synonym in message-header-synonyms
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6547 when (memq 'Original-To synonym)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6548 return t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6549 (message-fetch-field "original-to")))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6550 cc (message-fetch-field "cc")
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6551 extra (when message-extra-wide-headers
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6552 (mapconcat 'identity
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6553 (mapcar 'message-fetch-field
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6554 message-extra-wide-headers)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6555 ", "))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6556 mct (message-fetch-field "mail-copies-to")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6557 author (or (message-fetch-field "mail-reply-to")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6558 (message-fetch-field "reply-to")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6559 (message-fetch-field "from")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6560 "")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6561 mft (and message-use-mail-followup-to
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6562 (message-fetch-field "mail-followup-to"))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6563
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6564 ;; Handle special values of Mail-Copies-To.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6565 (when mct
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6566 (cond ((or (equal (downcase mct) "never")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6567 (equal (downcase mct) "nobody"))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6568 (setq never-mct t)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6569 (setq mct nil))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6570 ((or (equal (downcase mct) "always")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6571 (equal (downcase mct) "poster"))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6572 (setq mct author))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6573
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6574 (save-match-data
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6575 ;; Build (textual) list of new recipient addresses.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6576 (cond
111030
fdb969225593 message.el (message-get-reply-headers): If we're fed `to-address', then always use that.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110918
diff changeset
6577 (to-address
fdb969225593 message.el (message-get-reply-headers): If we're fed `to-address', then always use that.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110918
diff changeset
6578 (setq recipients (concat ", " to-address))
fdb969225593 message.el (message-get-reply-headers): If we're fed `to-address', then always use that.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110918
diff changeset
6579 ;; If the author explicitly asked for a copy, we don't deny it to them.
fdb969225593 message.el (message-get-reply-headers): If we're fed `to-address', then always use that.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110918
diff changeset
6580 (if mct (setq recipients (concat recipients ", " mct))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6581 ((not wide)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6582 (setq recipients (concat ", " author)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6583 (address-headers
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6584 (dolist (header address-headers)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6585 (let ((value (message-fetch-field header)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6586 (when value
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6587 (setq recipients (concat recipients ", " value))))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6588 ((and mft
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6589 (string-match "[^ \t,]" mft)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6590 (or (not (eq message-use-mail-followup-to 'ask))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6591 (message-y-or-n-p "Obey Mail-Followup-To? " t "\
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6592 You should normally obey the Mail-Followup-To: header. In this
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6593 article, it has the value of
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6594
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6595 " mft "
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6596
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6597 which directs your response to " (if (string-match "," mft)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6598 "the specified addresses"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6599 "that address only") ".
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6600
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6601 Most commonly, Mail-Followup-To is used by a mailing list poster to
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6602 express that responses should be sent to just the list, and not the
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6603 poster as well.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6604
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6605 If a message is posted to several mailing lists, Mail-Followup-To may
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6606 also be used to direct the following discussion to one list only,
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6607 because discussions that are spread over several lists tend to be
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6608 fragmented and very difficult to follow.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6609
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6610 Also, some source/announcement lists are not intended for discussion;
60356
3f394ef46f57 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-151
Miles Bader <miles@gnu.org>
parents: 59996
diff changeset
6611 responses here are directed to other addresses.
3f394ef46f57 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-151
Miles Bader <miles@gnu.org>
parents: 59996
diff changeset
6612
3f394ef46f57 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-151
Miles Bader <miles@gnu.org>
parents: 59996
diff changeset
6613 You may customize the variable `message-use-mail-followup-to', if you
3f394ef46f57 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-151
Miles Bader <miles@gnu.org>
parents: 59996
diff changeset
6614 want to get rid of this query permanently.")))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6615 (setq recipients (concat ", " mft)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6616 (t
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6617 (setq recipients (if never-mct "" (concat ", " author)))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6618 (if to (setq recipients (concat recipients ", " to)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6619 (if cc (setq recipients (concat recipients ", " cc)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6620 (if extra (setq recipients (concat recipients ", " extra)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6621 (if mct (setq recipients (concat recipients ", " mct)))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6622 (if (>= (length recipients) 2)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6623 ;; Strip the leading ", ".
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6624 (setq recipients (substring recipients 2)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6625 ;; Squeeze whitespace.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6626 (while (string-match "[ \t][ \t]+" recipients)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6627 (setq recipients (replace-match " " t t recipients)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6628 ;; Remove addresses that match `rmail-dont-reply-to-names'.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6629 (let ((rmail-dont-reply-to-names (message-dont-reply-to-names)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6630 (setq recipients (rmail-dont-reply-to recipients)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6631 ;; Perhaps "Mail-Copies-To: never" removed the only address?
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6632 (if (string-equal recipients "")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6633 (setq recipients author))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6634 ;; Convert string to a list of (("foo@bar" . "Name <Foo@BAR>") ...).
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6635 (setq recipients
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6636 (mapcar
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6637 (lambda (addr)
93386
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
6638 (if message-alter-recipients-function
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
6639 (funcall message-alter-recipients-function
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
6640 (cons (downcase (mail-strip-quoted-names addr))
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
6641 addr))
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
6642 (cons (downcase (mail-strip-quoted-names addr)) addr)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6643 (message-tokenize-header recipients)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6644 ;; Remove first duplicates. (Why not all duplicates? Is this a bug?)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6645 (let ((s recipients))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6646 (while s
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6647 (setq recipients (delq (assoc (car (pop s)) s) recipients))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6648
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6649 ;; Remove hierarchical lists that are contained within each other,
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6650 ;; if message-hierarchical-addresses is defined.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6651 (when message-hierarchical-addresses
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6652 (let ((plain-addrs (mapcar 'car recipients))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6653 subaddrs recip)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6654 (while plain-addrs
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6655 (setq subaddrs (assoc (car plain-addrs)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6656 message-hierarchical-addresses)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6657 plain-addrs (cdr plain-addrs))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6658 (when subaddrs
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6659 (setq subaddrs (cdr subaddrs))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6660 (while subaddrs
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6661 (setq recip (assoc (car subaddrs) recipients)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6662 subaddrs (cdr subaddrs))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6663 (if recip
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6664 (setq recipients (delq recip recipients))))))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6665
110073
38805092633e gnus-ems.el: Provide compatibility functions for gnus-set-process-plist by Katsumi Yamaoka <yamaoka@jpl.org>; gnus-html.el: Use gnus-process-plist and friends for compatibility; gnus-cite.el: New function to guess whether a long line is natural text or not; message.el: Implement message-prune-recipient-rules; by Lars Magne Ingebrigtsen <larsi@gnus.org>.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110064
diff changeset
6666 (setq recipients (message-prune-recipients recipients))
110111
5b9f64b04a04 Delete all trailing white space.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110102
diff changeset
6667
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6668 ;; Build the header alist. Allow the user to be asked whether
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6669 ;; or not to reply to all recipients in a wide reply.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6670 (setq follow-to (list (cons 'To (cdr (pop recipients)))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6671 (when (and recipients
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6672 (or (not message-wide-reply-confirm-recipients)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6673 (y-or-n-p "Reply to all recipients? ")))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6674 (setq recipients (mapconcat
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6675 (lambda (addr) (cdr addr)) recipients ", "))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6676 (if (string-match "^ +" recipients)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6677 (setq recipients (substring recipients (match-end 0))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6678 (push (cons 'Cc recipients) follow-to)))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6679 follow-to))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6680
110073
38805092633e gnus-ems.el: Provide compatibility functions for gnus-set-process-plist by Katsumi Yamaoka <yamaoka@jpl.org>; gnus-html.el: Use gnus-process-plist and friends for compatibility; gnus-cite.el: New function to guess whether a long line is natural text or not; message.el: Implement message-prune-recipient-rules; by Lars Magne Ingebrigtsen <larsi@gnus.org>.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110064
diff changeset
6681 (defun message-prune-recipients (recipients)
38805092633e gnus-ems.el: Provide compatibility functions for gnus-set-process-plist by Katsumi Yamaoka <yamaoka@jpl.org>; gnus-html.el: Use gnus-process-plist and friends for compatibility; gnus-cite.el: New function to guess whether a long line is natural text or not; message.el: Implement message-prune-recipient-rules; by Lars Magne Ingebrigtsen <larsi@gnus.org>.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110064
diff changeset
6682 (dolist (rule message-prune-recipient-rules)
38805092633e gnus-ems.el: Provide compatibility functions for gnus-set-process-plist by Katsumi Yamaoka <yamaoka@jpl.org>; gnus-html.el: Use gnus-process-plist and friends for compatibility; gnus-cite.el: New function to guess whether a long line is natural text or not; message.el: Implement message-prune-recipient-rules; by Lars Magne Ingebrigtsen <larsi@gnus.org>.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110064
diff changeset
6683 (let ((match (car rule))
110111
5b9f64b04a04 Delete all trailing white space.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110102
diff changeset
6684 dup-match
110073
38805092633e gnus-ems.el: Provide compatibility functions for gnus-set-process-plist by Katsumi Yamaoka <yamaoka@jpl.org>; gnus-html.el: Use gnus-process-plist and friends for compatibility; gnus-cite.el: New function to guess whether a long line is natural text or not; message.el: Implement message-prune-recipient-rules; by Lars Magne Ingebrigtsen <larsi@gnus.org>.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110064
diff changeset
6685 address)
38805092633e gnus-ems.el: Provide compatibility functions for gnus-set-process-plist by Katsumi Yamaoka <yamaoka@jpl.org>; gnus-html.el: Use gnus-process-plist and friends for compatibility; gnus-cite.el: New function to guess whether a long line is natural text or not; message.el: Implement message-prune-recipient-rules; by Lars Magne Ingebrigtsen <larsi@gnus.org>.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110064
diff changeset
6686 (dolist (recipient recipients)
38805092633e gnus-ems.el: Provide compatibility functions for gnus-set-process-plist by Katsumi Yamaoka <yamaoka@jpl.org>; gnus-html.el: Use gnus-process-plist and friends for compatibility; gnus-cite.el: New function to guess whether a long line is natural text or not; message.el: Implement message-prune-recipient-rules; by Lars Magne Ingebrigtsen <larsi@gnus.org>.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110064
diff changeset
6687 (setq address (car recipient))
38805092633e gnus-ems.el: Provide compatibility functions for gnus-set-process-plist by Katsumi Yamaoka <yamaoka@jpl.org>; gnus-html.el: Use gnus-process-plist and friends for compatibility; gnus-cite.el: New function to guess whether a long line is natural text or not; message.el: Implement message-prune-recipient-rules; by Lars Magne Ingebrigtsen <larsi@gnus.org>.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110064
diff changeset
6688 (when (string-match match address)
38805092633e gnus-ems.el: Provide compatibility functions for gnus-set-process-plist by Katsumi Yamaoka <yamaoka@jpl.org>; gnus-html.el: Use gnus-process-plist and friends for compatibility; gnus-cite.el: New function to guess whether a long line is natural text or not; message.el: Implement message-prune-recipient-rules; by Lars Magne Ingebrigtsen <larsi@gnus.org>.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110064
diff changeset
6689 (setq dup-match (replace-match (cadr rule) nil nil address))
38805092633e gnus-ems.el: Provide compatibility functions for gnus-set-process-plist by Katsumi Yamaoka <yamaoka@jpl.org>; gnus-html.el: Use gnus-process-plist and friends for compatibility; gnus-cite.el: New function to guess whether a long line is natural text or not; message.el: Implement message-prune-recipient-rules; by Lars Magne Ingebrigtsen <larsi@gnus.org>.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110064
diff changeset
6690 (dolist (recipient recipients)
38805092633e gnus-ems.el: Provide compatibility functions for gnus-set-process-plist by Katsumi Yamaoka <yamaoka@jpl.org>; gnus-html.el: Use gnus-process-plist and friends for compatibility; gnus-cite.el: New function to guess whether a long line is natural text or not; message.el: Implement message-prune-recipient-rules; by Lars Magne Ingebrigtsen <larsi@gnus.org>.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110064
diff changeset
6691 ;; Don't delete the address that triggered this.
38805092633e gnus-ems.el: Provide compatibility functions for gnus-set-process-plist by Katsumi Yamaoka <yamaoka@jpl.org>; gnus-html.el: Use gnus-process-plist and friends for compatibility; gnus-cite.el: New function to guess whether a long line is natural text or not; message.el: Implement message-prune-recipient-rules; by Lars Magne Ingebrigtsen <larsi@gnus.org>.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110064
diff changeset
6692 (when (and (not (eq address (car recipient)))
38805092633e gnus-ems.el: Provide compatibility functions for gnus-set-process-plist by Katsumi Yamaoka <yamaoka@jpl.org>; gnus-html.el: Use gnus-process-plist and friends for compatibility; gnus-cite.el: New function to guess whether a long line is natural text or not; message.el: Implement message-prune-recipient-rules; by Lars Magne Ingebrigtsen <larsi@gnus.org>.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110064
diff changeset
6693 (string-match dup-match (car recipient)))
38805092633e gnus-ems.el: Provide compatibility functions for gnus-set-process-plist by Katsumi Yamaoka <yamaoka@jpl.org>; gnus-html.el: Use gnus-process-plist and friends for compatibility; gnus-cite.el: New function to guess whether a long line is natural text or not; message.el: Implement message-prune-recipient-rules; by Lars Magne Ingebrigtsen <larsi@gnus.org>.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110064
diff changeset
6694 (setq recipients (delq recipient recipients))))))))
38805092633e gnus-ems.el: Provide compatibility functions for gnus-set-process-plist by Katsumi Yamaoka <yamaoka@jpl.org>; gnus-html.el: Use gnus-process-plist and friends for compatibility; gnus-cite.el: New function to guess whether a long line is natural text or not; message.el: Implement message-prune-recipient-rules; by Lars Magne Ingebrigtsen <larsi@gnus.org>.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110064
diff changeset
6695 recipients)
38805092633e gnus-ems.el: Provide compatibility functions for gnus-set-process-plist by Katsumi Yamaoka <yamaoka@jpl.org>; gnus-html.el: Use gnus-process-plist and friends for compatibility; gnus-cite.el: New function to guess whether a long line is natural text or not; message.el: Implement message-prune-recipient-rules; by Lars Magne Ingebrigtsen <larsi@gnus.org>.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110064
diff changeset
6696
74021
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
6697 (defcustom message-simplify-subject-functions
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
6698 '(message-strip-list-identifiers
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
6699 message-strip-subject-re
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
6700 message-strip-subject-trailing-was
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
6701 message-strip-subject-encoded-words)
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
6702 "List of functions taking a string argument that simplify subjects.
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
6703 The functions are applied when replying to a message.
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
6704
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
6705 Useful functions to put in this list include:
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
6706 `message-strip-list-identifiers', `message-strip-subject-re',
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
6707 `message-strip-subject-trailing-was', and
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
6708 `message-strip-subject-encoded-words'."
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
6709 :version "22.1" ;; Gnus 5.10.9
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
6710 :group 'message-various
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
6711 :type '(repeat function))
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
6712
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
6713 (defun message-simplify-subject (subject &optional functions)
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
6714 "Return simplified SUBJECT."
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
6715 (unless functions
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
6716 ;; Simplify fully:
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
6717 (setq functions message-simplify-subject-functions))
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
6718 (when (and (memq 'message-strip-list-identifiers functions)
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
6719 gnus-list-identifiers)
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
6720 (setq subject (message-strip-list-identifiers subject)))
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
6721 (when (memq 'message-strip-subject-re functions)
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
6722 (setq subject (concat "Re: " (message-strip-subject-re subject))))
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
6723 (when (and (memq 'message-strip-subject-trailing-was functions)
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
6724 message-subject-trailing-was-query)
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
6725 (setq subject (message-strip-subject-trailing-was subject)))
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
6726 (when (memq 'message-strip-subject-encoded-words functions)
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
6727 (setq subject (message-strip-subject-encoded-words subject)))
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
6728 subject)
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
6729
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6730 ;;;###autoload
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6731 (defun message-reply (&optional to-address wide)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6732 "Start editing a reply to the article in the current buffer."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6733 (interactive)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6734 (require 'gnus-sum) ; for gnus-list-identifiers
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6735 (let ((cur (current-buffer))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6736 from subject date reply-to to cc
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6737 references message-id follow-to
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6738 (inhibit-point-motion-hooks t)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6739 (message-this-is-mail t)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6740 gnus-warning)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6741 (save-restriction
34752
f04f551e94ce * message.el (message-narrow-to-head-1): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34485
diff changeset
6742 (message-narrow-to-head-1)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6743 ;; Allow customizations to have their say.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6744 (if (not wide)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6745 ;; This is a regular reply.
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6746 (when (functionp message-reply-to-function)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6747 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6748 (setq follow-to (funcall message-reply-to-function))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6749 ;; This is a followup.
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6750 (when (functionp message-wide-reply-to-function)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6751 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6752 (setq follow-to
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6753 (funcall message-wide-reply-to-function)))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6754 (setq message-id (message-fetch-field "message-id" t)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6755 references (message-fetch-field "references")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6756 date (message-fetch-field "date")
73007
637b0854d9b5 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 72636
diff changeset
6757 from (or (message-fetch-field "from") "nobody")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6758 subject (or (message-fetch-field "subject") "none"))
74021
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
6759
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
6760 ;; Strip list identifiers, "Re: ", and "was:"
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
6761 (setq subject (message-simplify-subject subject))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6762
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6763 (when (and (setq gnus-warning (message-fetch-field "gnus-warning"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6764 (string-match "<[^>]+>" gnus-warning))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6765 (setq message-id (match-string 0 gnus-warning)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6766
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6767 (unless follow-to
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6768 (setq follow-to (message-get-reply-headers wide to-address))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6769
34797
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6770 (unless (message-mail-user-agent)
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6771 (message-pop-to-buffer
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6772 (message-buffer-name
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6773 (if wide "wide reply" "reply") from
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6774 (if wide to-address nil))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6775
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6776 (setq message-reply-headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6777 (vector 0 subject from date message-id references 0 0 ""))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6778
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6779 (message-setup
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6780 `((Subject . ,subject)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6781 ,@follow-to)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6782 cur)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6783
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6784 ;;;###autoload
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6785 (defun message-wide-reply (&optional to-address)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6786 "Make a \"wide\" reply to the message in the current buffer."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6787 (interactive)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6788 (message-reply to-address t))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6789
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6790 ;;;###autoload
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6791 (defun message-followup (&optional to-newsgroups)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6792 "Follow up to the message in the current buffer.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6793 If TO-NEWSGROUPS, use that as the new Newsgroups line."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6794 (interactive)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6795 (require 'gnus-sum) ; for gnus-list-identifiers
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6796 (let ((cur (current-buffer))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6797 from subject date reply-to mrt mct
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6798 references message-id follow-to
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6799 (inhibit-point-motion-hooks t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6800 (message-this-is-news t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6801 followup-to distribution newsgroups gnus-warning posted-to)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6802 (save-restriction
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6803 (narrow-to-region
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6804 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6805 (if (search-forward "\n\n" nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6806 (1- (point))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6807 (point-max)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6808 (when (functionp message-followup-to-function)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6809 (setq follow-to
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6810 (funcall message-followup-to-function)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6811 (setq from (message-fetch-field "from")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6812 date (message-fetch-field "date")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6813 subject (or (message-fetch-field "subject") "none")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6814 references (message-fetch-field "references")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6815 message-id (message-fetch-field "message-id" t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6816 followup-to (message-fetch-field "followup-to")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6817 newsgroups (message-fetch-field "newsgroups")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6818 posted-to (message-fetch-field "posted-to")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6819 reply-to (message-fetch-field "reply-to")
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6820 mrt (message-fetch-field "mail-reply-to")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6821 distribution (message-fetch-field "distribution")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6822 mct (message-fetch-field "mail-copies-to"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6823 (when (and (setq gnus-warning (message-fetch-field "gnus-warning"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6824 (string-match "<[^>]+>" gnus-warning))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6825 (setq message-id (match-string 0 gnus-warning)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6826 ;; Remove bogus distribution.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6827 (when (and (stringp distribution)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6828 (let ((case-fold-search t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6829 (string-match "world" distribution)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6830 (setq distribution nil))
74021
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
6831 ;; Strip list identifiers, "Re: ", and "was:"
234305495123 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 73487
diff changeset
6832 (setq subject (message-simplify-subject subject))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6833 (widen))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6834
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6835 (message-pop-to-buffer (message-buffer-name "followup" from newsgroups))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6836
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6837 (setq message-reply-headers
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6838 (vector 0 subject from date message-id references 0 0 ""))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6839
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6840 (message-setup
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6841 `((Subject . ,subject)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6842 ,@(cond
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6843 (to-newsgroups
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6844 (list (cons 'Newsgroups to-newsgroups)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6845 (follow-to follow-to)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6846 ((and followup-to message-use-followup-to)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6847 (list
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6848 (cond
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6849 ((equal (downcase followup-to) "poster")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6850 (if (or (eq message-use-followup-to 'use)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6851 (message-y-or-n-p "Obey Followup-To: poster? " t "\
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6852 You should normally obey the Followup-To: header.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6853
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6854 `Followup-To: poster' sends your response via e-mail instead of news.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6855
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6856 A typical situation where `Followup-To: poster' is used is when the poster
60356
3f394ef46f57 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-151
Miles Bader <miles@gnu.org>
parents: 59996
diff changeset
6857 does not read the newsgroup, so he wouldn't see any replies sent to it.
3f394ef46f57 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-151
Miles Bader <miles@gnu.org>
parents: 59996
diff changeset
6858
3f394ef46f57 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-151
Miles Bader <miles@gnu.org>
parents: 59996
diff changeset
6859 You may customize the variable `message-use-followup-to', if you
3f394ef46f57 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-151
Miles Bader <miles@gnu.org>
parents: 59996
diff changeset
6860 want to get rid of this query permanently."))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6861 (progn
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6862 (setq message-this-is-news nil)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6863 (cons 'To (or mrt reply-to from "")))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6864 (cons 'Newsgroups newsgroups)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6865 (t
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6866 (if (or (equal followup-to newsgroups)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6867 (not (eq message-use-followup-to 'ask))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6868 (message-y-or-n-p
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6869 (concat "Obey Followup-To: " followup-to "? ") t "\
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6870 You should normally obey the Followup-To: header.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6871
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6872 `Followup-To: " followup-to "'
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6873 directs your response to " (if (string-match "," followup-to)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6874 "the specified newsgroups"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6875 "that newsgroup only") ".
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6876
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6877 If a message is posted to several newsgroups, Followup-To is often
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6878 used to direct the following discussion to one newsgroup only,
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6879 because discussions that are spread over several newsgroup tend to
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6880 be fragmented and very difficult to follow.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6881
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6882 Also, some source/announcement newsgroups are not intended for discussion;
60356
3f394ef46f57 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-151
Miles Bader <miles@gnu.org>
parents: 59996
diff changeset
6883 responses here are directed to other newsgroups.
3f394ef46f57 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-151
Miles Bader <miles@gnu.org>
parents: 59996
diff changeset
6884
3f394ef46f57 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-151
Miles Bader <miles@gnu.org>
parents: 59996
diff changeset
6885 You may customize the variable `message-use-followup-to', if you
3f394ef46f57 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-151
Miles Bader <miles@gnu.org>
parents: 59996
diff changeset
6886 want to get rid of this query permanently."))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6887 (cons 'Newsgroups followup-to)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6888 (cons 'Newsgroups newsgroups))))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6889 (posted-to
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6890 `((Newsgroups . ,posted-to)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6891 (t
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6892 `((Newsgroups . ,newsgroups))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6893 ,@(and distribution (list (cons 'Distribution distribution)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6894 ,@(when (and mct
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6895 (not (or (equal (downcase mct) "never")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6896 (equal (downcase mct) "nobody"))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6897 (list (cons 'Cc (if (or (equal (downcase mct) "always")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6898 (equal (downcase mct) "poster"))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6899 (or mrt reply-to from "")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6900 mct)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6901
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6902 cur)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6903
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6904 (defun message-is-yours-p ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6905 "Non-nil means current article is yours.
63398
2f37f6737221 (message-is-yours-p): Fix quoting.
Juanma Barranquero <lekktu@gmail.com>
parents: 62755
diff changeset
6906 If you have added 'cancel-messages to `message-shoot-gnksa-feet', all articles
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6907 are yours except those that have Cancel-Lock header not belonging to you.
63398
2f37f6737221 (message-is-yours-p): Fix quoting.
Juanma Barranquero <lekktu@gmail.com>
parents: 62755
diff changeset
6908 Instead of shooting GNKSA feet, you should modify `message-alternative-emails'
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6909 regexp to match all of yours addresses."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6910 ;; Canlock-logic as suggested by Per Abrahamsen
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6911 ;; <abraham@dina.kvl.dk>
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6912 ;;
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6913 ;; IF article has cancel-lock THEN
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6914 ;; IF we can verify it THEN
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6915 ;; issue cancel
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6916 ;; ELSE
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6917 ;; error: cancellock: article is not yours
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6918 ;; ELSE
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6919 ;; Use old rules, comparing sender...
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6920 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6921 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6922 (message-narrow-to-head-1)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6923 (if (message-fetch-field "Cancel-Lock")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6924 (if (null (canlock-verify))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6925 t
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6926 (error "Failed to verify Cancel-lock: This article is not yours"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6927 (let (sender from)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6928 (or
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6929 (message-gnksa-enable-p 'cancel-messages)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6930 (and (setq sender (message-fetch-field "sender"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6931 (string-equal (downcase sender)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6932 (downcase (message-make-sender))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6933 ;; Email address in From field equals to our address
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6934 (and (setq from (message-fetch-field "from"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6935 (string-equal
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6936 (downcase (car (mail-header-parse-address from)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6937 (downcase (car (mail-header-parse-address
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6938 (message-make-from))))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6939 ;; Email address in From field matches
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6940 ;; 'message-alternative-emails' regexp
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6941 (and from
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6942 message-alternative-emails
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6943 (string-match
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6944 message-alternative-emails
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
6945 (car (mail-header-parse-address from))))))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6946
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6947 ;;;###autoload
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6948 (defun message-cancel-news (&optional arg)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6949 "Cancel an article you posted.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6950 If ARG, allow editing of the cancellation message."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6951 (interactive "P")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6952 (unless (message-news-p)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6953 (error "This is not a news article; canceling is impossible"))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6954 (let (from newsgroups message-id distribution buf)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6955 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6956 ;; Get header info from original article.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6957 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6958 (message-narrow-to-head-1)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6959 (setq from (message-fetch-field "from")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6960 newsgroups (message-fetch-field "newsgroups")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6961 message-id (message-fetch-field "message-id" t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6962 distribution (message-fetch-field "distribution")))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6963 ;; Make sure that this article was written by the user.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6964 (unless (message-is-yours-p)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6965 (error "This article is not yours"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6966 (when (yes-or-no-p "Do you really want to cancel this article? ")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6967 ;; Make control message.
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6968 (if arg
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6969 (message-news)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6970 (setq buf (set-buffer (get-buffer-create " *message cancel*"))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6971 (erase-buffer)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
6972 (insert "Newsgroups: " newsgroups "\n"
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
6973 "From: " from "\n"
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
6974 "Subject: cmsg cancel " message-id "\n"
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
6975 "Control: cancel " message-id "\n"
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6976 (if distribution
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
6977 (concat "Distribution: " distribution "\n")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6978 "")
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
6979 mail-header-separator "\n"
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6980 message-cancel-message)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6981 (run-hooks 'message-cancel-hook)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6982 (unless arg
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6983 (message "Canceling your article...")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6984 (if (let ((message-syntax-checks
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6985 'dont-check-for-anything-just-trust-me))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6986 (funcall message-send-news-function))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6987 (message "Canceling your article...done"))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6988 (kill-buffer buf))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6989
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6990 ;;;###autoload
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6991 (defun message-supersede ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6992 "Start composing a message to supersede the current message.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6993 This is done simply by taking the old article and adding a Supersedes
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6994 header line with the old Message-ID."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6995 (interactive)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6996 (let ((cur (current-buffer)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6997 ;; Check whether the user owns the article that is to be superseded.
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6998 (unless (message-is-yours-p)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6999 (error "This article is not yours"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7000 ;; Get a normal message buffer.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7001 (message-pop-to-buffer (message-buffer-name "supersede"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7002 (insert-buffer-substring cur)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7003 (mime-to-mml)
34752
f04f551e94ce * message.el (message-narrow-to-head-1): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34485
diff changeset
7004 (message-narrow-to-head-1)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7005 ;; Remove unwanted headers.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7006 (when message-ignored-supersedes-headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7007 (message-remove-header message-ignored-supersedes-headers t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7008 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7009 (if (not (re-search-forward "^Message-ID: " nil t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7010 (error "No Message-ID in this article")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7011 (replace-match "Supersedes: " t t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7012 (goto-char (point-max))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7013 (insert mail-header-separator)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7014 (widen)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7015 (forward-line 1)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7016
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7017 ;;;###autoload
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7018 (defun message-recover ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7019 "Reread contents of current buffer from its last auto-save file."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7020 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7021 (let ((file-name (make-auto-save-file-name)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7022 (cond ((save-window-excursion
97142
c3512b2085a0 * bitmaps/README:
Dan Nicolaescu <dann@ics.uci.edu>
parents: 96596
diff changeset
7023 (with-output-to-temp-buffer "*Directory*"
c3512b2085a0 * bitmaps/README:
Dan Nicolaescu <dann@ics.uci.edu>
parents: 96596
diff changeset
7024 (with-current-buffer standard-output
c3512b2085a0 * bitmaps/README:
Dan Nicolaescu <dann@ics.uci.edu>
parents: 96596
diff changeset
7025 (fundamental-mode)) ; for Emacs 20.4+
c3512b2085a0 * bitmaps/README:
Dan Nicolaescu <dann@ics.uci.edu>
parents: 96596
diff changeset
7026 (buffer-disable-undo standard-output)
c3512b2085a0 * bitmaps/README:
Dan Nicolaescu <dann@ics.uci.edu>
parents: 96596
diff changeset
7027 (let ((default-directory "/"))
c3512b2085a0 * bitmaps/README:
Dan Nicolaescu <dann@ics.uci.edu>
parents: 96596
diff changeset
7028 (call-process
c3512b2085a0 * bitmaps/README:
Dan Nicolaescu <dann@ics.uci.edu>
parents: 96596
diff changeset
7029 "ls" nil standard-output nil "-l" file-name)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7030 (yes-or-no-p (format "Recover auto save file %s? " file-name)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7031 (let ((buffer-read-only nil))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7032 (erase-buffer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7033 (insert-file-contents file-name nil)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7034 (t (error "message-recover cancelled")))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7035
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7036 ;;; Washing Subject:
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7037
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7038 (defun message-wash-subject (subject)
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
7039 "Remove junk like \"Re:\", \"(fwd)\", etc. added to subject string SUBJECT.
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
7040 Previous forwarders, replyers, etc. may add it."
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7041 (with-temp-buffer
41494
933ab100fb4a 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 36856
diff changeset
7042 (insert subject)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7043 (goto-char (point-min))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7044 ;; strip Re/Fwd stuff off the beginning
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7045 (while (re-search-forward
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7046 "\\([Rr][Ee]:\\|[Ff][Ww][Dd]\\(\\[[0-9]*\\]\\)?:\\|[Ff][Ww]:\\)" nil t)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7047 (replace-match ""))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7048
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7049 ;; and gnus-style forwards [foo@bar.com] subject
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7050 (goto-char (point-min))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7051 (while (re-search-forward "\\[[^ \t]*\\(@\\|\\.\\)[^ \t]*\\]" nil t)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7052 (replace-match ""))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7053
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7054 ;; and off the end
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7055 (goto-char (point-max))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7056 (while (re-search-backward "([Ff][Ww][Dd])" nil t)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7057 (replace-match ""))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7058
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7059 ;; and finally, any whitespace that was left-over
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7060 (goto-char (point-min))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7061 (while (re-search-forward "^[ \t]+" nil t)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7062 (replace-match ""))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7063 (goto-char (point-max))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7064 (while (re-search-backward "[ \t]+$" nil t)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7065 (replace-match ""))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7066
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7067 (buffer-string)))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7068
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7069 ;;; Forwarding messages.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7070
36856
e11fd97820c0 2001-03-17 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 36036
diff changeset
7071 (defvar message-forward-decoded-p nil
e11fd97820c0 2001-03-17 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 36036
diff changeset
7072 "Non-nil means the original message is decoded.")
e11fd97820c0 2001-03-17 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 36036
diff changeset
7073
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7074 (defun message-forward-subject-name-subject (subject)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7075 "Generate a SUBJECT for a forwarded message.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7076 The form is: [Source] Subject, where if the original message was mail,
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7077 Source is the name of the sender, and if the original message was
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7078 news, Source is the list of newsgroups is was posted to."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7079 (let* ((group (message-fetch-field "newsgroups"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7080 (from (message-fetch-field "from"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7081 (prefix
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7082 (if group
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7083 (gnus-group-decoded-name group)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7084 (or (and from (or
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7085 (car (gnus-extract-address-components from))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7086 (cadr (gnus-extract-address-components from))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7087 "(nowhere)"))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7088 (concat "["
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7089 (if message-forward-decoded-p
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7090 prefix
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7091 (mail-decode-encoded-word-string prefix))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7092 "] " subject)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7093
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7094 (defun message-forward-subject-author-subject (subject)
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
7095 "Generate a SUBJECT for a forwarded message.
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7096 The form is: [Source] Subject, where if the original message was mail,
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7097 Source is the sender, and if the original message was news, Source is
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7098 the list of newsgroups is was posted to."
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7099 (let* ((group (message-fetch-field "newsgroups"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7100 (prefix
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7101 (if group
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7102 (gnus-group-decoded-name group)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7103 (or (message-fetch-field "from")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7104 "(nowhere)"))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7105 (concat "["
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7106 (if message-forward-decoded-p
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7107 prefix
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7108 (mail-decode-encoded-word-string prefix))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7109 "] " subject)))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7110
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7111 (defun message-forward-subject-fwd (subject)
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
7112 "Generate a SUBJECT for a forwarded message.
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7113 The form is: Fwd: Subject, where Subject is the original subject of
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7114 the message."
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7115 (if (string-match "^Fwd: " subject)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7116 subject
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7117 (concat "Fwd: " subject)))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7118
36856
e11fd97820c0 2001-03-17 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 36036
diff changeset
7119 (defun message-make-forward-subject ()
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7120 "Return a Subject header suitable for the message in the current buffer."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7121 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7122 (save-restriction
34752
f04f551e94ce * message.el (message-narrow-to-head-1): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34485
diff changeset
7123 (message-narrow-to-head-1)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7124 (let ((funcs message-make-forward-subject-function)
34752
f04f551e94ce * message.el (message-narrow-to-head-1): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34485
diff changeset
7125 (subject (message-fetch-field "Subject")))
f04f551e94ce * message.el (message-narrow-to-head-1): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34485
diff changeset
7126 (setq subject
f04f551e94ce * message.el (message-narrow-to-head-1): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34485
diff changeset
7127 (if subject
36856
e11fd97820c0 2001-03-17 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 36036
diff changeset
7128 (if message-forward-decoded-p
35957
a35d9c07d074 2001-02-07 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 35453
diff changeset
7129 subject
a35d9c07d074 2001-02-07 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 35453
diff changeset
7130 (mail-decode-encoded-word-string subject))
34752
f04f551e94ce * message.el (message-narrow-to-head-1): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34485
diff changeset
7131 ""))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7132 (when message-wash-forwarded-subjects
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7133 (setq subject (message-wash-subject subject)))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7134 ;; Make sure funcs is a list.
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7135 (and funcs
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7136 (not (listp funcs))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7137 (setq funcs (list funcs)))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7138 ;; Apply funcs in order, passing subject generated by previous
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7139 ;; func to the next one.
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7140 (dolist (func funcs)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7141 (when (functionp func)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7142 (setq subject (funcall func subject))))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7143 subject))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7144
86154
1cdfc94602cb * smime.el (from):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85974
diff changeset
7145 (defvar gnus-article-decoded-p)
36856
e11fd97820c0 2001-03-17 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 36036
diff changeset
7146
41511
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
7147
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7148 ;;;###autoload
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7149 (defun message-forward (&optional news digest)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7150 "Forward the current message via mail.
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7151 Optional NEWS will use news to forward instead of mail.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7152 Optional DIGEST will use digest to forward."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7153 (interactive "P")
36856
e11fd97820c0 2001-03-17 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 36036
diff changeset
7154 (let* ((cur (current-buffer))
41511
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
7155 (message-forward-decoded-p
36856
e11fd97820c0 2001-03-17 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 36036
diff changeset
7156 (if (local-variable-p 'gnus-article-decoded-p (current-buffer))
41511
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
7157 gnus-article-decoded-p ;; In an article buffer.
36856
e11fd97820c0 2001-03-17 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 36036
diff changeset
7158 message-forward-decoded-p))
41511
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
7159 (subject (message-make-forward-subject)))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7160 (if news
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7161 (message-news nil subject)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7162 (message-mail nil subject))
41511
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
7163 (message-forward-make-body cur digest)))
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
7164
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7165 (defun message-forward-make-body-plain (forward-buffer)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7166 (insert
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
7167 "\n-------------------- Start of forwarded message --------------------\n")
108388
c8dacd2579e6 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108062
diff changeset
7168 (let ((b (point))
108504
a3051d2aefe7 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108388
diff changeset
7169 (contents (with-current-buffer forward-buffer (buffer-string)))
a3051d2aefe7 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108388
diff changeset
7170 e)
a3051d2aefe7 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108388
diff changeset
7171 (unless (featurep 'xemacs)
108513
4e5c3f6510c7 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108504
diff changeset
7172 (unless (mm-multibyte-string-p contents)
108504
a3051d2aefe7 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108388
diff changeset
7173 (error "Attempt to insert unibyte string from the buffer \"%s\"\
a3051d2aefe7 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108388
diff changeset
7174 to the multibyte buffer \"%s\""
a3051d2aefe7 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108388
diff changeset
7175 (if (bufferp forward-buffer)
a3051d2aefe7 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108388
diff changeset
7176 (buffer-name forward-buffer)
a3051d2aefe7 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108388
diff changeset
7177 forward-buffer)
a3051d2aefe7 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108388
diff changeset
7178 (buffer-name))))
a3051d2aefe7 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108388
diff changeset
7179 (insert (mm-with-multibyte-buffer
a3051d2aefe7 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108388
diff changeset
7180 (insert contents)
a3051d2aefe7 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108388
diff changeset
7181 (mime-to-mml)
a3051d2aefe7 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108388
diff changeset
7182 (goto-char (point-min))
a3051d2aefe7 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108388
diff changeset
7183 (when (looking-at "From ")
a3051d2aefe7 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108388
diff changeset
7184 (replace-match "X-From-Line: "))
a3051d2aefe7 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108388
diff changeset
7185 (buffer-string)))
a3051d2aefe7 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108388
diff changeset
7186 (unless (bolp) (insert "\n"))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7187 (setq e (point))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7188 (insert
108504
a3051d2aefe7 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108388
diff changeset
7189 "-------------------- End of forwarded message --------------------\n")
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7190 (message-remove-ignored-headers b e)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7191
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7192 (defun message-remove-ignored-headers (b e)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7193 (when message-forward-ignored-headers
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7194 (save-restriction
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7195 (narrow-to-region b e)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7196 (goto-char b)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7197 (narrow-to-region (point)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7198 (or (search-forward "\n\n" nil t) (point)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7199 (let ((ignored (if (stringp message-forward-ignored-headers)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7200 (list message-forward-ignored-headers)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7201 message-forward-ignored-headers)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7202 (dolist (elem ignored)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7203 (message-remove-header elem t))))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7204
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7205 (defun message-forward-make-body-mime (forward-buffer)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7206 (let ((b (point)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7207 (insert "\n\n<#part type=message/rfc822 disposition=inline raw=t>\n")
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7208 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7209 (narrow-to-region (point) (point))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7210 (mml-insert-buffer forward-buffer)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7211 (goto-char (point-min))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7212 (when (looking-at "From ")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7213 (replace-match "X-From-Line: "))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7214 (goto-char (point-max)))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7215 (insert "<#/part>\n")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7216 ;; Consider there is no illegible text.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7217 (add-text-properties
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7218 b (point)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7219 `(no-illegible-text t rear-nonsticky t start-open t))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7220
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7221 (defun message-forward-make-body-mml (forward-buffer)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
7222 (insert "\n\n<#mml type=message/rfc822 disposition=inline>\n")
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7223 (let ((b (point)) e)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7224 (if (not message-forward-decoded-p)
108504
a3051d2aefe7 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108388
diff changeset
7225 (let ((contents (with-current-buffer forward-buffer (buffer-string))))
a3051d2aefe7 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108388
diff changeset
7226 (unless (featurep 'xemacs)
108513
4e5c3f6510c7 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108504
diff changeset
7227 (unless (mm-multibyte-string-p contents)
108504
a3051d2aefe7 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108388
diff changeset
7228 (error "Attempt to insert unibyte string from the buffer \"%s\"\
a3051d2aefe7 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108388
diff changeset
7229 to the multibyte buffer \"%s\""
a3051d2aefe7 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108388
diff changeset
7230 (if (bufferp forward-buffer)
a3051d2aefe7 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108388
diff changeset
7231 (buffer-name forward-buffer)
a3051d2aefe7 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108388
diff changeset
7232 forward-buffer)
a3051d2aefe7 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108388
diff changeset
7233 (buffer-name))))
a3051d2aefe7 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108388
diff changeset
7234 (insert (mm-with-multibyte-buffer
a3051d2aefe7 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108388
diff changeset
7235 (insert contents)
a3051d2aefe7 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108388
diff changeset
7236 (mime-to-mml)
a3051d2aefe7 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108388
diff changeset
7237 (goto-char (point-min))
a3051d2aefe7 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108388
diff changeset
7238 (when (looking-at "From ")
a3051d2aefe7 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108388
diff changeset
7239 (replace-match "X-From-Line: "))
a3051d2aefe7 Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108388
diff changeset
7240 (buffer-string))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7241 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7242 (narrow-to-region (point) (point))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7243 (mml-insert-buffer forward-buffer)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7244 (goto-char (point-min))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7245 (when (looking-at "From ")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7246 (replace-match "X-From-Line: "))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7247 (goto-char (point-max))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7248 (setq e (point))
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
7249 (insert "<#/mml>\n")
58835
9bdd97960431 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents: 57856
diff changeset
7250 (when (and (not message-forward-decoded-p)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7251 message-forward-ignored-headers)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7252 (message-remove-ignored-headers b e))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7253
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7254 (defun message-forward-make-body-digest-plain (forward-buffer)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7255 (insert
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
7256 "\n-------------------- Start of forwarded message --------------------\n")
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7257 (let ((b (point)) e)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7258 (mml-insert-buffer forward-buffer)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7259 (setq e (point))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7260 (insert
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
7261 "\n-------------------- End of forwarded message --------------------\n")))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7262
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7263 (defun message-forward-make-body-digest-mime (forward-buffer)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
7264 (insert "\n<#multipart type=digest>\n")
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7265 (let ((b (point)) e)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7266 (insert-buffer-substring forward-buffer)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7267 (setq e (point))
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
7268 (insert "<#/multipart>\n")
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7269 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7270 (narrow-to-region b e)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7271 (goto-char b)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7272 (narrow-to-region (point)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7273 (or (search-forward "\n\n" nil t) (point)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7274 (delete-region (point-min) (point-max)))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7275
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7276 (defun message-forward-make-body-digest (forward-buffer)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7277 (if message-forward-as-mime
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7278 (message-forward-make-body-digest-mime forward-buffer)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7279 (message-forward-make-body-digest-plain forward-buffer)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7280
95820
645fb33380d6 Remove unnecessary eval-and-compile of autoloads.
Glenn Morris <rgm@gnu.org>
parents: 95580
diff changeset
7281 (autoload 'mm-uu-dissect-text-parts "mm-uu")
645fb33380d6 Remove unnecessary eval-and-compile of autoloads.
Glenn Morris <rgm@gnu.org>
parents: 95580
diff changeset
7282 (autoload 'mm-uu-dissect "mm-uu")
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7283
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7284 (defun message-signed-or-encrypted-p (&optional dont-emulate-mime handles)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7285 "Say whether the current buffer contains signed or encrypted message.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7286 If DONT-EMULATE-MIME is nil, this function does the MIME emulation on
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7287 messages that don't conform to PGP/MIME described in RFC2015. HANDLES
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7288 is for the internal use."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7289 (unless handles
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7290 (let ((mm-decrypt-option 'never)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7291 (mm-verify-option 'never))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7292 (if (setq handles (mm-dissect-buffer nil t))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7293 (unless dont-emulate-mime
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7294 (mm-uu-dissect-text-parts handles))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7295 (unless dont-emulate-mime
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7296 (setq handles (mm-uu-dissect))))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7297 ;; Check text/plain message in which there is a signed or encrypted
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7298 ;; body that has been encoded by B or Q.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7299 (unless (or handles dont-emulate-mime)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7300 (let ((cur (current-buffer))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7301 (mm-decrypt-option 'never)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7302 (mm-verify-option 'never))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7303 (with-temp-buffer
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7304 (insert-buffer-substring cur)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7305 (when (setq handles (mm-dissect-buffer t t))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7306 (if (and (prog1
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7307 (bufferp (car handles))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7308 (mm-destroy-parts handles))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7309 (equal (mm-handle-media-type handles) "text/plain"))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7310 (progn
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7311 (mm-decode-content-transfer-encoding
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7312 (mm-handle-encoding handles))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7313 (setq handles (mm-uu-dissect)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7314 (setq handles nil))))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7315 (when handles
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7316 (prog1
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7317 (catch 'found
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7318 (dolist (handle (if (stringp (car handles))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7319 (if (member (car handles)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7320 '("multipart/signed"
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7321 "multipart/encrypted"))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7322 (throw 'found t)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7323 (cdr handles))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7324 (list handles)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7325 (if (stringp (car handle))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7326 (when (message-signed-or-encrypted-p dont-emulate-mime handle)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7327 (throw 'found t))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7328 (when (and (bufferp (car handle))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7329 (equal (mm-handle-media-type handle)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7330 "message/rfc822"))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7331 (with-current-buffer (mm-handle-buffer handle)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7332 (when (message-signed-or-encrypted-p dont-emulate-mime)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7333 (throw 'found t)))))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7334 (mm-destroy-parts handles))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7335
41511
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
7336 ;;;###autoload
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
7337 (defun message-forward-make-body (forward-buffer &optional digest)
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
7338 ;; Put point where we want it before inserting the forwarded
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
7339 ;; message.
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
7340 (if message-forward-before-signature
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
7341 (message-goto-body)
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
7342 (goto-char (point-max)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7343 (if digest
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7344 (message-forward-make-body-digest forward-buffer)
41511
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
7345 (if message-forward-as-mime
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7346 (if (and message-forward-show-mml
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7347 (not (and (eq message-forward-show-mml 'best)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7348 ;; Use the raw form in the body if it contains
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7349 ;; signed or encrypted message so as not to be
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7350 ;; destroyed by re-encoding.
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7351 (with-current-buffer forward-buffer
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7352 (condition-case nil
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7353 (message-signed-or-encrypted-p)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7354 (error t))))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7355 (message-forward-make-body-mml forward-buffer)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7356 (message-forward-make-body-mime forward-buffer))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7357 (message-forward-make-body-plain forward-buffer)))
41511
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
7358 (message-position-point))
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
7359
101896
97a01032d9d2 (rmail-msg-restore-non-pruned-header): Remove unneeded autoload of
Glenn Morris <rgm@gnu.org>
parents: 100993
diff changeset
7360 (declare-function rmail-toggle-header "rmail" (&optional arg))
97a01032d9d2 (rmail-msg-restore-non-pruned-header): Remove unneeded autoload of
Glenn Morris <rgm@gnu.org>
parents: 100993
diff changeset
7361
41511
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
7362 ;;;###autoload
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
7363 (defun message-forward-rmail-make-body (forward-buffer)
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
7364 (save-window-excursion
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
7365 (set-buffer forward-buffer)
43075
e14b8be37d7d * message.el (message-forward-rmail-make-body): Directly use
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 42475
diff changeset
7366 (if (rmail-msg-is-pruned)
101896
97a01032d9d2 (rmail-msg-restore-non-pruned-header): Remove unneeded autoload of
Glenn Morris <rgm@gnu.org>
parents: 100993
diff changeset
7367 (if (fboundp 'rmail-msg-restore-non-pruned-header)
97a01032d9d2 (rmail-msg-restore-non-pruned-header): Remove unneeded autoload of
Glenn Morris <rgm@gnu.org>
parents: 100993
diff changeset
7368 (rmail-msg-restore-non-pruned-header) ; Emacs 22
97a01032d9d2 (rmail-msg-restore-non-pruned-header): Remove unneeded autoload of
Glenn Morris <rgm@gnu.org>
parents: 100993
diff changeset
7369 (rmail-toggle-header 0)))) ; Emacs 23
41511
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
7370 (message-forward-make-body forward-buffer))
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
7371
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7372 ;; Fixme: Should have defcustom.
41511
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
7373 ;;;###autoload
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
7374 (defun message-insinuate-rmail ()
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7375 "Let RMAIL use message to forward."
41511
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
7376 (interactive)
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
7377 (setq rmail-enable-mime-composing t)
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49034
diff changeset
7378 (setq rmail-insert-mime-forwarded-message-function
41511
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
7379 'message-forward-rmail-make-body))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7380
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7381 ;;;###autoload
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7382 (defun message-resend (address)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7383 "Resend the current article to ADDRESS."
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7384 (interactive
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7385 (list (message-read-from-minibuffer "Resend message to: ")))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7386 (message "Resending message to %s..." address)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7387 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7388 (let ((cur (current-buffer))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7389 beg)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7390 ;; We first set up a normal mail buffer.
34797
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
7391 (unless (message-mail-user-agent)
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
7392 (set-buffer (get-buffer-create " *message resend*"))
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
7393 (erase-buffer))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7394 (let ((message-this-is-mail t)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7395 message-generate-hashcash
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7396 message-setup-hook)
34797
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
7397 (message-setup `((To . ,address))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7398 ;; Insert our usual headers.
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7399 (message-generate-headers '(From Date To Message-ID))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7400 (message-narrow-to-headers)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7401 ;; Remove X-Draft-From header etc.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7402 (message-remove-header message-ignored-mail-headers t)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7403 ;; Rename them all to "Resent-*".
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7404 (goto-char (point-min))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7405 (while (re-search-forward "^[A-Za-z]" nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7406 (forward-char -1)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7407 (insert "Resent-"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7408 (widen)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7409 (forward-line)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7410 (delete-region (point) (point-max))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7411 (setq beg (point))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7412 ;; Insert the message to be resent.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7413 (insert-buffer-substring cur)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7414 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7415 (search-forward "\n\n")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7416 (forward-char -1)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7417 (save-restriction
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7418 (narrow-to-region beg (point))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7419 (message-remove-header message-ignored-resent-headers t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7420 (goto-char (point-max)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7421 (insert mail-header-separator)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7422 ;; Rename all old ("Also-")Resent headers.
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7423 (while (re-search-backward "^\\(Also-\\)*Resent-" beg t)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7424 (beginning-of-line)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7425 (insert "Also-"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7426 ;; Quote any "From " lines at the beginning.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7427 (goto-char beg)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7428 (when (looking-at "From ")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7429 (replace-match "X-From-Line: "))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7430 ;; Send it.
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7431 (let ((message-inhibit-body-encoding t)
110023
fa10effce8f8 Misc Gnus fixes by Lars Magne Ingebrigtsen <larsi@gnus.org>.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 108513
diff changeset
7432 (message-inhibit-ecomplete t)
61126
c0aa521e0ca7 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-220
Miles Bader <miles@gnu.org>
parents: 60655
diff changeset
7433 message-required-mail-headers
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7434 message-generate-hashcash
61126
c0aa521e0ca7 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-220
Miles Bader <miles@gnu.org>
parents: 60655
diff changeset
7435 rfc2047-encode-encoded-words)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7436 (message-send-mail))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7437 (kill-buffer (current-buffer)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7438 (message "Resending message to %s...done" address)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7439
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7440 ;;;###autoload
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7441 (defun message-bounce ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7442 "Re-mail the current message.
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7443 This only makes sense if the current message is a bounce message that
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7444 contains some mail you have written which has been bounced back to
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7445 you."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7446 (interactive)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7447 (let ((handles (mm-dissect-buffer t))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7448 boundary)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7449 (message-pop-to-buffer (message-buffer-name "bounce"))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7450 (if (stringp (car handles))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7451 ;; This is a MIME bounce.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7452 (mm-insert-part (car (last handles)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7453 ;; This is a non-MIME bounce, so we try to remove things
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7454 ;; manually.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7455 (mm-insert-part handles)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7456 (undo-boundary)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7457 (goto-char (point-min))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7458 (re-search-forward "\n\n+" nil t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7459 (setq boundary (point))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7460 ;; We remove everything before the bounced mail.
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7461 (if (or (re-search-forward message-unsent-separator nil t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7462 (progn
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7463 (search-forward "\n\n" nil 'move)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7464 (re-search-backward "^Return-Path:.*\n" boundary t)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7465 (progn
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7466 (forward-line 1)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7467 (delete-region (point-min)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7468 (if (re-search-forward "^[^ \n\t]+:" nil t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7469 (match-beginning 0)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7470 (point))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7471 (goto-char boundary)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7472 (when (re-search-backward "^.?From .*\n" nil t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7473 (delete-region (match-beginning 0) (match-end 0)))))
78369
2a1e82b0831f Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
7474 (mime-to-mml)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7475 (save-restriction
34752
f04f551e94ce * message.el (message-narrow-to-head-1): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34485
diff changeset
7476 (message-narrow-to-head-1)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7477 (message-remove-header message-ignored-bounced-headers t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7478 (goto-char (point-max))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7479 (insert mail-header-separator))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7480 (message-position-point)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7481
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7482 ;;;
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7483 ;;; Interactive entry points for new message buffers.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7484 ;;;
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7485
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7486 ;;;###autoload
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7487 (defun message-mail-other-window (&optional to subject)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7488 "Like `message-mail' command, but display mail buffer in another window."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7489 (interactive)
34797
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
7490 (unless (message-mail-user-agent)
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
7491 (let ((pop-up-windows t)
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
7492 (special-display-buffer-names nil)
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
7493 (special-display-regexps nil)
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
7494 (same-window-buffer-names nil)
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
7495 (same-window-regexps nil))
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
7496 (message-pop-to-buffer (message-buffer-name "mail" to))))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7497 (let ((message-this-is-mail t))
34797
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
7498 (message-setup `((To . ,(or to "")) (Subject . ,(or subject "")))
76650
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
7499 nil nil nil 'switch-to-buffer-other-window)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7500
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7501 ;;;###autoload
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7502 (defun message-mail-other-frame (&optional to subject)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7503 "Like `message-mail' command, but display mail buffer in another frame."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7504 (interactive)
34797
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
7505 (unless (message-mail-user-agent)
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
7506 (let ((pop-up-frames t)
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
7507 (special-display-buffer-names nil)
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
7508 (special-display-regexps nil)
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
7509 (same-window-buffer-names nil)
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
7510 (same-window-regexps nil))
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
7511 (message-pop-to-buffer (message-buffer-name "mail" to))))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7512 (let ((message-this-is-mail t))
34797
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
7513 (message-setup `((To . ,(or to "")) (Subject . ,(or subject "")))
76650
52354deba43e Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 76267
diff changeset
7514 nil nil nil 'switch-to-buffer-other-frame)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7515
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7516 ;;;###autoload
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7517 (defun message-news-other-window (&optional newsgroups subject)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7518 "Start editing a news article to be sent."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7519 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7520 (let ((pop-up-windows t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7521 (special-display-buffer-names nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7522 (special-display-regexps nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7523 (same-window-buffer-names nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7524 (same-window-regexps nil))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7525 (message-pop-to-buffer (message-buffer-name "posting" nil newsgroups)))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7526 (let ((message-this-is-news t))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7527 (message-setup `((Newsgroups . ,(or newsgroups ""))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7528 (Subject . ,(or subject ""))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7529
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7530 ;;;###autoload
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7531 (defun message-news-other-frame (&optional newsgroups subject)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7532 "Start editing a news article to be sent."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7533 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7534 (let ((pop-up-frames t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7535 (special-display-buffer-names nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7536 (special-display-regexps nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7537 (same-window-buffer-names nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7538 (same-window-regexps nil))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7539 (message-pop-to-buffer (message-buffer-name "posting" nil newsgroups)))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7540 (let ((message-this-is-news t))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7541 (message-setup `((Newsgroups . ,(or newsgroups ""))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7542 (Subject . ,(or subject ""))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7543
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7544 ;;; underline.el
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7545
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7546 ;; This code should be moved to underline.el (from which it is stolen).
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7547
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7548 ;;;###autoload
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7549 (defun message-bold-region (start end)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7550 "Bold all nonblank characters in the region.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7551 Works by overstriking characters.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7552 Called from program, takes two arguments START and END
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7553 which specify the range to operate on."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7554 (interactive "r")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7555 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7556 (let ((end1 (make-marker)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7557 (move-marker end1 (max start end))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7558 (goto-char (min start end))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7559 (while (< (point) end1)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7560 (or (looking-at "[_\^@- ]")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7561 (insert (char-after) "\b"))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7562 (forward-char 1)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7563
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7564 ;;;###autoload
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7565 (defun message-unbold-region (start end)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7566 "Remove all boldness (overstruck characters) in the region.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7567 Called from program, takes two arguments START and END
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7568 which specify the range to operate on."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7569 (interactive "r")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7570 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7571 (let ((end1 (make-marker)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7572 (move-marker end1 (max start end))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7573 (goto-char (min start end))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7574 (while (search-forward "\b" end1 t)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7575 (if (eq (char-after) (char-after (- (point) 2)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7576 (delete-char -2))))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7577
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7578 (defun message-exchange-point-and-mark ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7579 "Exchange point and mark, but don't activate region if it was inactive."
106715
428005d3198e Fix last change to message-exchange-point-and-mark.
Chong Yidong <cyd@stupidchicken.com>
parents: 106693
diff changeset
7580 (goto-char (prog1 (mark t)
428005d3198e Fix last change to message-exchange-point-and-mark.
Chong Yidong <cyd@stupidchicken.com>
parents: 106693
diff changeset
7581 (set-marker (mark-marker) (point)))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7582
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7583 (defalias 'message-make-overlay 'make-overlay)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7584 (defalias 'message-delete-overlay 'delete-overlay)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7585 (defalias 'message-overlay-put 'overlay-put)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7586 (defun message-kill-all-overlays ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7587 (if (featurep 'xemacs)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7588 (map-extents (lambda (extent ignore) (delete-extent extent)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7589 (mapcar #'delete-overlay (overlays-in (point-min) (point-max)))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7590
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7591 ;; Support for toolbar
86154
1cdfc94602cb * smime.el (from):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85974
diff changeset
7592 (defvar tool-bar-mode)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7593
70051
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7594 ;; Note: The :set function in the `message-tool-bar*' variables will only
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7595 ;; affect _new_ message buffers. We might add a function that walks thru all
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7596 ;; message-mode buffers and force the update.
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7597 (defun message-tool-bar-update (&optional symbol value)
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7598 "Update message mode toolbar.
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7599 Setter function for custom variables."
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7600 (setq-default message-tool-bar-map nil)
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7601 (when symbol
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7602 ;; When used as ":set" function:
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7603 (set-default symbol value)))
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7604
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7605 (defcustom message-tool-bar (if (eq gmm-tool-bar-style 'gnome)
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7606 'message-tool-bar-gnome
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7607 'message-tool-bar-retro)
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7608 "Specifies the message mode tool bar.
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7609
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7610 It can be either a list or a symbol refering to a list. See
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7611 `gmm-tool-bar-from-list' for the format of the list. The
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7612 default key map is `message-mode-map'.
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7613
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7614 Pre-defined symbols include `message-tool-bar-gnome' and
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7615 `message-tool-bar-retro'."
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7616 :type '(repeat gmm-tool-bar-list-item)
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7617 :type '(choice (const :tag "GNOME style" message-tool-bar-gnome)
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7618 (const :tag "Retro look" message-tool-bar-retro)
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7619 (repeat :tag "User defined list" gmm-tool-bar-item)
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7620 (symbol))
92336
5f827896103e Change defcustom :version from 23.0 to 23.1.
Glenn Morris <rgm@gnu.org>
parents: 92147
diff changeset
7621 :version "23.1" ;; No Gnus
70051
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7622 :initialize 'custom-initialize-default
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7623 :set 'message-tool-bar-update
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7624 :group 'message)
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7625
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7626 (defcustom message-tool-bar-gnome
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7627 '((ispell-message "spell" nil
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7628 :visible (or (not (boundp 'flyspell-mode))
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7629 (not flyspell-mode)))
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7630 (flyspell-buffer "spell" t
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7631 :visible (and (boundp 'flyspell-mode)
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7632 flyspell-mode)
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7633 :help "Flyspell whole buffer")
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7634 (gmm-ignore "separator")
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7635 (message-send-and-exit "mail/send")
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7636 (message-dont-send "mail/save-draft")
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7637 (message-kill-buffer "close") ;; stock_cancel
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7638 (mml-attach-file "attach" mml-mode-map)
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7639 (mml-preview "mail/preview" mml-mode-map)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7640 (mml-secure-message-sign-encrypt "lock" mml-mode-map :visible nil)
70051
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7641 (message-insert-importance-high "important" nil :visible nil)
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7642 (message-insert-importance-low "unimportant" nil :visible nil)
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7643 (message-insert-disposition-notification-to "receipt" nil :visible nil)
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7644 (gmm-customize-mode "preferences" t :help "Edit mode preferences")
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7645 (message-info "help" t :help "Message manual"))
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7646 "List of items for the message tool bar (GNOME style).
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7647
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7648 See `gmm-tool-bar-from-list' for details on the format of the list."
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7649 :type '(repeat gmm-tool-bar-item)
92336
5f827896103e Change defcustom :version from 23.0 to 23.1.
Glenn Morris <rgm@gnu.org>
parents: 92147
diff changeset
7650 :version "23.1" ;; No Gnus
70051
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7651 :initialize 'custom-initialize-default
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7652 :set 'message-tool-bar-update
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7653 :group 'message)
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7654
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7655 (defcustom message-tool-bar-retro
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7656 '(;; Old Emacs 21 icon for consistency.
79475
609b256953a6 (message-tool-bar-retro): Update for rename mail_send.xpm->mail-send.xpm.
Glenn Morris <rgm@gnu.org>
parents: 79313
diff changeset
7657 (message-send-and-exit "gnus/mail-send")
70051
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7658 (message-kill-buffer "close")
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7659 (message-dont-send "cancel")
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7660 (mml-attach-file "attach" mml-mode-map)
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7661 (ispell-message "spell")
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7662 (mml-preview "preview" mml-mode-map)
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7663 (message-insert-importance-high "gnus/important")
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7664 (message-insert-importance-low "gnus/unimportant")
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7665 (message-insert-disposition-notification-to "gnus/receipt"))
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7666 "List of items for the message tool bar (retro style).
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7667
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7668 See `gmm-tool-bar-from-list' for details on the format of the list."
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7669 :type '(repeat gmm-tool-bar-item)
92336
5f827896103e Change defcustom :version from 23.0 to 23.1.
Glenn Morris <rgm@gnu.org>
parents: 92147
diff changeset
7670 :version "23.1" ;; No Gnus
70051
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7671 :initialize 'custom-initialize-default
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7672 :set 'message-tool-bar-update
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7673 :group 'message)
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7674
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7675 (defcustom message-tool-bar-zap-list
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7676 '(new-file open-file dired kill-buffer write-file
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7677 print-buffer customize help)
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7678 "List of icon items from the global tool bar.
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7679 These items are not displayed on the message mode tool bar.
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7680
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7681 See `gmm-tool-bar-from-list' for the format of the list."
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7682 :type 'gmm-tool-bar-zap-list
92336
5f827896103e Change defcustom :version from 23.0 to 23.1.
Glenn Morris <rgm@gnu.org>
parents: 92147
diff changeset
7683 :version "23.1" ;; No Gnus
70051
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7684 :initialize 'custom-initialize-default
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7685 :set 'message-tool-bar-update
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7686 :group 'message)
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7687
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7688 (defvar image-load-path)
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7689
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7690 (defun message-make-tool-bar (&optional force)
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7691 "Make a message mode tool bar from `message-tool-bar-list'.
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7692 When FORCE, rebuild the tool bar."
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7693 (when (and (not (featurep 'xemacs))
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7694 (boundp 'tool-bar-mode)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7695 tool-bar-mode
70051
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7696 (or (not message-tool-bar-map) force))
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7697 (setq message-tool-bar-map
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7698 (let* ((load-path
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7699 (gmm-image-load-path-for-library "message"
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7700 "mail/save-draft.xpm"
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7701 nil t))
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7702 (image-load-path (cons (car load-path)
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7703 (when (boundp 'image-load-path)
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7704 image-load-path))))
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7705 (gmm-tool-bar-from-list message-tool-bar
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7706 message-tool-bar-zap-list
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7707 'message-mode-map))))
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
7708 message-tool-bar-map)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7709
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7710 ;;; Group name completion.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7711
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7712 (defcustom message-newgroups-header-regexp
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7713 "^\\(Newsgroups\\|Followup-To\\|Posted-To\\|Gcc\\):"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7714 "Regexp that match headers that lists groups."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7715 :group 'message
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7716 :type 'regexp)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7717
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7718 (defcustom message-completion-alist
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7719 (list (cons message-newgroups-header-regexp 'message-expand-group)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7720 '("^\\(Resent-\\)?\\(To\\|B?Cc\\):" . message-expand-name)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7721 '("^\\(Reply-To\\|From\\|Mail-Followup-To\\|Mail-Copies-To\\):"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7722 . message-expand-name)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7723 '("^\\(Disposition-Notification-To\\|Return-Receipt-To\\):"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7724 . message-expand-name))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7725 "Alist of (RE . FUN). Use FUN for completion on header lines matching RE."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59756
diff changeset
7726 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7727 :group 'message
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7728 :type '(alist :key-type regexp :value-type function))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7729
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7730 (defcustom message-expand-name-databases
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7731 (list 'bbdb 'eudc)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7732 "List of databases to try for name completion (`message-expand-name').
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7733 Each element is a symbol and can be `bbdb' or `eudc'."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7734 :group 'message
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7735 :type '(set (const bbdb) (const eudc)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7736
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7737 (defcustom message-tab-body-function nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7738 "*Function to execute when `message-tab' (TAB) is executed in the body.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7739 If nil, the function bound in `text-mode-map' or `global-map' is executed."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59756
diff changeset
7740 :version "22.1"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7741 :group 'message
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7742 :link '(custom-manual "(message)Various Commands")
65342
c71b1b2d2d04 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-530
Miles Bader <miles@gnu.org>
parents: 64780
diff changeset
7743 :type '(choice (const nil)
c71b1b2d2d04 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-530
Miles Bader <miles@gnu.org>
parents: 64780
diff changeset
7744 function))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7745
87191
066a2efbc9c8 (declare-function): Add compatibility declaration.
Glenn Morris <rgm@gnu.org>
parents: 87097
diff changeset
7746 (declare-function mail-abbrev-in-expansion-header-p "mailabbrev" ())
066a2efbc9c8 (declare-function): Add compatibility declaration.
Glenn Morris <rgm@gnu.org>
parents: 87097
diff changeset
7747
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7748 (defun message-tab ()
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7749 "Complete names according to `message-completion-alist'.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7750 Execute function specified by `message-tab-body-function' when not in
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7751 those headers."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7752 (interactive)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7753 (let ((alist message-completion-alist))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7754 (while (and alist
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7755 (let ((mail-abbrev-mode-regexp (caar alist)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7756 (not (mail-abbrev-in-expansion-header-p))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7757 (setq alist (cdr alist)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7758 (funcall (or (cdar alist) message-tab-body-function
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7759 (lookup-key text-mode-map "\t")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7760 (lookup-key global-map "\t")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7761 'indent-relative))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7762
66573
e65b759c6906 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-630
Miles Bader <miles@gnu.org>
parents: 66299
diff changeset
7763 (eval-and-compile
e65b759c6906 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-630
Miles Bader <miles@gnu.org>
parents: 66299
diff changeset
7764 (condition-case nil
e65b759c6906 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-630
Miles Bader <miles@gnu.org>
parents: 66299
diff changeset
7765 (with-temp-buffer
e65b759c6906 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-630
Miles Bader <miles@gnu.org>
parents: 66299
diff changeset
7766 (let ((standard-output (current-buffer)))
e65b759c6906 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-630
Miles Bader <miles@gnu.org>
parents: 66299
diff changeset
7767 (eval '(display-completion-list nil "")))
e65b759c6906 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-630
Miles Bader <miles@gnu.org>
parents: 66299
diff changeset
7768 (defalias 'message-display-completion-list 'display-completion-list))
e65b759c6906 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-630
Miles Bader <miles@gnu.org>
parents: 66299
diff changeset
7769 (error ;; Don't use `wrong-number-of-arguments' here because of XEmacs.
e65b759c6906 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-630
Miles Bader <miles@gnu.org>
parents: 66299
diff changeset
7770 (defun message-display-completion-list (completions &optional ignore)
e65b759c6906 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-630
Miles Bader <miles@gnu.org>
parents: 66299
diff changeset
7771 "Display the list of completions, COMPLETIONS, using `standard-output'."
e65b759c6906 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-630
Miles Bader <miles@gnu.org>
parents: 66299
diff changeset
7772 (display-completion-list completions)))))
e65b759c6906 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-630
Miles Bader <miles@gnu.org>
parents: 66299
diff changeset
7773
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7774 (defun message-expand-group ()
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7775 "Expand the group name under point."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7776 (let* ((b (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7777 (save-restriction
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7778 (narrow-to-region
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7779 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7780 (beginning-of-line)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7781 (skip-chars-forward "^:")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7782 (1+ (point)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7783 (point))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7784 (skip-chars-backward "^, \t\n") (point))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7785 (completion-ignore-case t)
106372
9baad4abae40 (message-completion-in-region): New compatibility function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106358
diff changeset
7786 (e (progn (skip-chars-forward "^,\t\n ") (point)))
9baad4abae40 (message-completion-in-region): New compatibility function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106358
diff changeset
7787 (hashtb (and (boundp 'gnus-active-hashtb) gnus-active-hashtb)))
9baad4abae40 (message-completion-in-region): New compatibility function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106358
diff changeset
7788 (message-completion-in-region e b hashtb)))
9baad4abae40 (message-completion-in-region): New compatibility function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106358
diff changeset
7789
9baad4abae40 (message-completion-in-region): New compatibility function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106358
diff changeset
7790 (defalias 'message-completion-in-region
9baad4abae40 (message-completion-in-region): New compatibility function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106358
diff changeset
7791 (if (fboundp 'completion-in-region)
9baad4abae40 (message-completion-in-region): New compatibility function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106358
diff changeset
7792 'completion-in-region
9baad4abae40 (message-completion-in-region): New compatibility function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106358
diff changeset
7793 (lambda (e b hashtb)
9baad4abae40 (message-completion-in-region): New compatibility function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106358
diff changeset
7794 (let* ((string (buffer-substring b e))
9baad4abae40 (message-completion-in-region): New compatibility function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106358
diff changeset
7795 (completions (all-completions string hashtb))
9baad4abae40 (message-completion-in-region): New compatibility function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106358
diff changeset
7796 comp)
9baad4abae40 (message-completion-in-region): New compatibility function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106358
diff changeset
7797 (delete-region b (point))
9baad4abae40 (message-completion-in-region): New compatibility function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106358
diff changeset
7798 (cond
9baad4abae40 (message-completion-in-region): New compatibility function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106358
diff changeset
7799 ((= (length completions) 1)
9baad4abae40 (message-completion-in-region): New compatibility function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106358
diff changeset
7800 (if (string= (car completions) string)
9baad4abae40 (message-completion-in-region): New compatibility function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106358
diff changeset
7801 (progn
9baad4abae40 (message-completion-in-region): New compatibility function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106358
diff changeset
7802 (insert string)
9baad4abae40 (message-completion-in-region): New compatibility function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106358
diff changeset
7803 (message "Only matching group"))
9baad4abae40 (message-completion-in-region): New compatibility function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106358
diff changeset
7804 (insert (car completions))))
9baad4abae40 (message-completion-in-region): New compatibility function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106358
diff changeset
7805 ((and (setq comp (try-completion string hashtb))
9baad4abae40 (message-completion-in-region): New compatibility function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106358
diff changeset
7806 (not (string= comp string)))
9baad4abae40 (message-completion-in-region): New compatibility function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106358
diff changeset
7807 (insert comp))
9baad4abae40 (message-completion-in-region): New compatibility function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106358
diff changeset
7808 (t
9baad4abae40 (message-completion-in-region): New compatibility function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106358
diff changeset
7809 (insert string)
9baad4abae40 (message-completion-in-region): New compatibility function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106358
diff changeset
7810 (if (not comp)
9baad4abae40 (message-completion-in-region): New compatibility function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106358
diff changeset
7811 (message "No matching groups")
9baad4abae40 (message-completion-in-region): New compatibility function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106358
diff changeset
7812 (save-selected-window
9baad4abae40 (message-completion-in-region): New compatibility function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106358
diff changeset
7813 (pop-to-buffer "*Completions*")
9baad4abae40 (message-completion-in-region): New compatibility function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106358
diff changeset
7814 (buffer-disable-undo)
9baad4abae40 (message-completion-in-region): New compatibility function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106358
diff changeset
7815 (let ((buffer-read-only nil))
9baad4abae40 (message-completion-in-region): New compatibility function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106358
diff changeset
7816 (erase-buffer)
9baad4abae40 (message-completion-in-region): New compatibility function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106358
diff changeset
7817 (let ((standard-output (current-buffer)))
9baad4abae40 (message-completion-in-region): New compatibility function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106358
diff changeset
7818 (message-display-completion-list (sort completions 'string<)
9baad4abae40 (message-completion-in-region): New compatibility function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106358
diff changeset
7819 string))
9baad4abae40 (message-completion-in-region): New compatibility function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106358
diff changeset
7820 (setq buffer-read-only nil)
9baad4abae40 (message-completion-in-region): New compatibility function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106358
diff changeset
7821 (goto-char (point-min))
9baad4abae40 (message-completion-in-region): New compatibility function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106358
diff changeset
7822 (delete-region (point)
9baad4abae40 (message-completion-in-region): New compatibility function.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 106358
diff changeset
7823 (progn (forward-line 3) (point))))))))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7824
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7825 (defun message-expand-name ()
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7826 (cond ((and (memq 'eudc message-expand-name-databases)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7827 (boundp 'eudc-protocol)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7828 eudc-protocol)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7829 (eudc-expand-inline))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7830 ((and (memq 'bbdb message-expand-name-databases)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7831 (fboundp 'bbdb-complete-name))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7832 (bbdb-complete-name))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7833 (t
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7834 (expand-abbrev))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7835
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7836 ;;; Help stuff.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7837
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7838 (defun message-talkative-question (ask question show &rest text)
19525
59026d8478f7 Require cl only at compile time.
Richard M. Stallman <rms@gnu.org>
parents: 19481
diff changeset
7839 "Call FUNCTION with argument QUESTION; optionally display TEXT... args.
59026d8478f7 Require cl only at compile time.
Richard M. Stallman <rms@gnu.org>
parents: 19481
diff changeset
7840 If SHOW is non-nil, the arguments TEXT... are displayed in a temp buffer.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7841 The following arguments may contain lists of values."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7842 (if (and show
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7843 (setq text (message-flatten-list text)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7844 (save-window-excursion
86339
6f4793ab0756 (message-send-mail-function): Fix error convention.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 86276
diff changeset
7845 (with-output-to-temp-buffer " *MESSAGE information message*"
6f4793ab0756 (message-send-mail-function): Fix error convention.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 86276
diff changeset
7846 (with-current-buffer " *MESSAGE information message*"
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7847 (fundamental-mode) ; for Emacs 20.4+
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
7848 (mapc 'princ text)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7849 (goto-char (point-min))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7850 (funcall ask question))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7851 (funcall ask question)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7852
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7853 (defun message-flatten-list (list)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7854 "Return a new, flat list that contains all elements of LIST.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7855
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7856 \(message-flatten-list '(1 (2 3 (4 5 (6))) 7))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7857 => (1 2 3 4 5 6 7)"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7858 (cond ((consp list)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7859 (apply 'append (mapcar 'message-flatten-list list)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7860 (list
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7861 (list list))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7862
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7863 (defun message-generate-new-buffer-clone-locals (name &optional varstr)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7864 "Create and return a buffer with name based on NAME using `generate-new-buffer'.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7865 Then clone the local variables and values from the old buffer to the
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7866 new one, cloning only the locals having a substring matching the
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7867 regexp VARSTR."
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
7868 (let ((oldbuf (current-buffer)))
86339
6f4793ab0756 (message-send-mail-function): Fix error convention.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 86276
diff changeset
7869 (with-current-buffer (generate-new-buffer name)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7870 (message-clone-locals oldbuf varstr)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7871 (current-buffer))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7872
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7873 (defun message-clone-locals (buffer &optional varstr)
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
7874 "Clone the local variables from BUFFER to the current buffer."
86339
6f4793ab0756 (message-send-mail-function): Fix error convention.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 86276
diff changeset
7875 (let ((locals (with-current-buffer buffer (buffer-local-variables)))
57243
c5e16264557d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-575
Miles Bader <miles@gnu.org>
parents: 57153
diff changeset
7876 (regexp "^gnus\\|^nn\\|^message\\|^sendmail\\|^smtp\\|^user-mail-address"))
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
7877 (mapcar
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
7878 (lambda (local)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7879 (when (and (consp local)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7880 (car local)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7881 (string-match regexp (symbol-name (car local)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7882 (or (null varstr)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7883 (string-match varstr (symbol-name (car local)))))
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
7884 (ignore-errors
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
7885 (set (make-local-variable (car local))
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
7886 (cdr local)))))
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
7887 locals)))
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
7888
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7889 ;;;
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7890 ;;; MIME functions
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7891 ;;;
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7892
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7893 (defvar message-inhibit-body-encoding nil)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7894
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7895 (defun message-encode-message-body ()
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
7896 (unless message-inhibit-body-encoding
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7897 (let ((mail-parse-charset (or mail-parse-charset
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7898 message-default-charset))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7899 (case-fold-search t)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7900 lines content-type-p)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7901 (message-goto-body)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7902 (save-restriction
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7903 (narrow-to-region (point) (point-max))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7904 (let ((new (mml-generate-mime)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7905 (when new
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7906 (delete-region (point-min) (point-max))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7907 (insert new)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7908 (goto-char (point-min))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7909 (if (eq (aref new 0) ?\n)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7910 (delete-char 1)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7911 (search-forward "\n\n")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7912 (setq lines (buffer-substring (point-min) (1- (point))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7913 (delete-region (point-min) (point))))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7914 (save-restriction
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7915 (message-narrow-to-headers-or-head)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7916 (message-remove-header "Mime-Version")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7917 (goto-char (point-max))
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
7918 (insert "MIME-Version: 1.0\n")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7919 (when lines
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7920 (insert lines))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7921 (setq content-type-p
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7922 (or mml-boundary
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7923 (re-search-backward "^Content-Type:" nil t))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7924 (save-restriction
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7925 (message-narrow-to-headers-or-head)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7926 (message-remove-first-header "Content-Type")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7927 (message-remove-first-header "Content-Transfer-Encoding"))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7928 ;; We always make sure that the message has a Content-Type
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7929 ;; header. This is because some broken MTAs and MUAs get
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7930 ;; awfully confused when confronted with a message with a
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7931 ;; MIME-Version header and without a Content-Type header. For
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7932 ;; instance, Solaris' /usr/bin/mail.
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7933 (unless content-type-p
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7934 (goto-char (point-min))
41511
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
7935 ;; For unknown reason, MIME-Version doesn't exist.
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
7936 (when (re-search-forward "^MIME-Version:" nil t)
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
7937 (forward-line 1)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
7938 (insert "Content-Type: text/plain; charset=us-ascii\n"))))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7939
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7940 (defun message-read-from-minibuffer (prompt &optional initial-contents)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7941 "Read from the minibuffer while providing abbrev expansion."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7942 (if (fboundp 'mail-abbrevs-setup)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7943 (let ((mail-abbrev-mode-regexp "")
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7944 (minibuffer-setup-hook 'mail-abbrevs-setup)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7945 (minibuffer-local-map message-minibuffer-local-map))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7946 (read-from-minibuffer prompt initial-contents))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7947 (let ((minibuffer-setup-hook 'mail-abbrev-minibuffer-setup-hook)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7948 (minibuffer-local-map message-minibuffer-local-map))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7949 (read-string prompt initial-contents))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7950
32967
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
7951 (defun message-use-alternative-email-as-from ()
68521
04c2548593f7 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-33
Miles Bader <miles@gnu.org>
parents: 68230
diff changeset
7952 "Set From field of the outgoing message to the first matching
04c2548593f7 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-33
Miles Bader <miles@gnu.org>
parents: 68230
diff changeset
7953 address in `message-alternative-emails', looking at To, Cc and
04c2548593f7 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-33
Miles Bader <miles@gnu.org>
parents: 68230
diff changeset
7954 From headers in the original article."
32967
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
7955 (require 'mail-utils)
79313
f4c90d55f00f Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 78369
diff changeset
7956 (let* ((fields '("To" "Cc" "From"))
32967
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
7957 (emails
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
7958 (split-string
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
7959 (mail-strip-quoted-names
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
7960 (mapconcat 'message-fetch-reply-field fields ","))
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
7961 "[ \f\t\n\r\v,]+"))
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
7962 email)
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
7963 (while emails
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
7964 (if (string-match message-alternative-emails (car emails))
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
7965 (setq email (car emails)
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
7966 emails nil))
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
7967 (pop emails))
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
7968 (unless (or (not email) (equal email user-mail-address))
68521
04c2548593f7 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-33
Miles Bader <miles@gnu.org>
parents: 68230
diff changeset
7969 (message-remove-header "From")
32967
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
7970 (goto-char (point-max))
79313
f4c90d55f00f Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 78369
diff changeset
7971 (insert "From: " (let ((user-mail-address email)) (message-make-from))
f4c90d55f00f Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 78369
diff changeset
7972 "\n"))))
32967
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
7973
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7974 (defun message-options-get (symbol)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7975 (cdr (assq symbol message-options)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7976
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7977 (defun message-options-set (symbol value)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7978 (let ((the-cons (assq symbol message-options)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7979 (if the-cons
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7980 (if value
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7981 (setcdr the-cons value)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7982 (setq message-options (delq the-cons message-options)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7983 (and value
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7984 (push (cons symbol value) message-options))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7985 value)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7986
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7987 (defun message-options-set-recipient ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7988 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7989 (message-narrow-to-headers-or-head)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7990 (message-options-set 'message-sender
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7991 (mail-strip-quoted-names
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7992 (message-fetch-field "from")))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7993 (message-options-set 'message-recipients
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7994 (mail-strip-quoted-names
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7995 (let ((to (message-fetch-field "to"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7996 (cc (message-fetch-field "cc"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7997 (bcc (message-fetch-field "bcc")))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7998 (concat
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7999 (or to "")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
8000 (if (and to cc) ", ")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
8001 (or cc "")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
8002 (if (and (or to cc) bcc) ", ")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
8003 (or bcc "")))))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
8004
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
8005 (defun message-hide-headers ()
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
8006 "Hide headers based on the `message-hidden-headers' variable."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
8007 (let ((regexps (if (stringp message-hidden-headers)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
8008 (list message-hidden-headers)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
8009 message-hidden-headers))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
8010 (inhibit-point-motion-hooks t)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
8011 (after-change-functions nil)
85766
68503cda7180 (message-check-news-body-syntax): Avoid mm-string-as-multibyte.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85712
diff changeset
8012 (end-of-headers (point-min)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
8013 (when regexps
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
8014 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
8015 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
8016 (message-narrow-to-headers)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
8017 (goto-char (point-min))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
8018 (while (not (eobp))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
8019 (if (not (message-hide-header-p regexps))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
8020 (message-next-header)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
8021 (let ((begin (point))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
8022 header header-len)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
8023 (message-next-header)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
8024 (setq header (buffer-substring begin (point))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
8025 header-len (- (point) begin))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
8026 (delete-region begin (point))
85766
68503cda7180 (message-check-news-body-syntax): Avoid mm-string-as-multibyte.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85712
diff changeset
8027 (goto-char end-of-headers)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
8028 (insert header)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
8029 (setq end-of-headers
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
8030 (+ end-of-headers header-len))))))))
85766
68503cda7180 (message-check-news-body-syntax): Avoid mm-string-as-multibyte.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85712
diff changeset
8031 (narrow-to-region end-of-headers (point-max))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
8032
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
8033 (defun message-hide-header-p (regexps)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
8034 (let ((result nil)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
8035 (reverse nil))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
8036 (when (eq (car regexps) 'not)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
8037 (setq reverse t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
8038 (pop regexps))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
8039 (dolist (regexp regexps)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
8040 (setq result (or result (looking-at regexp))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
8041 (if reverse
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
8042 (not result)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
8043 result)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
8044
107427
ecbe0edc4f69 Stop message.el from loading about 40 libraries it doesn't always need.
Glenn Morris <rgm@gnu.org>
parents: 107235
diff changeset
8045 (declare-function ecomplete-add-item "ecomplete" (type key text))
ecbe0edc4f69 Stop message.el from loading about 40 libraries it doesn't always need.
Glenn Morris <rgm@gnu.org>
parents: 107235
diff changeset
8046 (declare-function ecomplete-save "ecomplete" ())
ecbe0edc4f69 Stop message.el from loading about 40 libraries it doesn't always need.
Glenn Morris <rgm@gnu.org>
parents: 107235
diff changeset
8047
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
8048 (defun message-put-addresses-in-ecomplete ()
107427
ecbe0edc4f69 Stop message.el from loading about 40 libraries it doesn't always need.
Glenn Morris <rgm@gnu.org>
parents: 107235
diff changeset
8049 (require 'ecomplete)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
8050 (dolist (header '("to" "cc" "from" "reply-to"))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
8051 (let ((value (message-field-value header)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
8052 (dolist (string (mail-header-parse-addresses value 'raw))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
8053 (setq string
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
8054 (gnus-replace-in-string
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
8055 (gnus-replace-in-string string "^ +\\| +$" "") "\n" ""))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
8056 (ecomplete-add-item 'mail (car (mail-header-parse-address string))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
8057 string))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
8058 (ecomplete-save))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
8059
107427
ecbe0edc4f69 Stop message.el from loading about 40 libraries it doesn't always need.
Glenn Morris <rgm@gnu.org>
parents: 107235
diff changeset
8060 (autoload 'ecomplete-display-matches "ecomplete")
ecbe0edc4f69 Stop message.el from loading about 40 libraries it doesn't always need.
Glenn Morris <rgm@gnu.org>
parents: 107235
diff changeset
8061
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
8062 (defun message-display-abbrev (&optional choose)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
8063 "Display the next possible abbrev for the text before point."
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
8064 (interactive (list t))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
8065 (when (and (memq (char-after (point-at-bol)) '(?C ?T ?\t ? ))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
8066 (message-point-in-header-p)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
8067 (save-excursion
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
8068 (beginning-of-line)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
8069 (while (and (memq (char-after) '(?\t ? ))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
8070 (zerop (forward-line -1))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
8071 (looking-at "To:\\|Cc:")))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
8072 (let* ((end (point))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
8073 (start (save-excursion
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
8074 (and (re-search-backward "[\n\t ]" nil t)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
8075 (1+ (point)))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
8076 (word (when start (buffer-substring start end)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
8077 (match (when (and word
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
8078 (not (zerop (length word))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
8079 (ecomplete-display-matches 'mail word choose))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
8080 (when (and choose match)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
8081 (delete-region start end)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
8082 (insert match)))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 82221
diff changeset
8083
92694
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8084 ;; To send pre-formatted letters like the example below, you can use
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8085 ;; `message-send-form-letter':
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8086 ;; --8<---------------cut here---------------start------------->8---
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8087 ;; To: alice@invalid.invalid
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8088 ;; Subject: Verification of your contact information
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8089 ;; From: Contact verification <admin@foo.invalid>
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8090 ;; --text follows this line--
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8091 ;; Hi Alice,
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8092 ;; please verify that your contact information is still valid:
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8093 ;; Alice A, A avenue 11, 1111 A town, Austria
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8094 ;; ----------next form letter message follows this line----------
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8095 ;; To: bob@invalid.invalid
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8096 ;; Subject: Verification of your contact information
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8097 ;; From: Contact verification <admin@foo.invalid>
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8098 ;; --text follows this line--
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8099 ;; Hi Bob,
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8100 ;; please verify that your contact information is still valid:
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8101 ;; Bob, B street 22, 22222 Be town, Belgium
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8102 ;; ----------next form letter message follows this line----------
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8103 ;; To: charlie@invalid.invalid
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8104 ;; Subject: Verification of your contact information
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8105 ;; From: Contact verification <admin@foo.invalid>
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8106 ;; --text follows this line--
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8107 ;; Hi Charlie,
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8108 ;; please verify that your contact information is still valid:
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8109 ;; Charlie Chaplin, C plaza 33, 33333 C town, Chile
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8110 ;; --8<---------------cut here---------------end--------------->8---
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8111
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8112 ;; FIXME: What is the most common term (circular letter, form letter, serial
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8113 ;; letter, standard letter) for such kind of letter? See also
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8114 ;; <http://en.wikipedia.org/wiki/Form_letter>
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8115
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8116 ;; FIXME: Maybe extent message-mode's font-lock support to recognize
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8117 ;; `message-form-letter-separator', i.e. highlight each message like a single
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8118 ;; message.
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8119
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8120 (defcustom message-form-letter-separator
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8121 "\n----------next form letter message follows this line----------\n"
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8122 "Separator for `message-send-form-letter'."
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8123 ;; :group 'message-form-letter
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8124 :group 'message-various
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8125 :version "23.1" ;; No Gnus
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8126 :type 'string)
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8127
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8128 (defcustom message-send-form-letter-delay 1
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8129 "Delay in seconds when sending a message with `message-send-form-letter'.
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8130 Only used when `message-send-form-letter' is called with non-nil
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8131 argument `force'."
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8132 ;; :group 'message-form-letter
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8133 :group 'message-various
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8134 :version "23.1" ;; No Gnus
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8135 :type 'integer)
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8136
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8137 (defun message-send-form-letter (&optional force)
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8138 "Sent all form letter messages from current buffer.
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8139 Unless FORCE, prompt before sending.
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8140
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8141 The messages are separated by `message-form-letter-separator'.
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8142 Header and body are separated by `mail-header-separator'."
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8143 (interactive "P")
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8144 (let ((sent 0) (skipped 0)
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8145 start end text
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8146 buff
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8147 to done)
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8148 (goto-char (point-min))
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8149 (while (not done)
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8150 (setq start (point)
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8151 end (if (search-forward message-form-letter-separator nil t)
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8152 (- (point) (length message-form-letter-separator) -1)
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8153 (setq done t)
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8154 (point-max)))
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8155 (setq text
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8156 (buffer-substring-no-properties start end))
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8157 (setq buff (generate-new-buffer "*mail - form letter*"))
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8158 (with-current-buffer buff
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8159 (insert text)
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8160 (message-mode)
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8161 (setq to (message-fetch-field "To"))
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8162 (switch-to-buffer buff)
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8163 (when force
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8164 (sit-for message-send-form-letter-delay))
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8165 (if (or force
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8166 (y-or-n-p (format "Send message to `%s'? " to)))
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8167 (progn
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8168 (setq sent (1+ sent))
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8169 (message-send-and-exit))
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8170 (message (format "Message to `%s' skipped." to))
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8171 (setq skipped (1+ skipped)))
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8172 (when (buffer-live-p buff)
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8173 (kill-buffer buff))))
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8174 (message "%s message(s) sent, %s skipped." sent skipped)))
d3767aa9ae49 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92336
diff changeset
8175
93386
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8176 (defun message-replace-header (header new-value &optional after force)
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8177 "Remove HEADER and insert the NEW-VALUE.
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8178 If AFTER, insert after this header. If FORCE, insert new field
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8179 even if NEW-VALUE is empty."
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8180 ;; Similar to `nnheader-replace-header' but for message buffers.
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8181 (save-excursion
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8182 (save-restriction
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8183 (message-narrow-to-headers)
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8184 (message-remove-header header))
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8185 (when (or force (> (length new-value) 0))
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8186 (if after
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8187 (message-position-on-field header after)
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8188 (message-position-on-field header))
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8189 (insert new-value))))
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8190
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8191 (defcustom message-recipients-without-full-name
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8192 (list "ding@gnus.org"
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8193 "bugs@gnus.org"
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8194 "emacs-devel@gnu.org"
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8195 "emacs-pretest-bug@gnu.org"
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8196 "bug-gnu-emacs@gnu.org")
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8197 "Mail addresses that have no full name.
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8198 Used in `message-simplify-recipients'."
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8199 ;; Maybe the addresses could be extracted from
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8200 ;; `gnus-parameter-to-list-alist'?
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8201 :type '(choice (const :tag "None" nil)
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8202 (repeat string))
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8203 :version "23.1" ;; No Gnus
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8204 :group 'message-headers)
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8205
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8206 (defun message-simplify-recipients ()
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8207 (interactive)
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8208 (dolist (hdr '("Cc" "To"))
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8209 (message-replace-header
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8210 hdr
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8211 (mapconcat
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8212 (lambda (addrcomp)
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8213 (if (and message-recipients-without-full-name
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8214 (string-match
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8215 (regexp-opt message-recipients-without-full-name)
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8216 (cadr addrcomp)))
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8217 (cadr addrcomp)
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8218 (if (car addrcomp)
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8219 (message-make-from (car addrcomp) (cadr addrcomp))
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8220 (cadr addrcomp))))
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8221 (when (message-fetch-field hdr)
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8222 (mail-extract-address-components
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8223 (message-fetch-field hdr) t))
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8224 ", "))))
a789a1138b08 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 92754
diff changeset
8225
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
8226 (when (featurep 'xemacs)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
8227 (require 'messagexmas)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
8228 (message-xmas-redefine))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
8229
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
8230 (provide 'message)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
8231
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8232 (run-hooks 'message-load-hook)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8233
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
8234 ;; Local Variables:
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
8235 ;; coding: iso-8859-1
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
8236 ;; End:
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8237
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8238 ;;; message.el ends here